[med-svn] [python-pysam] 01/03: Deleting files that are no longer used by upstream

Jorge Soares jssoares-guest at moszumanska.debian.org
Wed Nov 26 11:37:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

jssoares-guest pushed a commit to branch master
in repository python-pysam.

commit fad9a6676aed6eeff523117cd6b6d89f49445257
Author: Jorge Soares <j.s.soares at gmail.com>
Date:   Wed Nov 26 11:32:16 2014 +0000

    Deleting files that are no longer used by upstream
---
 PKG-INFO                            |    16 -
 doc/out                             |    30 -
 pysam.egg-info/PKG-INFO             |    16 -
 pysam.egg-info/SOURCES.txt          |   204 -
 pysam.egg-info/dependency_links.txt |     1 -
 pysam.egg-info/not-zip-safe         |     1 -
 pysam.egg-info/top_level.txt        |     1 -
 pysam/TabProxies.c                  | 14076 ----------
 pysam/calignmentfile.c              | 48377 ----------------------------------
 pysam/cfaidx.c                      |  8717 ------
 pysam/chtslib.c                     |  3162 ---
 pysam/csamfile.c                    |  2876 --
 pysam/csamtools.c                   |  6962 -----
 pysam/ctabix.c                      | 15462 -----------
 pysam/cvcf.c                        | 30127 ---------------------
 15 files changed, 130028 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
deleted file mode 100644
index 354479b..0000000
--- a/PKG-INFO
+++ /dev/null
@@ -1,16 +0,0 @@
-Metadata-Version: 1.1
-Name: pysam
-Version: 0.8.1
-Summary: pysam
-Home-page: https://github.com/pysam-developers/pysam
-Author: Andreas Heger
-Author-email: andreas.heger at gmail.com
-License: MIT
-Description: 
-        
-        pysam
-        *****
-        
-        
-Platform: ALL
-Requires: cython (>=0.20.1)
diff --git a/doc/out b/doc/out
deleted file mode 100644
index 8e2f6d1..0000000
--- a/doc/out
+++ /dev/null
@@ -1,30 +0,0 @@
-sphinx-build -b html -d _build/doctrees   . _build/html
-Running Sphinx v1.1.3
-loading pickled environment... done
-building [html]: targets for 0 source files that are out of date
-updating environment: 0 added, 1 changed, 0 removed
-reading sources... [100%] index
-
-/home/andreas/devel/pysam/doc/index.rst:23: WARNING: toctree contains reference to nonexisting document u'tabix'
-/home/andreas/devel/pysam/doc/index.rst:73: WARNING: Duplicate explicit target name: "samtools".
-/home/andreas/devel/pysam/doc/index.rst:74: WARNING: Duplicate explicit target name: "htslib".
-/home/andreas/devel/pysam/doc/index.rst:75: WARNING: Duplicate explicit target name: "tabix".
-/home/andreas/devel/pysam/doc/index.rst:77: WARNING: Duplicate explicit target name: "cython".
-/home/andreas/devel/pysam/doc/index.rst:78: WARNING: Duplicate explicit target name: "python".
-/home/andreas/devel/pysam/doc/index.rst:12: ERROR: Duplicate target name, cannot be used as a unique reference: "htslib".
-/home/andreas/devel/pysam/doc/index.rst:12: ERROR: Duplicate target name, cannot be used as a unique reference: "cython".
-/home/andreas/devel/pysam/doc/index.rst:12: ERROR: Duplicate target name, cannot be used as a unique reference: "samtools".
-/home/andreas/devel/pysam/doc/index.rst:12: ERROR: Duplicate target name, cannot be used as a unique reference: "tabix".
-looking for now-outdated files... none found
-pickling environment... done
-checking consistency... done
-preparing documents... done
-writing output... [100%] index
-
-writing additional files... genindex py-modindex search
-copying static files... done
-dumping search index... done
-dumping object inventory... done
-build succeeded, 10 warnings.
-
-Build finished. The HTML pages are in _build/html.
diff --git a/pysam.egg-info/PKG-INFO b/pysam.egg-info/PKG-INFO
deleted file mode 100644
index 354479b..0000000
--- a/pysam.egg-info/PKG-INFO
+++ /dev/null
@@ -1,16 +0,0 @@
-Metadata-Version: 1.1
-Name: pysam
-Version: 0.8.1
-Summary: pysam
-Home-page: https://github.com/pysam-developers/pysam
-Author: Andreas Heger
-Author-email: andreas.heger at gmail.com
-License: MIT
-Description: 
-        
-        pysam
-        *****
-        
-        
-Platform: ALL
-Requires: cython (>=0.20.1)
diff --git a/pysam.egg-info/SOURCES.txt b/pysam.egg-info/SOURCES.txt
deleted file mode 100644
index ee169f1..0000000
--- a/pysam.egg-info/SOURCES.txt
+++ /dev/null
@@ -1,204 +0,0 @@
-COPYING
-INSTALL
-KNOWN_BUGS
-MANIFEST.in
-README.rst
-THANKS
-pysam.py
-setup.cfg
-setup.py
-doc/Makefile
-doc/api.rst
-doc/conf.py
-doc/developer.rst
-doc/faq.rst
-doc/glossary.rst
-doc/index.rst
-doc/make.bat
-doc/out
-doc/release.rst
-doc/usage.rst
-htslib/bgzf.c
-htslib/bgzip.c
-htslib/config.h
-htslib/faidx.c
-htslib/hfile.c
-htslib/hfile_internal.h
-htslib/hfile_net.c
-htslib/hts.c
-htslib/kfunc.c
-htslib/knetfile.c
-htslib/kstring.c
-htslib/sam.c
-htslib/synced_bcf_reader.c
-htslib/tabix.c
-htslib/tbx.c
-htslib/vcf.c
-htslib/vcf_sweep.c
-htslib/vcfutils.c
-htslib/version.h
-htslib/cram/cram.h
-htslib/cram/cram_codecs.c
-htslib/cram/cram_codecs.h
-htslib/cram/cram_decode.c
-htslib/cram/cram_decode.h
-htslib/cram/cram_encode.c
-htslib/cram/cram_encode.h
-htslib/cram/cram_index.c
-htslib/cram/cram_index.h
-htslib/cram/cram_io.c
-htslib/cram/cram_io.h
-htslib/cram/cram_samtools.c
-htslib/cram/cram_samtools.h
-htslib/cram/cram_stats.c
-htslib/cram/cram_stats.h
-htslib/cram/cram_structs.h
-htslib/cram/files.c
-htslib/cram/mFILE.c
-htslib/cram/mFILE.h
-htslib/cram/md5.c
-htslib/cram/md5.h
-htslib/cram/misc.h
-htslib/cram/open_trace_file.c
-htslib/cram/open_trace_file.h
-htslib/cram/os.h
-htslib/cram/pooled_alloc.c
-htslib/cram/pooled_alloc.h
-htslib/cram/sam_header.c
-htslib/cram/sam_header.h
-htslib/cram/string_alloc.c
-htslib/cram/string_alloc.h
-htslib/cram/thread_pool.c
-htslib/cram/thread_pool.h
-htslib/cram/vlen.c
-htslib/cram/vlen.h
-htslib/cram/zfio.c
-htslib/cram/zfio.h
-htslib/htslib/bgzf.h
-htslib/htslib/faidx.h
-htslib/htslib/hfile.h
-htslib/htslib/hts.h
-htslib/htslib/hts_defs.h
-htslib/htslib/kfunc.h
-htslib/htslib/khash.h
-htslib/htslib/khash_str2int.h
-htslib/htslib/klist.h
-htslib/htslib/knetfile.h
-htslib/htslib/kseq.h
-htslib/htslib/ksort.h
-htslib/htslib/kstring.h
-htslib/htslib/sam.h
-htslib/htslib/synced_bcf_reader.h
-htslib/htslib/tbx.h
-htslib/htslib/vcf.h
-htslib/htslib/vcf_sweep.h
-htslib/htslib/vcfutils.h
-pysam/Pileup.py
-pysam/TabProxies.c
-pysam/TabProxies.pxd
-pysam/TabProxies.pyx
-pysam/__init__.py
-pysam/calignmentfile.c
-pysam/calignmentfile.pxd
-pysam/calignmentfile.pyx
-pysam/cfaidx.c
-pysam/cfaidx.pxd
-pysam/cfaidx.pyx
-pysam/chtslib.c
-pysam/chtslib.pxd
-pysam/chtslib.pyx
-pysam/csamfile.c
-pysam/csamfile.pxd
-pysam/csamfile.pyx
-pysam/csamtools.c
-pysam/csamtools.pxd
-pysam/csamtools.pyx
-pysam/ctabix.c
-pysam/ctabix.pxd
-pysam/ctabix.pyx
-pysam/cvcf.c
-pysam/cvcf.pxd
-pysam/cvcf.pyx
-pysam/htslib_util.c
-pysam/htslib_util.h
-pysam/namedtuple.py
-pysam/pysam_stream.h
-pysam/pysam_util.c
-pysam/pysam_util.h
-pysam/samfile_util.c
-pysam/samfile_util.h
-pysam/tabix_util.c
-pysam/tabix_util.h
-pysam/version.py
-pysam.egg-info/PKG-INFO
-pysam.egg-info/SOURCES.txt
-pysam.egg-info/dependency_links.txt
-pysam.egg-info/not-zip-safe
-pysam.egg-info/top_level.txt
-pysam/include/__init__.py
-samtools/bam.c.pysam.c
-samtools/bam.h
-samtools/bam2bcf.c.pysam.c
-samtools/bam2bcf.h
-samtools/bam2bcf_indel.c.pysam.c
-samtools/bam2depth.c.pysam.c
-samtools/bam_aux.c.pysam.c
-samtools/bam_cat.c.pysam.c
-samtools/bam_color.c.pysam.c
-samtools/bam_endian.h
-samtools/bam_flags.c.pysam.c
-samtools/bam_import.c.pysam.c
-samtools/bam_index.c.pysam.c
-samtools/bam_lpileup.c.pysam.c
-samtools/bam_lpileup.h
-samtools/bam_mate.c.pysam.c
-samtools/bam_md.c.pysam.c
-samtools/bam_plbuf.c.pysam.c
-samtools/bam_plbuf.h
-samtools/bam_plcmd.c.pysam.c
-samtools/bam_reheader.c.pysam.c
-samtools/bam_rmdup.c.pysam.c
-samtools/bam_rmdupse.c.pysam.c
-samtools/bam_sort.c.pysam.c
-samtools/bam_split.c.pysam.c
-samtools/bam_stat.c.pysam.c
-samtools/bam_tview.c.pysam.c
-samtools/bam_tview.h
-samtools/bam_tview_curses.c.pysam.c
-samtools/bam_tview_html.c.pysam.c
-samtools/bamshuf.c.pysam.c
-samtools/bedcov.c.pysam.c
-samtools/bedidx.c.pysam.c
-samtools/cut_target.c.pysam.c
-samtools/errmod.c.pysam.c
-samtools/errmod.h
-samtools/faidx.c.pysam.c
-samtools/kaln.c.pysam.c
-samtools/kaln.h
-samtools/kprobaln.c
-samtools/kprobaln.c.pysam.c
-samtools/kprobaln.h
-samtools/padding.c.pysam.c
-samtools/phase.c.pysam.c
-samtools/pysam.h
-samtools/sam.c.pysam.c
-samtools/sam.h
-samtools/sam_header.c.pysam.c
-samtools/sam_header.h
-samtools/sam_view.c.pysam.c
-samtools/sample.c.pysam.c
-samtools/sample.h
-samtools/samtools.h
-samtools/stats.c.pysam.c
-samtools/stats_isize.c.pysam.c
-samtools/stats_isize.h
-samtools/version.h
-samtools/misc/ace2sam.c.pysam.c
-samtools/misc/md5.c.pysam.c
-samtools/misc/md5.h
-samtools/test/test.c.pysam.c
-samtools/test/test.h
-samtools/win32/xcurses.h
-samtools/win32/zconf.h
-samtools/win32/zlib.h
-tests/00README.txt
\ No newline at end of file
diff --git a/pysam.egg-info/dependency_links.txt b/pysam.egg-info/dependency_links.txt
deleted file mode 100644
index 8b13789..0000000
--- a/pysam.egg-info/dependency_links.txt
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/pysam.egg-info/not-zip-safe b/pysam.egg-info/not-zip-safe
deleted file mode 100644
index 8b13789..0000000
--- a/pysam.egg-info/not-zip-safe
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/pysam.egg-info/top_level.txt b/pysam.egg-info/top_level.txt
deleted file mode 100644
index 23f03da..0000000
--- a/pysam.egg-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-pysam
diff --git a/pysam/TabProxies.c b/pysam/TabProxies.c
deleted file mode 100644
index 06ef6b0..0000000
--- a/pysam/TabProxies.c
+++ /dev/null
@@ -1,14076 +0,0 @@
-/* Generated by Cython 0.20.1 on Fri Nov 21 19:49:04 2014 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#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
-#define CYTHON_ABI "0_20_1"
-#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 Py_OptimizeFlag 0
-#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 CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #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"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-  #define __Pyx_DefaultClassType PyClass_Type
-#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)
-  #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #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 < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
-  #define Py_TPFLAGS_IS_ABSTRACT 0
-#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
-  #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
-  #define CYTHON_PEP393_ENABLED 1
-  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
-                                              0 : _PyUnicode_Ready((PyObject *)(op)))
-  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
-  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
-  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
-  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
-  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
-#else
-  #define CYTHON_PEP393_ENABLED 0
-  #define __Pyx_PyUnicode_READY(op)       (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]))
-  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
-  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
-  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
-#else
-  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
-      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
-#else
-  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
-#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_MAJOR_VERSION >= 3
-  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
-  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#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
-  #define PyNumber_Int                 PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyBoolObject                 PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x030200A4
-  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
-#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
-#ifndef CYTHON_RESTRICT
-  #if defined(__GNUC__)
-    #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER) && _MSC_VER >= 1400
-    #define CYTHON_RESTRICT __restrict
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_RESTRICT restrict
-  #else
-    #define CYTHON_RESTRICT
-  #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
-  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
-   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
-   a quiet NaN. */
-  float value;
-  memset(&value, 0xFF, sizeof(value));
-  return value;
-}
-#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__pysam__TabProxies
-#define __PYX_HAVE_API__pysam__TabProxies
-#include "stdlib.h"
-#include "string.h"
-#include "stdint.h"
-#include "stdio.h"
-#include "pythread.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#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 Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
-    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
-    (sizeof(type) > sizeof(Py_ssize_t) &&               \
-          likely(v < (type)PY_SSIZE_T_MAX ||            \
-                 v == (type)PY_SSIZE_T_MAX)  &&         \
-          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
-                                v == (type)PY_SSIZE_T_MIN)))  ||  \
-    (sizeof(type) == sizeof(Py_ssize_t) &&              \
-          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
-                               v == (type)PY_SSIZE_T_MAX)))  )
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString        PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
-    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
-    const Py_UNICODE *u_end = u;
-    while (*u_end++) ;
-    return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
-#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);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    PyObject* ascii_chars_u = NULL;
-    PyObject* ascii_chars_b = NULL;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
-        __Pyx_sys_getdefaultencoding_not_ascii = 0;
-    } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
-        char ascii_chars[128];
-        int c;
-        for (c = 0; c < 128; c++) {
-            ascii_chars[c] = c;
-        }
-        __Pyx_sys_getdefaultencoding_not_ascii = 1;
-        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
-        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
-            PyErr_Format(
-                PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
-                default_encoding_c);
-            goto bad;
-        }
-    }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    char* default_encoding_c;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
-    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
-    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
-    Py_DECREF(default_encoding);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    return -1;
-}
-#endif
-#endif
-
-
-#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_d;
-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[] = {
-  "TabProxies.pyx",
-  "type.pxd",
-  "bool.pxd",
-  "complex.pxd",
-};
-
-/*--- Type declarations ---*/
-struct __pyx_obj_5pysam_10TabProxies_TupleProxy;
-struct __pyx_obj_5pysam_10TabProxies_GTFProxy;
-struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy;
-struct __pyx_obj_5pysam_10TabProxies_BedProxy;
-struct __pyx_obj_5pysam_10TabProxies_VCFProxy;
-struct __pyx_opt_args_5pysam_10TabProxies__force_bytes;
-struct __pyx_opt_args_5pysam_10TabProxies__charptr_to_str;
-struct __pyx_opt_args_5pysam_10TabProxies__force_str;
-
-/* "pysam/TabProxies.pyx":26
- *     _FILENAME_ENCODING = 'ascii'
- * 
- * cdef bytes _force_bytes(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-struct __pyx_opt_args_5pysam_10TabProxies__force_bytes {
-  int __pyx_n;
-  PyObject *encoding;
-};
-
-/* "pysam/TabProxies.pyx":43
- *     return _force_bytes(s)
- * 
- * cdef _charptr_to_str(char* s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-struct __pyx_opt_args_5pysam_10TabProxies__charptr_to_str {
-  int __pyx_n;
-  PyObject *encoding;
-};
-
-/* "pysam/TabProxies.pyx":49
- *         return s.decode(encoding)
- * 
- * cdef inline _force_str(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python "
- *     "(bytes in Py2, unicode in Py3)"""
- */
-struct __pyx_opt_args_5pysam_10TabProxies__force_str {
-  int __pyx_n;
-  PyObject *encoding;
-};
-
-/* "pysam/TabProxies.pxd":41
- *   ctypedef int uint64_t
- * 
- * cdef class TupleProxy:             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_TupleProxy {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *__pyx_vtab;
-  char *data;
-  char **fields;
-  int nfields;
-  int index;
-  int nbytes;
-  int offset;
-  int is_modified;
-  PyObject *encoding;
-};
-
-
-/* "pysam/TabProxies.pxd":63
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class GTFProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_GTFProxy {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy __pyx_base;
-  char *_attributes;
-  int hasOwnAttributes;
-};
-
-
-/* "pysam/TabProxies.pxd":73
- *     cdef char * getAttributes( self )
- * 
- * cdef class NamedTupleProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy __pyx_base;
-};
-
-
-/* "pysam/TabProxies.pxd":76
- *     pass
- * 
- * cdef class BedProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_BedProxy {
-  struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-  char *contig;
-  uint32_t start;
-  uint32_t end;
-  int bedfields;
-};
-
-
-/* "pysam/TabProxies.pxd":88
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class VCFProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_VCFProxy {
-  struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-  char *contig;
-  uint32_t pos;
-};
-
-
-
-/* "pysam/TabProxies.pyx":81
- *      return not (buffer <= p < buffer + nbytes)
- * 
- * cdef class TupleProxy:             # <<<<<<<<<<<<<<
- *     '''Proxy class for access to parsed row as a tuple.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy {
-  int (*getMaxFields)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *);
-  int (*getMinFields)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *);
-  PyObject *(*take)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*present)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*copy)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*update)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *__pyx_vtabptr_5pysam_10TabProxies_TupleProxy;
-
-
-/* "pysam/TabProxies.pyx":368
- * 
- * 
- * cdef class GTFProxy(TupleProxy):             # <<<<<<<<<<<<<<
- *     '''Proxy class for access to GTF fields.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy __pyx_base;
-  char *(*getAttributes)(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *);
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy *__pyx_vtabptr_5pysam_10TabProxies_GTFProxy;
-
-
-/* "pysam/TabProxies.pyx":630
- * 
- * 
- * cdef class NamedTupleProxy(TupleProxy):             # <<<<<<<<<<<<<<
- * 
- *     map_key2field = {}
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy *__pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy;
-
-
-/* "pysam/TabProxies.pyx":653
- * 
- * 
- * cdef class BedProxy(NamedTupleProxy):             # <<<<<<<<<<<<<<
- *     '''Proxy class for access to Bed fields.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy *__pyx_vtabptr_5pysam_10TabProxies_BedProxy;
-
-
-/* "pysam/TabProxies.pyx":724
- *         TupleProxy._setindex(self, idx, str(value) )
- * 
- * cdef class VCFProxy(NamedTupleProxy):             # <<<<<<<<<<<<<<
- *     '''Proxy class for access to VCF fields.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy *__pyx_vtabptr_5pysam_10TabProxies_VCFProxy;
-#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_XDECREF_SET(r, v) do {                            \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_XDECREF(tmp);                              \
-    } while (0)
-#define __Pyx_DECREF_SET(r, v) do {                             \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_DECREF(tmp);                               \
-    } while (0)
-#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)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_getattro))
-        return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_getattr))
-        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
-    return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-#include <string.h>
-
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
-         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
-         const char* encoding, const char* errors,
-         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
-#else
-#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
-#endif
-
-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 void __Pyx_WriteUnraisable(const char *name, int clineno,
-                                  int lineno, const char *filename,
-                                  int full_traceback); /*proto*/
-
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
-    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
-    PyObject *method, *result = NULL;
-    if (unlikely(!args)) return NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto bad;
-    result = __Pyx_PyObject_Call(method, args, NULL);
-    Py_DECREF(method);
-bad:
-    Py_DECREF(args);
-    return result;
-}
-#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
-#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
-#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
-#define __Pyx_PyObject_CallMethod0(obj, name) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))
-
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/
-
-#if PY_MAJOR_VERSION < 3
-#define __Pyx_PyString_Join __Pyx_PyBytes_Join
-#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
-#else
-#define __Pyx_PyString_Join PyUnicode_Join
-#define __Pyx_PyBaseString_Join PyUnicode_Join
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
-    #if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyBytes_Join _PyString_Join
-    #else
-    #define __Pyx_PyBytes_Join _PyBytes_Join
-    #endif
-#else
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/
-#endif
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
-    int result = PySequence_Contains(seq, item);
-    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
-#else
-#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
-#endif
-
-#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
-    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
-               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck);
-
-static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
-#if CYTHON_COMPILING_IN_PYPY
-#define __Pyx_PyObject_AsDouble(obj) \
-(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
- likely(PyInt_CheckExact(obj)) ? \
- PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
-#else
-#define __Pyx_PyObject_AsDouble(obj) \
-((likely(PyFloat_CheckExact(obj))) ? \
- PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
-#endif
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
-        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
-        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
-        int has_cstart, int has_cstop, int wraparound);
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len)) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
-#endif
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
-#else
-#define __Pyx_PyList_GetSlice(seq, start, stop)   PySequence_GetSlice(seq, start, stop)
-#define __Pyx_PyTuple_GetSlice(seq, start, stop)  PySequence_GetSlice(seq, start, stop)
-#endif
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
-static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_setattro))
-        return tp->tp_setattro(obj, attr_name, value);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_setattr))
-        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
-#endif
-    return PyObject_SetAttr(obj, attr_name, value);
-}
-#else
-#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
-#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
-#endif
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
-
-static int __Pyx_check_binary_version(void);
-
-#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 PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*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 'cpython.version' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'cpython.exc' */
-
-/* Module declarations from 'cpython.module' */
-
-/* Module declarations from 'cpython.mem' */
-
-/* Module declarations from 'cpython.tuple' */
-
-/* Module declarations from 'cpython.list' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from 'cpython.sequence' */
-
-/* Module declarations from 'cpython.mapping' */
-
-/* Module declarations from 'cpython.iterator' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'cpython.number' */
-
-/* Module declarations from 'cpython.int' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.bool' */
-static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
-
-/* Module declarations from 'cpython.long' */
-
-/* Module declarations from 'cpython.float' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.complex' */
-static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
-
-/* Module declarations from 'cpython.string' */
-
-/* Module declarations from 'cpython.unicode' */
-
-/* Module declarations from 'cpython.dict' */
-
-/* Module declarations from 'cpython.instance' */
-
-/* Module declarations from 'cpython.function' */
-
-/* Module declarations from 'cpython.method' */
-
-/* Module declarations from 'cpython.weakref' */
-
-/* Module declarations from 'cpython.getargs' */
-
-/* Module declarations from 'cpython.pythread' */
-
-/* Module declarations from 'cpython.pystate' */
-
-/* Module declarations from 'cpython.cobject' */
-
-/* Module declarations from 'cpython.oldbuffer' */
-
-/* Module declarations from 'cpython.set' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.bytes' */
-
-/* Module declarations from 'cpython.pycapsule' */
-
-/* Module declarations from 'cpython' */
-
-/* Module declarations from 'pysam.TabProxies' */
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_TupleProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_GTFProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_BedProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_VCFProxy = 0;
-static PyObject *__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING = 0;
-static PyObject *__pyx_f_5pysam_10TabProxies__force_bytes(PyObject *, struct __pyx_opt_args_5pysam_10TabProxies__force_bytes *__pyx_optional_args); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_10TabProxies__force_str(PyObject *, struct __pyx_opt_args_5pysam_10TabProxies__force_str *__pyx_optional_args); /*proto*/
-static char *__pyx_f_5pysam_10TabProxies_StrOrEmpty(char *); /*proto*/
-static int __pyx_f_5pysam_10TabProxies_isNew(char *, char *, size_t); /*proto*/
-#define __Pyx_MODULE_NAME "pysam.TabProxies"
-int __pyx_module_is_main_pysam__TabProxies = 0;
-
-/* Implementation of 'pysam.TabProxies' */
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_IndexError;
-static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_builtin_StopIteration;
-static PyObject *__pyx_builtin_xrange;
-static PyObject *__pyx_builtin_AttributeError;
-static PyObject *__pyx_builtin_KeyError;
-static int __pyx_pf_5pysam_10TabProxies_10TupleProxy___cinit__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
-static void __pyx_pf_5pysam_10TabProxies_10TupleProxy_2__dealloc__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_4_getindex(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, int __pyx_v_index); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_6__getitem__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_8_setindex(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_10TupleProxy_10__setitem__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
-static Py_ssize_t __pyx_pf_5pysam_10TabProxies_10TupleProxy_12__len__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_14__iter__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_16__next__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_18__str__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_toDot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_2quote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy___cinit__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_10TabProxies_8GTFProxy_2__dealloc__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_6contig___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_6contig_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_6source___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_6source_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_7feature___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_7feature_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_5start___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_5start_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_3end___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_3end_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_5score___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_5score_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_6strand___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_6strand_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_5frame___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_5frame_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_10attributes___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_10attributes_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_4asDict(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_6fromDict(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_8__str__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_10invert(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, int __pyx_v_lcontig); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_12keys(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_14__getitem__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_16__getattr__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_18setAttribute(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_15NamedTupleProxy___setattr__(struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_15NamedTupleProxy_2__getattr__(struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8BedProxy___str__(struct __pyx_obj_5pysam_10TabProxies_BedProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8BedProxy_2__setattr__(struct __pyx_obj_5pysam_10TabProxies_BedProxy *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8VCFProxy___cinit__(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_self); /* proto */
-static Py_ssize_t __pyx_pf_5pysam_10TabProxies_8VCFProxy_2__len__(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_10TabProxies_8VCFProxy_3pos___get__(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_10TabProxies_8VCFProxy_4__setattr__(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_TupleProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_GTFProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_NamedTupleProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_BedProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_VCFProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_[] = "";
-static char __pyx_k_s[] = "\"%s\"";
-static char __pyx_k_v[] = "v";
-static char __pyx_k__8[] = "\t";
-static char __pyx_k_id[] = "id";
-static char __pyx_k__10[] = ".";
-static char __pyx_k__20[] = ";";
-static char __pyx_k__23[] = " ";
-static char __pyx_k__24[] = "\"";
-static char __pyx_k__26[] = "; ";
-static char __pyx_k__28[] = "-";
-static char __pyx_k_alt[] = "alt";
-static char __pyx_k_end[] = "end";
-static char __pyx_k_pos[] = "pos";
-static char __pyx_k_ref[] = "ref";
-static char __pyx_k_s_s[] = "%s \"%s\"";
-static char __pyx_k_str[] = "__str__";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_info[] = "info";
-static char __pyx_k_join[] = "join";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_name[] = "name";
-static char __pyx_k_qual[] = "qual";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_ascii[] = "ascii";
-static char __pyx_k_frame[] = "frame";
-static char __pyx_k_index[] = "index";
-static char __pyx_k_items[] = "items";
-static char __pyx_k_quote[] = "quote";
-static char __pyx_k_range[] = "range";
-static char __pyx_k_s_s_2[] = "%s %s";
-static char __pyx_k_score[] = "score";
-static char __pyx_k_split[] = "split";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_strip[] = "strip";
-static char __pyx_k_toDot[] = "toDot";
-static char __pyx_k_types[] = "types";
-static char __pyx_k_value[] = "value";
-static char __pyx_k_append[] = "append";
-static char __pyx_k_asDict[] = "asDict";
-static char __pyx_k_contig[] = "contig";
-static char __pyx_k_decode[] = "decode";
-static char __pyx_k_encode[] = "encode";
-static char __pyx_k_filter[] = "filter";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_source[] = "source";
-static char __pyx_k_strand[] = "strand";
-static char __pyx_k_string[] = "string";
-static char __pyx_k_xrange[] = "xrange";
-static char __pyx_k_feature[] = "feature";
-static char __pyx_k_getattr[] = "__getattr__";
-static char __pyx_k_indices[] = "indices";
-static char __pyx_k_itemRGB[] = "itemRGB";
-static char __pyx_k_setitem[] = "__setitem__";
-static char __pyx_k_KeyError[] = "KeyError";
-static char __pyx_k_encoding[] = "encoding";
-static char __pyx_k_fromDict[] = "fromDict";
-static char __pyx_k_getindex[] = "_getindex";
-static char __pyx_k_maxsplit[] = "maxsplit";
-static char __pyx_k_setindex[] = "_setindex";
-static char __pyx_k_thickEnd[] = "thickEnd";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_attributes[] = "attributes";
-static char __pyx_k_blockCount[] = "blockCount";
-static char __pyx_k_blockSizes[] = "blockSizes";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_thickStart[] = "thickStart";
-static char __pyx_k_StringTypes[] = "StringTypes";
-static char __pyx_k_blockStarts[] = "blockStarts";
-static char __pyx_k_feature_name[] = "feature name.";
-static char __pyx_k_StopIteration[] = "StopIteration";
-static char __pyx_k_feature_frame[] = "feature frame.";
-static char __pyx_k_feature_score[] = "feature score.";
-static char __pyx_k_map_key2field[] = "map_key2field";
-static char __pyx_k_out_of_memory[] = "out of memory";
-static char __pyx_k_AttributeError[] = "AttributeError";
-static char __pyx_k_feature_source[] = "feature source.";
-static char __pyx_k_feature_strand[] = "feature strand.";
-static char __pyx_k_field_s_not_set[] = "field %s not set";
-static char __pyx_k_pysam_TabProxies[] = "pysam.TabProxies";
-static char __pyx_k_contig_of_feature[] = "contig of feature.";
-static char __pyx_k_getdefaultencoding[] = "getdefaultencoding";
-static char __pyx_k_incomplete_line_at_s[] = "incomplete line at %s";
-static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding";
-static char __pyx_k_list_index_out_of_range[] = "list index out of range";
-static char __pyx_k_malformatted_entry_at_s[] = "malformatted entry at %s";
-static char __pyx_k_GTFProxy_has_no_attribute_s[] = "'GTFProxy' has no attribute '%s'";
-static char __pyx_k_list_index_out_of_range_i_i[] = "list index out of range %i >= %i";
-static char __pyx_k_feature_attributes_as_a_string[] = "feature attributes (as a string).";
-static char __pyx_k_home_andreas_devel_pysam_pysam[] = "/home/andreas/devel/pysam/pysam/TabProxies.pyx";
-static char __pyx_k_Argument_must_be_string_bytes_or[] = "Argument must be string, bytes or unicode.";
-static char __pyx_k_bed_format_requires_at_least_thr[] = "bed format requires at least three columns";
-static char __pyx_k_feature_end_in_0_based_open_clos[] = "feature end (in 0-based open/closed coordinates).";
-static char __pyx_k_feature_start_in_0_based_open_cl[] = "feature start (in 0-based open/closed coordinates).";
-static char __pyx_k_length_of_buffer_i_number_of_byt[] = "length of buffer (%i) != number of bytes (%i)";
-static char __pyx_k_out_of_memory_in_TupleProxy_copy[] = "out of memory in TupleProxy.copy()";
-static char __pyx_k_out_of_memory_in_TupleProxy_upda[] = "out of memory in TupleProxy.update()";
-static char __pyx_k_parsing_error_fewer_that_i_field[] = "parsing error: fewer that %i fields in line: %s";
-static char __pyx_k_parsing_error_more_than_i_fields[] = "parsing error: more than %i fields in line: %s";
-static PyObject *__pyx_kp_s_;
-static PyObject *__pyx_kp_u_Argument_must_be_string_bytes_or;
-static PyObject *__pyx_n_s_AttributeError;
-static PyObject *__pyx_kp_s_GTFProxy_has_no_attribute_s;
-static PyObject *__pyx_n_s_IndexError;
-static PyObject *__pyx_n_s_KeyError;
-static PyObject *__pyx_n_s_StopIteration;
-static PyObject *__pyx_n_s_StringTypes;
-static PyObject *__pyx_n_s_TypeError;
-static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_kp_s__10;
-static PyObject *__pyx_kp_s__20;
-static PyObject *__pyx_kp_s__23;
-static PyObject *__pyx_kp_s__24;
-static PyObject *__pyx_kp_s__26;
-static PyObject *__pyx_kp_s__28;
-static PyObject *__pyx_kp_s__8;
-static PyObject *__pyx_n_s_alt;
-static PyObject *__pyx_n_s_append;
-static PyObject *__pyx_n_s_asDict;
-static PyObject *__pyx_n_s_ascii;
-static PyObject *__pyx_n_s_attributes;
-static PyObject *__pyx_kp_s_bed_format_requires_at_least_thr;
-static PyObject *__pyx_n_s_blockCount;
-static PyObject *__pyx_n_s_blockSizes;
-static PyObject *__pyx_n_s_blockStarts;
-static PyObject *__pyx_n_s_contig;
-static PyObject *__pyx_n_s_decode;
-static PyObject *__pyx_n_s_encode;
-static PyObject *__pyx_n_s_encoding;
-static PyObject *__pyx_n_s_end;
-static PyObject *__pyx_n_s_feature;
-static PyObject *__pyx_kp_s_field_s_not_set;
-static PyObject *__pyx_n_s_filter;
-static PyObject *__pyx_n_s_format;
-static PyObject *__pyx_n_s_frame;
-static PyObject *__pyx_n_s_fromDict;
-static PyObject *__pyx_n_s_getattr;
-static PyObject *__pyx_n_s_getdefaultencoding;
-static PyObject *__pyx_n_s_getfilesystemencoding;
-static PyObject *__pyx_n_s_getindex;
-static PyObject *__pyx_kp_s_home_andreas_devel_pysam_pysam;
-static PyObject *__pyx_n_s_id;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_kp_s_incomplete_line_at_s;
-static PyObject *__pyx_n_s_index;
-static PyObject *__pyx_n_s_indices;
-static PyObject *__pyx_n_s_info;
-static PyObject *__pyx_n_s_itemRGB;
-static PyObject *__pyx_n_s_items;
-static PyObject *__pyx_n_s_join;
-static PyObject *__pyx_kp_s_length_of_buffer_i_number_of_byt;
-static PyObject *__pyx_kp_s_list_index_out_of_range;
-static PyObject *__pyx_kp_s_list_index_out_of_range_i_i;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_kp_s_malformatted_entry_at_s;
-static PyObject *__pyx_n_s_map_key2field;
-static PyObject *__pyx_n_s_maxsplit;
-static PyObject *__pyx_n_s_name;
-static PyObject *__pyx_kp_s_out_of_memory;
-static PyObject *__pyx_kp_s_out_of_memory_in_TupleProxy_copy;
-static PyObject *__pyx_kp_s_out_of_memory_in_TupleProxy_upda;
-static PyObject *__pyx_kp_s_parsing_error_fewer_that_i_field;
-static PyObject *__pyx_kp_s_parsing_error_more_than_i_fields;
-static PyObject *__pyx_n_s_pos;
-static PyObject *__pyx_n_s_pysam_TabProxies;
-static PyObject *__pyx_n_s_pyx_vtable;
-static PyObject *__pyx_n_s_qual;
-static PyObject *__pyx_n_s_quote;
-static PyObject *__pyx_n_s_range;
-static PyObject *__pyx_n_s_ref;
-static PyObject *__pyx_kp_s_s;
-static PyObject *__pyx_kp_s_s_s;
-static PyObject *__pyx_kp_s_s_s_2;
-static PyObject *__pyx_n_s_score;
-static PyObject *__pyx_n_s_setindex;
-static PyObject *__pyx_n_s_setitem;
-static PyObject *__pyx_n_s_source;
-static PyObject *__pyx_n_s_split;
-static PyObject *__pyx_n_s_start;
-static PyObject *__pyx_n_s_str;
-static PyObject *__pyx_n_s_strand;
-static PyObject *__pyx_n_s_string;
-static PyObject *__pyx_n_s_strip;
-static PyObject *__pyx_n_s_sys;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_n_s_thickEnd;
-static PyObject *__pyx_n_s_thickStart;
-static PyObject *__pyx_n_s_toDot;
-static PyObject *__pyx_n_s_types;
-static PyObject *__pyx_n_s_v;
-static PyObject *__pyx_n_s_value;
-static PyObject *__pyx_n_s_xrange;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_2;
-static PyObject *__pyx_int_3;
-static PyObject *__pyx_int_4;
-static PyObject *__pyx_int_5;
-static PyObject *__pyx_int_6;
-static PyObject *__pyx_int_7;
-static PyObject *__pyx_int_8;
-static PyObject *__pyx_int_9;
-static PyObject *__pyx_int_10;
-static PyObject *__pyx_int_11;
-static PyObject *__pyx_int_neg_1;
-static PyObject *__pyx_tuple__2;
-static PyObject *__pyx_tuple__3;
-static PyObject *__pyx_tuple__4;
-static PyObject *__pyx_tuple__5;
-static PyObject *__pyx_tuple__6;
-static PyObject *__pyx_tuple__7;
-static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__22;
-static PyObject *__pyx_slice__25;
-static PyObject *__pyx_tuple__11;
-static PyObject *__pyx_tuple__12;
-static PyObject *__pyx_tuple__13;
-static PyObject *__pyx_tuple__14;
-static PyObject *__pyx_tuple__15;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__17;
-static PyObject *__pyx_tuple__18;
-static PyObject *__pyx_tuple__19;
-static PyObject *__pyx_tuple__21;
-static PyObject *__pyx_tuple__27;
-static PyObject *__pyx_tuple__29;
-static PyObject *__pyx_tuple__30;
-static PyObject *__pyx_tuple__31;
-static PyObject *__pyx_tuple__32;
-static PyObject *__pyx_tuple__34;
-static PyObject *__pyx_codeobj__33;
-static PyObject *__pyx_codeobj__35;
-
-/* "pysam/TabProxies.pyx":12
- * 
- * 
- * cdef from_string_and_size(char* s, size_t length):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies_from_string_and_size(char *__pyx_v_s, size_t __pyx_v_length) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("from_string_and_size", 0);
-
-  /* "pysam/TabProxies.pyx":13
- * 
- * cdef from_string_and_size(char* s, size_t length):
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s[:length]
- *     else:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":14
- * cdef from_string_and_size(char* s, size_t length):
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]             # <<<<<<<<<<<<<<
- *     else:
- *         return s[:length].decode("ascii")
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":16
- *         return s[:length]
- *     else:
- *         return s[:length].decode("ascii")             # <<<<<<<<<<<<<<
- * 
- * # filename encoding (copied from lxml.etree.pyx)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_s, 0, __pyx_v_length, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":12
- * 
- * 
- * cdef from_string_and_size(char* s, size_t length):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.from_string_and_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":26
- *     _FILENAME_ENCODING = 'ascii'
- * 
- * cdef bytes _force_bytes(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies__force_bytes(PyObject *__pyx_v_s, struct __pyx_opt_args_5pysam_10TabProxies__force_bytes *__pyx_optional_args) {
-  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_n_s_ascii);
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_force_bytes", 0);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_encoding = __pyx_optional_args->encoding;
-    }
-  }
-
-  /* "pysam/TabProxies.pyx":29
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif s is None:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":30
- *     """
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif s is None:
- *         return None
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":31
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":32
- *         return s
- *     elif s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":33
- *     elif s is None:
- *         return None
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyUnicode_Check(s):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":34
- *         return None
- *     elif PyBytes_Check(s):
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(s):
- *         return s.encode(encoding)
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":35
- *     elif PyBytes_Check(s):
- *         return s
- *     elif PyUnicode_Check(s):             # <<<<<<<<<<<<<<
- *         return s.encode(encoding)
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":36
- *         return s
- *     elif PyUnicode_Check(s):
- *         return s.encode(encoding)             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_encoding);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_encoding);
-    __Pyx_GIVEREF(__pyx_v_encoding);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_5);
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":38
- *         return s.encode(encoding)
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."             # <<<<<<<<<<<<<<
- * 
- * cdef inline bytes _force_cmdline_bytes(object s):
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_bytes_or, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":26
- *     _FILENAME_ENCODING = 'ascii'
- * 
- * cdef bytes _force_bytes(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.TabProxies._force_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":40
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline bytes _force_cmdline_bytes(object s):             # <<<<<<<<<<<<<<
- *     return _force_bytes(s)
- * 
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_10TabProxies__force_cmdline_bytes(PyObject *__pyx_v_s) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_force_cmdline_bytes", 0);
-
-  /* "pysam/TabProxies.pyx":41
- * 
- * cdef inline bytes _force_cmdline_bytes(object s):
- *     return _force_bytes(s)             # <<<<<<<<<<<<<<
- * 
- * cdef _charptr_to_str(char* s, encoding="ascii"):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_5pysam_10TabProxies__force_bytes(__pyx_v_s, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":40
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline bytes _force_cmdline_bytes(object s):             # <<<<<<<<<<<<<<
- *     return _force_bytes(s)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.TabProxies._force_cmdline_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":43
- *     return _force_bytes(s)
- * 
- * cdef _charptr_to_str(char* s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies__charptr_to_str(char *__pyx_v_s, struct __pyx_opt_args_5pysam_10TabProxies__charptr_to_str *__pyx_optional_args) {
-  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_n_s_ascii);
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_charptr_to_str", 0);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_encoding = __pyx_optional_args->encoding;
-    }
-  }
-
-  /* "pysam/TabProxies.pyx":44
- * 
- * cdef _charptr_to_str(char* s, encoding="ascii"):
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     else:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":45
- * cdef _charptr_to_str(char* s, encoding="ascii"):
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     else:
- *         return s.decode(encoding)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":47
- *         return s
- *     else:
- *         return s.decode(encoding)             # <<<<<<<<<<<<<<
- * 
- * cdef inline _force_str(object s, encoding="ascii"):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_encoding);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_encoding);
-    __Pyx_GIVEREF(__pyx_v_encoding);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":43
- *     return _force_bytes(s)
- * 
- * cdef _charptr_to_str(char* s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.TabProxies._charptr_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":49
- *         return s.decode(encoding)
- * 
- * cdef inline _force_str(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python "
- *     "(bytes in Py2, unicode in Py3)"""
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_10TabProxies__force_str(PyObject *__pyx_v_s, struct __pyx_opt_args_5pysam_10TabProxies__force_str *__pyx_optional_args) {
-  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_n_s_ascii);
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_force_str", 0);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_encoding = __pyx_optional_args->encoding;
-    }
-  }
-
-  /* "pysam/TabProxies.pyx":52
- *     """Return s converted to str type of current Python "
- *     "(bytes in Py2, unicode in Py3)"""
- *     if s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     if PY_MAJOR_VERSION < 3:
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":53
- *     "(bytes in Py2, unicode in Py3)"""
- *     if s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":54
- *     if s is None:
- *         return None
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_2 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":55
- *         return None
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s.decode(encoding)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = __pyx_v_s;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":56
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s.decode(encoding)
- *     else:
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":57
- *         return s
- *     elif PyBytes_Check(s):
- *         return s.decode(encoding)             # <<<<<<<<<<<<<<
- *     else:
- *         # assume unicode
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_encoding);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_encoding);
-    __Pyx_GIVEREF(__pyx_v_encoding);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_r = __pyx_t_5;
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":60
- *     else:
- *         # assume unicode
- *         return s             # <<<<<<<<<<<<<<
- * 
- * cdef char * nextItem(char * buffer):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = __pyx_v_s;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":49
- *         return s.decode(encoding)
- * 
- * cdef inline _force_str(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python "
- *     "(bytes in Py2, unicode in Py3)"""
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.TabProxies._force_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":62
- *         return s
- * 
- * cdef char * nextItem(char * buffer):             # <<<<<<<<<<<<<<
- *     cdef char * pos
- *     pos = strchr(buffer, '\t')
- */
-
-static char *__pyx_f_5pysam_10TabProxies_nextItem(char *__pyx_v_buffer) {
-  char *__pyx_v_pos;
-  char *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("nextItem", 0);
-
-  /* "pysam/TabProxies.pyx":64
- * cdef char * nextItem(char * buffer):
- *     cdef char * pos
- *     pos = strchr(buffer, '\t')             # <<<<<<<<<<<<<<
- *     if pos == NULL:
- *         raise ValueError("malformatted entry at %s" % buffer)
- */
-  __pyx_v_pos = strchr(__pyx_v_buffer, '\t');
-
-  /* "pysam/TabProxies.pyx":65
- *     cdef char * pos
- *     pos = strchr(buffer, '\t')
- *     if pos == NULL:             # <<<<<<<<<<<<<<
- *         raise ValueError("malformatted entry at %s" % buffer)
- *     pos[0] = '\0'
- */
-  __pyx_t_1 = ((__pyx_v_pos == NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":66
- *     pos = strchr(buffer, '\t')
- *     if pos == NULL:
- *         raise ValueError("malformatted entry at %s" % buffer)             # <<<<<<<<<<<<<<
- *     pos[0] = '\0'
- *     pos += 1
- */
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_malformatted_entry_at_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":67
- *     if pos == NULL:
- *         raise ValueError("malformatted entry at %s" % buffer)
- *     pos[0] = '\0'             # <<<<<<<<<<<<<<
- *     pos += 1
- *     return pos
- */
-  (__pyx_v_pos[0]) = '\x00';
-
-  /* "pysam/TabProxies.pyx":68
- *         raise ValueError("malformatted entry at %s" % buffer)
- *     pos[0] = '\0'
- *     pos += 1             # <<<<<<<<<<<<<<
- *     return pos
- * 
- */
-  __pyx_v_pos = (__pyx_v_pos + 1);
-
-  /* "pysam/TabProxies.pyx":69
- *     pos[0] = '\0'
- *     pos += 1
- *     return pos             # <<<<<<<<<<<<<<
- * 
- * cdef char *StrOrEmpty(char * buffer):
- */
-  __pyx_r = __pyx_v_pos;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":62
- *         return s
- * 
- * cdef char * nextItem(char * buffer):             # <<<<<<<<<<<<<<
- *     cdef char * pos
- *     pos = strchr(buffer, '\t')
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_WriteUnraisable("pysam.TabProxies.nextItem", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":71
- *     return pos
- * 
- * cdef char *StrOrEmpty(char * buffer):             # <<<<<<<<<<<<<<
- *      if buffer == NULL:
- *          return ""
- */
-
-static char *__pyx_f_5pysam_10TabProxies_StrOrEmpty(char *__pyx_v_buffer) {
-  char *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("StrOrEmpty", 0);
-
-  /* "pysam/TabProxies.pyx":72
- * 
- * cdef char *StrOrEmpty(char * buffer):
- *      if buffer == NULL:             # <<<<<<<<<<<<<<
- *          return ""
- *      else: return buffer
- */
-  __pyx_t_1 = ((__pyx_v_buffer == NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":73
- * cdef char *StrOrEmpty(char * buffer):
- *      if buffer == NULL:
- *          return ""             # <<<<<<<<<<<<<<
- *      else: return buffer
- * 
- */
-    __pyx_r = __pyx_k_;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":74
- *      if buffer == NULL:
- *          return ""
- *      else: return buffer             # <<<<<<<<<<<<<<
- * 
- * cdef int isNew(char * p, char * buffer, size_t nbytes):
- */
-    __pyx_r = __pyx_v_buffer;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":71
- *     return pos
- * 
- * cdef char *StrOrEmpty(char * buffer):             # <<<<<<<<<<<<<<
- *      if buffer == NULL:
- *          return ""
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":76
- *      else: return buffer
- * 
- * cdef int isNew(char * p, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *      if p == NULL:
- *          return 0
- */
-
-static int __pyx_f_5pysam_10TabProxies_isNew(char *__pyx_v_p, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("isNew", 0);
-
-  /* "pysam/TabProxies.pyx":77
- * 
- * cdef int isNew(char * p, char * buffer, size_t nbytes):
- *      if p == NULL:             # <<<<<<<<<<<<<<
- *          return 0
- *      return not (buffer <= p < buffer + nbytes)
- */
-  __pyx_t_1 = ((__pyx_v_p == NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":78
- * cdef int isNew(char * p, char * buffer, size_t nbytes):
- *      if p == NULL:
- *          return 0             # <<<<<<<<<<<<<<
- *      return not (buffer <= p < buffer + nbytes)
- * 
- */
-    __pyx_r = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":79
- *      if p == NULL:
- *          return 0
- *      return not (buffer <= p < buffer + nbytes)             # <<<<<<<<<<<<<<
- * 
- * cdef class TupleProxy:
- */
-  __pyx_t_1 = (__pyx_v_buffer <= __pyx_v_p);
-  if (__pyx_t_1) {
-    __pyx_t_1 = (__pyx_v_p < (__pyx_v_buffer + __pyx_v_nbytes));
-  }
-  __pyx_r = (!(__pyx_t_1 != 0));
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":76
- *      else: return buffer
- * 
- * cdef int isNew(char * p, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *      if p == NULL:
- *          return 0
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":92
- *     '''
- * 
- *     def __cinit__(self, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         self.data = NULL
- *         self.fields = NULL
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_10TupleProxy_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_10TupleProxy_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_encoding = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0};
-    PyObject* values[1] = {0};
-    values[0] = ((PyObject *)__pyx_n_s_ascii);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
-          if (value) { values[0] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_encoding = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy___cinit__(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self), __pyx_v_encoding);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_10TupleProxy___cinit__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, PyObject *__pyx_v_encoding) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-
-  /* "pysam/TabProxies.pyx":93
- * 
- *     def __cinit__(self, encoding="ascii"):
- *         self.data = NULL             # <<<<<<<<<<<<<<
- *         self.fields = NULL
- *         self.index = 0
- */
-  __pyx_v_self->data = NULL;
-
-  /* "pysam/TabProxies.pyx":94
- *     def __cinit__(self, encoding="ascii"):
- *         self.data = NULL
- *         self.fields = NULL             # <<<<<<<<<<<<<<
- *         self.index = 0
- *         self.nbytes = 0
- */
-  __pyx_v_self->fields = NULL;
-
-  /* "pysam/TabProxies.pyx":95
- *         self.data = NULL
- *         self.fields = NULL
- *         self.index = 0             # <<<<<<<<<<<<<<
- *         self.nbytes = 0
- *         self.is_modified = 0
- */
-  __pyx_v_self->index = 0;
-
-  /* "pysam/TabProxies.pyx":96
- *         self.fields = NULL
- *         self.index = 0
- *         self.nbytes = 0             # <<<<<<<<<<<<<<
- *         self.is_modified = 0
- *         self.nfields = 0
- */
-  __pyx_v_self->nbytes = 0;
-
-  /* "pysam/TabProxies.pyx":97
- *         self.index = 0
- *         self.nbytes = 0
- *         self.is_modified = 0             # <<<<<<<<<<<<<<
- *         self.nfields = 0
- *         # start counting at field offset
- */
-  __pyx_v_self->is_modified = 0;
-
-  /* "pysam/TabProxies.pyx":98
- *         self.nbytes = 0
- *         self.is_modified = 0
- *         self.nfields = 0             # <<<<<<<<<<<<<<
- *         # start counting at field offset
- *         self.offset = 0
- */
-  __pyx_v_self->nfields = 0;
-
-  /* "pysam/TabProxies.pyx":100
- *         self.nfields = 0
- *         # start counting at field offset
- *         self.offset = 0             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-  __pyx_v_self->offset = 0;
-
-  /* "pysam/TabProxies.pyx":101
- *         # start counting at field offset
- *         self.offset = 0
- *         self.encoding = encoding             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-  __Pyx_INCREF(__pyx_v_encoding);
-  __Pyx_GIVEREF(__pyx_v_encoding);
-  __Pyx_GOTREF(__pyx_v_self->encoding);
-  __Pyx_DECREF(__pyx_v_self->encoding);
-  __pyx_v_self->encoding = __pyx_v_encoding;
-
-  /* "pysam/TabProxies.pyx":92
- *     '''
- * 
- *     def __cinit__(self, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         self.data = NULL
- *         self.fields = NULL
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":103
- *         self.encoding = encoding
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         cdef int x
- *         if self.is_modified:
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_10TabProxies_10TupleProxy_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_10TabProxies_10TupleProxy_3__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_10TabProxies_10TupleProxy_2__dealloc__(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_10TabProxies_10TupleProxy_2__dealloc__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self) {
-  int __pyx_v_x;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-
-  /* "pysam/TabProxies.pyx":105
- *     def __dealloc__(self):
- *         cdef int x
- *         if self.is_modified:             # <<<<<<<<<<<<<<
- *             for x from 0 <= x < self.nfields:
- *                 if isNew(self.fields[x], self.data, self.nbytes):
- */
-  __pyx_t_1 = (__pyx_v_self->is_modified != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":106
- *         cdef int x
- *         if self.is_modified:
- *             for x from 0 <= x < self.nfields:             # <<<<<<<<<<<<<<
- *                 if isNew(self.fields[x], self.data, self.nbytes):
- *                     free(self.fields[x])
- */
-    __pyx_t_2 = __pyx_v_self->nfields;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-      /* "pysam/TabProxies.pyx":107
- *         if self.is_modified:
- *             for x from 0 <= x < self.nfields:
- *                 if isNew(self.fields[x], self.data, self.nbytes):             # <<<<<<<<<<<<<<
- *                     free(self.fields[x])
- *                     self.fields[x] = NULL
- */
-      __pyx_t_1 = (__pyx_f_5pysam_10TabProxies_isNew((__pyx_v_self->fields[__pyx_v_x]), __pyx_v_self->data, __pyx_v_self->nbytes) != 0);
-      if (__pyx_t_1) {
-
-        /* "pysam/TabProxies.pyx":108
- *             for x from 0 <= x < self.nfields:
- *                 if isNew(self.fields[x], self.data, self.nbytes):
- *                     free(self.fields[x])             # <<<<<<<<<<<<<<
- *                     self.fields[x] = NULL
- * 
- */
-        free((__pyx_v_self->fields[__pyx_v_x]));
-
-        /* "pysam/TabProxies.pyx":109
- *                 if isNew(self.fields[x], self.data, self.nbytes):
- *                     free(self.fields[x])
- *                     self.fields[x] = NULL             # <<<<<<<<<<<<<<
- * 
- *         if self.data != NULL:
- */
-        (__pyx_v_self->fields[__pyx_v_x]) = NULL;
-        goto __pyx_L6;
-      }
-      __pyx_L6:;
-    }
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":111
- *                     self.fields[x] = NULL
- * 
- *         if self.data != NULL:             # <<<<<<<<<<<<<<
- *             free(self.data)
- *         if self.fields != NULL:
- */
-  __pyx_t_1 = ((__pyx_v_self->data != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":112
- * 
- *         if self.data != NULL:
- *             free(self.data)             # <<<<<<<<<<<<<<
- *         if self.fields != NULL:
- *             free(self.fields)
- */
-    free(__pyx_v_self->data);
-    goto __pyx_L7;
-  }
-  __pyx_L7:;
-
-  /* "pysam/TabProxies.pyx":113
- *         if self.data != NULL:
- *             free(self.data)
- *         if self.fields != NULL:             # <<<<<<<<<<<<<<
- *             free(self.fields)
- * 
- */
-  __pyx_t_1 = ((__pyx_v_self->fields != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":114
- *             free(self.data)
- *         if self.fields != NULL:
- *             free(self.fields)             # <<<<<<<<<<<<<<
- * 
- *     cdef take(self, char * buffer, size_t nbytes):
- */
-    free(__pyx_v_self->fields);
-    goto __pyx_L8;
-  }
-  __pyx_L8:;
-
-  /* "pysam/TabProxies.pyx":103
- *         self.encoding = encoding
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         cdef int x
- *         if self.is_modified:
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/TabProxies.pyx":116
- *             free(self.fields)
- * 
- *     cdef take(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''start presenting buffer.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies_10TupleProxy_take(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("take", 0);
-
-  /* "pysam/TabProxies.pyx":121
- *         Take ownership of the pointer.
- *         '''
- *         self.data = buffer             # <<<<<<<<<<<<<<
- *         self.nbytes = nbytes
- *         self.update(buffer, nbytes)
- */
-  __pyx_v_self->data = __pyx_v_buffer;
-
-  /* "pysam/TabProxies.pyx":122
- *         '''
- *         self.data = buffer
- *         self.nbytes = nbytes             # <<<<<<<<<<<<<<
- *         self.update(buffer, nbytes)
- * 
- */
-  __pyx_v_self->nbytes = __pyx_v_nbytes;
-
-  /* "pysam/TabProxies.pyx":123
- *         self.data = buffer
- *         self.nbytes = nbytes
- *         self.update(buffer, nbytes)             # <<<<<<<<<<<<<<
- * 
- *     cdef present(self, char * buffer, size_t nbytes):
- */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *)__pyx_v_self->__pyx_vtab)->update(__pyx_v_self, __pyx_v_buffer, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":116
- *             free(self.fields)
- * 
- *     cdef take(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''start presenting buffer.
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy.take", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":125
- *         self.update(buffer, nbytes)
- * 
- *     cdef present(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''start presenting buffer.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies_10TupleProxy_present(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("present", 0);
-
-  /* "pysam/TabProxies.pyx":130
- *         Do not take ownership of the pointer.
- *         '''
- *         self.update(buffer, nbytes)             # <<<<<<<<<<<<<<
- * 
- *     cdef copy(self, char * buffer, size_t nbytes):
- */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *)__pyx_v_self->__pyx_vtab)->update(__pyx_v_self, __pyx_v_buffer, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":125
- *         self.update(buffer, nbytes)
- * 
- *     cdef present(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''start presenting buffer.
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy.present", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":132
- *         self.update(buffer, nbytes)
- * 
- *     cdef copy(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''start presenting buffer of size *nbytes*.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies_10TupleProxy_copy(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
-  int __pyx_v_s;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("copy", 0);
-
-  /* "pysam/TabProxies.pyx":141
- *         cdef int s
- *         # +1 for '\0'
- *         s = sizeof(char) *  (nbytes + 1)             # <<<<<<<<<<<<<<
- *         self.data = <char*>malloc(s)
- *         if self.data == NULL:
- */
-  __pyx_v_s = ((sizeof(char)) * (__pyx_v_nbytes + 1));
-
-  /* "pysam/TabProxies.pyx":142
- *         # +1 for '\0'
- *         s = sizeof(char) *  (nbytes + 1)
- *         self.data = <char*>malloc(s)             # <<<<<<<<<<<<<<
- *         if self.data == NULL:
- *             raise ValueError("out of memory in TupleProxy.copy()")
- */
-  __pyx_v_self->data = ((char *)malloc(__pyx_v_s));
-
-  /* "pysam/TabProxies.pyx":143
- *         s = sizeof(char) *  (nbytes + 1)
- *         self.data = <char*>malloc(s)
- *         if self.data == NULL:             # <<<<<<<<<<<<<<
- *             raise ValueError("out of memory in TupleProxy.copy()")
- *         self.nbytes = nbytes
- */
-  __pyx_t_1 = ((__pyx_v_self->data == NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":144
- *         self.data = <char*>malloc(s)
- *         if self.data == NULL:
- *             raise ValueError("out of memory in TupleProxy.copy()")             # <<<<<<<<<<<<<<
- *         self.nbytes = nbytes
- *         memcpy(<char*>self.data, buffer, s)
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":145
- *         if self.data == NULL:
- *             raise ValueError("out of memory in TupleProxy.copy()")
- *         self.nbytes = nbytes             # <<<<<<<<<<<<<<
- *         memcpy(<char*>self.data, buffer, s)
- *         self.update(self.data, nbytes)
- */
-  __pyx_v_self->nbytes = __pyx_v_nbytes;
-
-  /* "pysam/TabProxies.pyx":146
- *             raise ValueError("out of memory in TupleProxy.copy()")
- *         self.nbytes = nbytes
- *         memcpy(<char*>self.data, buffer, s)             # <<<<<<<<<<<<<<
- *         self.update(self.data, nbytes)
- * 
- */
-  memcpy(((char *)__pyx_v_self->data), __pyx_v_buffer, __pyx_v_s);
-
-  /* "pysam/TabProxies.pyx":147
- *         self.nbytes = nbytes
- *         memcpy(<char*>self.data, buffer, s)
- *         self.update(self.data, nbytes)             # <<<<<<<<<<<<<<
- * 
- *     cdef int getMinFields(self):
- */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *)__pyx_v_self->__pyx_vtab)->update(__pyx_v_self, __pyx_v_self->data, __pyx_v_nbytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":132
- *         self.update(buffer, nbytes)
- * 
- *     cdef copy(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''start presenting buffer of size *nbytes*.
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":149
- *         self.update(self.data, nbytes)
- * 
- *     cdef int getMinFields(self):             # <<<<<<<<<<<<<<
- *         '''return minimum number of fields.'''
- *         # 1 is not a valid tabix entry, but TupleProxy
- */
-
-static int __pyx_f_5pysam_10TabProxies_10TupleProxy_getMinFields(CYTHON_UNUSED struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getMinFields", 0);
-
-  /* "pysam/TabProxies.pyx":153
- *         # 1 is not a valid tabix entry, but TupleProxy
- *         # could be more generic.
- *         return 1             # <<<<<<<<<<<<<<
- * 
- *     cdef int getMaxFields(self):
- */
-  __pyx_r = 1;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":149
- *         self.update(self.data, nbytes)
- * 
- *     cdef int getMinFields(self):             # <<<<<<<<<<<<<<
- *         '''return minimum number of fields.'''
- *         # 1 is not a valid tabix entry, but TupleProxy
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":155
- *         return 1
- * 
- *     cdef int getMaxFields(self):             # <<<<<<<<<<<<<<
- *         '''return maximum number of fields. Return
- *         0 for unknown length.'''
- */
-
-static int __pyx_f_5pysam_10TabProxies_10TupleProxy_getMaxFields(CYTHON_UNUSED struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getMaxFields", 0);
-
-  /* "pysam/TabProxies.pyx":158
- *         '''return maximum number of fields. Return
- *         0 for unknown length.'''
- *         return 0             # <<<<<<<<<<<<<<
- * 
- *     cdef update(self, char * buffer, size_t nbytes):
- */
-  __pyx_r = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":155
- *         return 1
- * 
- *     cdef int getMaxFields(self):             # <<<<<<<<<<<<<<
- *         '''return maximum number of fields. Return
- *         0 for unknown length.'''
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":160
- *         return 0
- * 
- *     cdef update(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''update internal data.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies_10TupleProxy_update(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
-  char *__pyx_v_pos;
-  char *__pyx_v_old_pos;
-  int __pyx_v_field;
-  int __pyx_v_max_fields;
-  int __pyx_v_x;
-  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;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  int __pyx_t_8;
-  size_t __pyx_t_9;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("update", 0);
-
-  /* "pysam/TabProxies.pyx":181
- *         cdef int max_fields, min_fields, x
- * 
- *         assert strlen(buffer) == nbytes, \             # <<<<<<<<<<<<<<
- *             "length of buffer (%i) != number of bytes (%i)" % (
- *                 strlen(buffer), nbytes)
- */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    if (unlikely(!((strlen(__pyx_v_buffer) == __pyx_v_nbytes) != 0))) {
-
-      /* "pysam/TabProxies.pyx":183
- *         assert strlen(buffer) == nbytes, \
- *             "length of buffer (%i) != number of bytes (%i)" % (
- *                 strlen(buffer), nbytes)             # <<<<<<<<<<<<<<
- * 
- *         if buffer[nbytes] != 0:
- */
-      __pyx_t_1 = __Pyx_PyInt_FromSize_t(strlen(__pyx_v_buffer)); 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 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); 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_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_1 = 0;
-      __pyx_t_2 = 0;
-
-      /* "pysam/TabProxies.pyx":182
- * 
- *         assert strlen(buffer) == nbytes, \
- *             "length of buffer (%i) != number of bytes (%i)" % (             # <<<<<<<<<<<<<<
- *                 strlen(buffer), nbytes)
- * 
- */
-      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_length_of_buffer_i_number_of_byt, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-
-  /* "pysam/TabProxies.pyx":185
- *                 strlen(buffer), nbytes)
- * 
- *         if buffer[nbytes] != 0:             # <<<<<<<<<<<<<<
- *             raise ValueError("incomplete line at %s" % buffer)
- * 
- */
-  __pyx_t_4 = (((__pyx_v_buffer[__pyx_v_nbytes]) != 0) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/TabProxies.pyx":186
- * 
- *         if buffer[nbytes] != 0:
- *             raise ValueError("incomplete line at %s" % buffer)             # <<<<<<<<<<<<<<
- * 
- *         #################################
- */
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_incomplete_line_at_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":190
- *         #################################
- *         # remove line breaks and feeds and update number of bytes
- *         x = nbytes - 1             # <<<<<<<<<<<<<<
- *         while x > 0 and (buffer[x] == '\n' or buffer[x] == '\r'):
- *             buffer[x] = '\0'
- */
-  __pyx_v_x = (__pyx_v_nbytes - 1);
-
-  /* "pysam/TabProxies.pyx":191
- *         # remove line breaks and feeds and update number of bytes
- *         x = nbytes - 1
- *         while x > 0 and (buffer[x] == '\n' or buffer[x] == '\r'):             # <<<<<<<<<<<<<<
- *             buffer[x] = '\0'
- *             x -= 1
- */
-  while (1) {
-    __pyx_t_4 = ((__pyx_v_x > 0) != 0);
-    if (__pyx_t_4) {
-      __pyx_t_5 = (((__pyx_v_buffer[__pyx_v_x]) == '\n') != 0);
-      if (!__pyx_t_5) {
-        __pyx_t_6 = (((__pyx_v_buffer[__pyx_v_x]) == '\r') != 0);
-        __pyx_t_7 = __pyx_t_6;
-      } else {
-        __pyx_t_7 = __pyx_t_5;
-      }
-      __pyx_t_5 = __pyx_t_7;
-    } else {
-      __pyx_t_5 = __pyx_t_4;
-    }
-    if (!__pyx_t_5) break;
-
-    /* "pysam/TabProxies.pyx":192
- *         x = nbytes - 1
- *         while x > 0 and (buffer[x] == '\n' or buffer[x] == '\r'):
- *             buffer[x] = '\0'             # <<<<<<<<<<<<<<
- *             x -= 1
- *         self.nbytes = x + 1
- */
-    (__pyx_v_buffer[__pyx_v_x]) = '\x00';
-
-    /* "pysam/TabProxies.pyx":193
- *         while x > 0 and (buffer[x] == '\n' or buffer[x] == '\r'):
- *             buffer[x] = '\0'
- *             x -= 1             # <<<<<<<<<<<<<<
- *         self.nbytes = x + 1
- * 
- */
-    __pyx_v_x = (__pyx_v_x - 1);
-  }
-
-  /* "pysam/TabProxies.pyx":194
- *             buffer[x] = '\0'
- *             x -= 1
- *         self.nbytes = x + 1             # <<<<<<<<<<<<<<
- * 
- *         #################################
- */
-  __pyx_v_self->nbytes = (__pyx_v_x + 1);
-
-  /* "pysam/TabProxies.pyx":198
- *         #################################
- *         # clear data
- *         if self.fields != NULL:             # <<<<<<<<<<<<<<
- *             free(self.fields)
- * 
- */
-  __pyx_t_5 = ((__pyx_v_self->fields != NULL) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/TabProxies.pyx":199
- *         # clear data
- *         if self.fields != NULL:
- *             free(self.fields)             # <<<<<<<<<<<<<<
- * 
- *         for field from 0 <= field < self.nfields:
- */
-    free(__pyx_v_self->fields);
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
-
-  /* "pysam/TabProxies.pyx":201
- *             free(self.fields)
- * 
- *         for field from 0 <= field < self.nfields:             # <<<<<<<<<<<<<<
- *             if isNew(self.fields[field], self.data, self.nbytes):
- *                 free(self.fields[field])
- */
-  __pyx_t_8 = __pyx_v_self->nfields;
-  for (__pyx_v_field = 0; __pyx_v_field < __pyx_t_8; __pyx_v_field++) {
-
-    /* "pysam/TabProxies.pyx":202
- * 
- *         for field from 0 <= field < self.nfields:
- *             if isNew(self.fields[field], self.data, self.nbytes):             # <<<<<<<<<<<<<<
- *                 free(self.fields[field])
- * 
- */
-    __pyx_t_5 = (__pyx_f_5pysam_10TabProxies_isNew((__pyx_v_self->fields[__pyx_v_field]), __pyx_v_self->data, __pyx_v_self->nbytes) != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/TabProxies.pyx":203
- *         for field from 0 <= field < self.nfields:
- *             if isNew(self.fields[field], self.data, self.nbytes):
- *                 free(self.fields[field])             # <<<<<<<<<<<<<<
- * 
- *         self.is_modified = self.nfields = 0
- */
-      free((__pyx_v_self->fields[__pyx_v_field]));
-      goto __pyx_L9;
-    }
-    __pyx_L9:;
-  }
-
-  /* "pysam/TabProxies.pyx":205
- *                 free(self.fields[field])
- * 
- *         self.is_modified = self.nfields = 0             # <<<<<<<<<<<<<<
- * 
- *         #################################
- */
-  __pyx_v_self->is_modified = 0;
-  __pyx_v_self->nfields = 0;
-
-  /* "pysam/TabProxies.pyx":209
- *         #################################
- *         # allocate new
- *         max_fields = self.getMaxFields()             # <<<<<<<<<<<<<<
- *         # pre-count fields - better would be
- *         # to guess or dynamically grow
- */
-  __pyx_v_max_fields = ((struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *)__pyx_v_self->__pyx_vtab)->getMaxFields(__pyx_v_self);
-
-  /* "pysam/TabProxies.pyx":212
- *         # pre-count fields - better would be
- *         # to guess or dynamically grow
- *         if max_fields == 0:             # <<<<<<<<<<<<<<
- *             for x from 0 <= x < nbytes:
- *                 if buffer[x] == '\t':
- */
-  __pyx_t_5 = ((__pyx_v_max_fields == 0) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/TabProxies.pyx":213
- *         # to guess or dynamically grow
- *         if max_fields == 0:
- *             for x from 0 <= x < nbytes:             # <<<<<<<<<<<<<<
- *                 if buffer[x] == '\t':
- *                     max_fields += 1
- */
-    __pyx_t_9 = __pyx_v_nbytes;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_9; __pyx_v_x++) {
-
-      /* "pysam/TabProxies.pyx":214
- *         if max_fields == 0:
- *             for x from 0 <= x < nbytes:
- *                 if buffer[x] == '\t':             # <<<<<<<<<<<<<<
- *                     max_fields += 1
- *             max_fields += 1
- */
-      __pyx_t_5 = (((__pyx_v_buffer[__pyx_v_x]) == '\t') != 0);
-      if (__pyx_t_5) {
-
-        /* "pysam/TabProxies.pyx":215
- *             for x from 0 <= x < nbytes:
- *                 if buffer[x] == '\t':
- *                     max_fields += 1             # <<<<<<<<<<<<<<
- *             max_fields += 1
- * 
- */
-        __pyx_v_max_fields = (__pyx_v_max_fields + 1);
-        goto __pyx_L13;
-      }
-      __pyx_L13:;
-    }
-
-    /* "pysam/TabProxies.pyx":216
- *                 if buffer[x] == '\t':
- *                     max_fields += 1
- *             max_fields += 1             # <<<<<<<<<<<<<<
- * 
- *         self.fields = <char **>calloc(max_fields, sizeof(char *))
- */
-    __pyx_v_max_fields = (__pyx_v_max_fields + 1);
-    goto __pyx_L10;
-  }
-  __pyx_L10:;
-
-  /* "pysam/TabProxies.pyx":218
- *             max_fields += 1
- * 
- *         self.fields = <char **>calloc(max_fields, sizeof(char *))             # <<<<<<<<<<<<<<
- *         if self.fields == NULL:
- *             raise ValueError("out of memory in TupleProxy.update()")
- */
-  __pyx_v_self->fields = ((char **)calloc(__pyx_v_max_fields, (sizeof(char *))));
-
-  /* "pysam/TabProxies.pyx":219
- * 
- *         self.fields = <char **>calloc(max_fields, sizeof(char *))
- *         if self.fields == NULL:             # <<<<<<<<<<<<<<
- *             raise ValueError("out of memory in TupleProxy.update()")
- * 
- */
-  __pyx_t_5 = ((__pyx_v_self->fields == NULL) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/TabProxies.pyx":220
- *         self.fields = <char **>calloc(max_fields, sizeof(char *))
- *         if self.fields == NULL:
- *             raise ValueError("out of memory in TupleProxy.update()")             # <<<<<<<<<<<<<<
- * 
- *         #################################
- */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":224
- *         #################################
- *         # start filling
- *         field = 0             # <<<<<<<<<<<<<<
- *         self.fields[field] = pos = buffer
- *         field += 1
- */
-  __pyx_v_field = 0;
-
-  /* "pysam/TabProxies.pyx":225
- *         # start filling
- *         field = 0
- *         self.fields[field] = pos = buffer             # <<<<<<<<<<<<<<
- *         field += 1
- *         old_pos = pos
- */
-  (__pyx_v_self->fields[__pyx_v_field]) = __pyx_v_buffer;
-  __pyx_v_pos = __pyx_v_buffer;
-
-  /* "pysam/TabProxies.pyx":226
- *         field = 0
- *         self.fields[field] = pos = buffer
- *         field += 1             # <<<<<<<<<<<<<<
- *         old_pos = pos
- *         while 1:
- */
-  __pyx_v_field = (__pyx_v_field + 1);
-
-  /* "pysam/TabProxies.pyx":227
- *         self.fields[field] = pos = buffer
- *         field += 1
- *         old_pos = pos             # <<<<<<<<<<<<<<
- *         while 1:
- * 
- */
-  __pyx_v_old_pos = __pyx_v_pos;
-
-  /* "pysam/TabProxies.pyx":228
- *         field += 1
- *         old_pos = pos
- *         while 1:             # <<<<<<<<<<<<<<
- * 
- *             pos = <char*>memchr(pos, '\t', nbytes)
- */
-  while (1) {
-
-    /* "pysam/TabProxies.pyx":230
- *         while 1:
- * 
- *             pos = <char*>memchr(pos, '\t', nbytes)             # <<<<<<<<<<<<<<
- *             if pos == NULL:
- *                 break
- */
-    __pyx_v_pos = ((char *)memchr(__pyx_v_pos, '\t', __pyx_v_nbytes));
-
-    /* "pysam/TabProxies.pyx":231
- * 
- *             pos = <char*>memchr(pos, '\t', nbytes)
- *             if pos == NULL:             # <<<<<<<<<<<<<<
- *                 break
- *             if field >= max_fields:
- */
-    __pyx_t_5 = ((__pyx_v_pos == NULL) != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/TabProxies.pyx":232
- *             pos = <char*>memchr(pos, '\t', nbytes)
- *             if pos == NULL:
- *                 break             # <<<<<<<<<<<<<<
- *             if field >= max_fields:
- *                 raise ValueError(
- */
-      goto __pyx_L16_break;
-    }
-
-    /* "pysam/TabProxies.pyx":233
- *             if pos == NULL:
- *                 break
- *             if field >= max_fields:             # <<<<<<<<<<<<<<
- *                 raise ValueError(
- *                     "parsing error: more than %i fields in line: %s" %
- */
-    __pyx_t_5 = ((__pyx_v_field >= __pyx_v_max_fields) != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/TabProxies.pyx":236
- *                 raise ValueError(
- *                     "parsing error: more than %i fields in line: %s" %
- *                     (max_fields, buffer))             # <<<<<<<<<<<<<<
- * 
- *             pos[0] = '\0'
- */
-      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_max_fields); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
-      __Pyx_GIVEREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_3 = 0;
-      __pyx_t_2 = 0;
-
-      /* "pysam/TabProxies.pyx":235
- *             if field >= max_fields:
- *                 raise ValueError(
- *                     "parsing error: more than %i fields in line: %s" %             # <<<<<<<<<<<<<<
- *                     (max_fields, buffer))
- * 
- */
-      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_parsing_error_more_than_i_fields, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/TabProxies.pyx":234
- *                 break
- *             if field >= max_fields:
- *                 raise ValueError(             # <<<<<<<<<<<<<<
- *                     "parsing error: more than %i fields in line: %s" %
- *                     (max_fields, buffer))
- */
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/TabProxies.pyx":238
- *                     (max_fields, buffer))
- * 
- *             pos[0] = '\0'             # <<<<<<<<<<<<<<
- *             pos += 1
- *             self.fields[field] = pos
- */
-    (__pyx_v_pos[0]) = '\x00';
-
-    /* "pysam/TabProxies.pyx":239
- * 
- *             pos[0] = '\0'
- *             pos += 1             # <<<<<<<<<<<<<<
- *             self.fields[field] = pos
- *             field += 1
- */
-    __pyx_v_pos = (__pyx_v_pos + 1);
-
-    /* "pysam/TabProxies.pyx":240
- *             pos[0] = '\0'
- *             pos += 1
- *             self.fields[field] = pos             # <<<<<<<<<<<<<<
- *             field += 1
- *             nbytes -= pos - old_pos
- */
-    (__pyx_v_self->fields[__pyx_v_field]) = __pyx_v_pos;
-
-    /* "pysam/TabProxies.pyx":241
- *             pos += 1
- *             self.fields[field] = pos
- *             field += 1             # <<<<<<<<<<<<<<
- *             nbytes -= pos - old_pos
- *             if nbytes < 0:
- */
-    __pyx_v_field = (__pyx_v_field + 1);
-
-    /* "pysam/TabProxies.pyx":242
- *             self.fields[field] = pos
- *             field += 1
- *             nbytes -= pos - old_pos             # <<<<<<<<<<<<<<
- *             if nbytes < 0:
- *                 break
- */
-    __pyx_v_nbytes = (__pyx_v_nbytes - (__pyx_v_pos - __pyx_v_old_pos));
-
-    /* "pysam/TabProxies.pyx":243
- *             field += 1
- *             nbytes -= pos - old_pos
- *             if nbytes < 0:             # <<<<<<<<<<<<<<
- *                 break
- *             old_pos = pos
- */
-    __pyx_t_5 = ((__pyx_v_nbytes < 0) != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/TabProxies.pyx":244
- *             nbytes -= pos - old_pos
- *             if nbytes < 0:
- *                 break             # <<<<<<<<<<<<<<
- *             old_pos = pos
- *         self.nfields = field
- */
-      goto __pyx_L16_break;
-    }
-
-    /* "pysam/TabProxies.pyx":245
- *             if nbytes < 0:
- *                 break
- *             old_pos = pos             # <<<<<<<<<<<<<<
- *         self.nfields = field
- *         if self.nfields < self.getMinFields():
- */
-    __pyx_v_old_pos = __pyx_v_pos;
-  }
-  __pyx_L16_break:;
-
-  /* "pysam/TabProxies.pyx":246
- *                 break
- *             old_pos = pos
- *         self.nfields = field             # <<<<<<<<<<<<<<
- *         if self.nfields < self.getMinFields():
- *             raise ValueError(
- */
-  __pyx_v_self->nfields = __pyx_v_field;
-
-  /* "pysam/TabProxies.pyx":247
- *             old_pos = pos
- *         self.nfields = field
- *         if self.nfields < self.getMinFields():             # <<<<<<<<<<<<<<
- *             raise ValueError(
- *                 "parsing error: fewer that %i fields in line: %s" %
- */
-  __pyx_t_5 = ((__pyx_v_self->nfields < ((struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *)__pyx_v_self->__pyx_vtab)->getMinFields(__pyx_v_self)) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/TabProxies.pyx":250
- *             raise ValueError(
- *                 "parsing error: fewer that %i fields in line: %s" %
- *                 (self.getMinFields(), buffer))             # <<<<<<<<<<<<<<
- * 
- *     def _getindex(self, int index):
- */
-    __pyx_t_2 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *)__pyx_v_self->__pyx_vtab)->getMinFields(__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_buffer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_2 = 0;
-    __pyx_t_1 = 0;
-
-    /* "pysam/TabProxies.pyx":249
- *         if self.nfields < self.getMinFields():
- *             raise ValueError(
- *                 "parsing error: fewer that %i fields in line: %s" %             # <<<<<<<<<<<<<<
- *                 (self.getMinFields(), buffer))
- * 
- */
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_parsing_error_fewer_that_i_field, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/TabProxies.pyx":248
- *         self.nfields = field
- *         if self.nfields < self.getMinFields():
- *             raise ValueError(             # <<<<<<<<<<<<<<
- *                 "parsing error: fewer that %i fields in line: %s" %
- *                 (self.getMinFields(), buffer))
- */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":160
- *         return 0
- * 
- *     cdef update(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''update internal data.
- * 
- */
-
-  /* function exit code */
-  __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("pysam.TabProxies.TupleProxy.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":252
- *                 (self.getMinFields(), buffer))
- * 
- *     def _getindex(self, int index):             # <<<<<<<<<<<<<<
- *         '''return item at idx index'''
- *         cdef int i = index
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_5_getindex(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_10TupleProxy_4_getindex[] = "return item at idx index";
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_5_getindex(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
-  int __pyx_v_index;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_getindex (wrapper)", 0);
-  assert(__pyx_arg_index); {
-    __pyx_v_index = __Pyx_PyInt_As_int(__pyx_arg_index); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy._getindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy_4_getindex(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self), ((int)__pyx_v_index));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_4_getindex(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, int __pyx_v_index) {
-  int __pyx_v_i;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  struct __pyx_opt_args_5pysam_10TabProxies__force_str __pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_getindex", 0);
-
-  /* "pysam/TabProxies.pyx":254
- *     def _getindex(self, int index):
- *         '''return item at idx index'''
- *         cdef int i = index             # <<<<<<<<<<<<<<
- *         if i < 0:
- *             i += self.nfields
- */
-  __pyx_v_i = __pyx_v_index;
-
-  /* "pysam/TabProxies.pyx":255
- *         '''return item at idx index'''
- *         cdef int i = index
- *         if i < 0:             # <<<<<<<<<<<<<<
- *             i += self.nfields
- *         if i < 0:
- */
-  __pyx_t_1 = ((__pyx_v_i < 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":256
- *         cdef int i = index
- *         if i < 0:
- *             i += self.nfields             # <<<<<<<<<<<<<<
- *         if i < 0:
- *             raise IndexError("list index out of range")
- */
-    __pyx_v_i = (__pyx_v_i + __pyx_v_self->nfields);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":257
- *         if i < 0:
- *             i += self.nfields
- *         if i < 0:             # <<<<<<<<<<<<<<
- *             raise IndexError("list index out of range")
- *         # apply offset - separating a fixed number
- */
-  __pyx_t_1 = ((__pyx_v_i < 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":258
- *             i += self.nfields
- *         if i < 0:
- *             raise IndexError("list index out of range")             # <<<<<<<<<<<<<<
- *         # apply offset - separating a fixed number
- *         # of fields from a variable number such as in VCF
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":261
- *         # apply offset - separating a fixed number
- *         # of fields from a variable number such as in VCF
- *         i += self.offset             # <<<<<<<<<<<<<<
- *         if i >= self.nfields:
- *             raise IndexError(
- */
-  __pyx_v_i = (__pyx_v_i + __pyx_v_self->offset);
-
-  /* "pysam/TabProxies.pyx":262
- *         # of fields from a variable number such as in VCF
- *         i += self.offset
- *         if i >= self.nfields:             # <<<<<<<<<<<<<<
- *             raise IndexError(
- *                 "list index out of range %i >= %i" %
- */
-  __pyx_t_1 = ((__pyx_v_i >= __pyx_v_self->nfields) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":265
- *             raise IndexError(
- *                 "list index out of range %i >= %i" %
- *                 (i, self.nfields))             # <<<<<<<<<<<<<<
- *         return _force_str(self.fields[i], self.encoding)
- * 
- */
-    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nfields); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_2 = 0;
-    __pyx_t_3 = 0;
-
-    /* "pysam/TabProxies.pyx":264
- *         if i >= self.nfields:
- *             raise IndexError(
- *                 "list index out of range %i >= %i" %             # <<<<<<<<<<<<<<
- *                 (i, self.nfields))
- *         return _force_str(self.fields[i], self.encoding)
- */
-    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_list_index_out_of_range_i_i, __pyx_t_4); 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);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-    /* "pysam/TabProxies.pyx":263
- *         i += self.offset
- *         if i >= self.nfields:
- *             raise IndexError(             # <<<<<<<<<<<<<<
- *                 "list index out of range %i >= %i" %
- *                 (i, self.nfields))
- */
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":266
- *                 "list index out of range %i >= %i" %
- *                 (i, self.nfields))
- *         return _force_str(self.fields[i], self.encoding)             # <<<<<<<<<<<<<<
- * 
- *     def __getitem__(self, key):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyBytes_FromString((__pyx_v_self->fields[__pyx_v_i])); 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_4 = __pyx_v_self->encoding;
-  __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5.__pyx_n = 1;
-  __pyx_t_5.encoding = __pyx_t_4;
-  __pyx_t_2 = __pyx_f_5pysam_10TabProxies__force_str(__pyx_t_3, &__pyx_t_5); 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_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":252
- *                 (self.getMinFields(), buffer))
- * 
- *     def _getindex(self, int index):             # <<<<<<<<<<<<<<
- *         '''return item at idx index'''
- *         cdef int i = index
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy._getindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":268
- *         return _force_str(self.fields[i], self.encoding)
- * 
- *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
- *         if type(key) == int:
- *             return self._getindex(key)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy_6__getitem__(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self), ((PyObject *)__pyx_v_key));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_6__getitem__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, PyObject *__pyx_v_key) {
-  PyObject *__pyx_v_start = NULL;
-  PyObject *__pyx_v_end = NULL;
-  PyObject *__pyx_v_step = NULL;
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_v_index = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *(*__pyx_t_7)(PyObject *);
-  Py_ssize_t __pyx_t_8;
-  PyObject *(*__pyx_t_9)(PyObject *);
-  int __pyx_t_10;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__getitem__", 0);
-
-  /* "pysam/TabProxies.pyx":269
- * 
- *     def __getitem__(self, key):
- *         if type(key) == int:             # <<<<<<<<<<<<<<
- *             return self._getindex(key)
- *         # slice object
- */
-  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_key)), ((PyObject *)((PyObject*)(&PyInt_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":270
- *     def __getitem__(self, key):
- *         if type(key) == int:
- *             return self._getindex(key)             # <<<<<<<<<<<<<<
- *         # slice object
- *         start, end, step = key.indices(self.nfields)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":272
- *             return self._getindex(key)
- *         # slice object
- *         start, end, step = key.indices(self.nfields)             # <<<<<<<<<<<<<<
- *         result = []
- *         for index in range(start, end, step):
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->nfields); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-    PyObject* sequence = __pyx_t_3;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 3)) {
-      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
-      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
-    } else {
-      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
-      __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
-    }
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_t_5);
-    #else
-    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    #endif
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
-    index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_1);
-    index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_4);
-    index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_5);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = NULL;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    goto __pyx_L5_unpacking_done;
-    __pyx_L4_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_7 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L5_unpacking_done:;
-  }
-  __pyx_v_start = __pyx_t_1;
-  __pyx_t_1 = 0;
-  __pyx_v_end = __pyx_t_4;
-  __pyx_t_4 = 0;
-  __pyx_v_step = __pyx_t_5;
-  __pyx_t_5 = 0;
-
-  /* "pysam/TabProxies.pyx":273
- *         # slice object
- *         start, end, step = key.indices(self.nfields)
- *         result = []             # <<<<<<<<<<<<<<
- *         for index in range(start, end, step):
- *             result.append(self._getindex(index))
- */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_v_result = ((PyObject*)__pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/TabProxies.pyx":274
- *         start, end, step = key.indices(self.nfields)
- *         result = []
- *         for index in range(start, end, step):             # <<<<<<<<<<<<<<
- *             result.append(self._getindex(index))
- *         return result
- */
-  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_v_start);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_start);
-  __Pyx_GIVEREF(__pyx_v_start);
-  __Pyx_INCREF(__pyx_v_end);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_end);
-  __Pyx_GIVEREF(__pyx_v_end);
-  __Pyx_INCREF(__pyx_v_step);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_step);
-  __Pyx_GIVEREF(__pyx_v_step);
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
-    __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
-    __pyx_t_9 = NULL;
-  } else {
-    __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  for (;;) {
-    if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_3)) {
-      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_3)) {
-      if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_5 = __pyx_t_9(__pyx_t_3);
-      if (unlikely(!__pyx_t_5)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_5);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_5);
-    __pyx_t_5 = 0;
-
-    /* "pysam/TabProxies.pyx":275
- *         result = []
- *         for index in range(start, end, step):
- *             result.append(self._getindex(index))             # <<<<<<<<<<<<<<
- *         return result
- * 
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_index);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
-    __Pyx_GIVEREF(__pyx_v_index);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/TabProxies.pyx":276
- *         for index in range(start, end, step):
- *             result.append(self._getindex(index))
- *         return result             # <<<<<<<<<<<<<<
- * 
- *     def _setindex(self, index, value):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":268
- *         return _force_str(self.fields[i], self.encoding)
- * 
- *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
- *         if type(key) == int:
- *             return self._getindex(key)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_start);
-  __Pyx_XDECREF(__pyx_v_end);
-  __Pyx_XDECREF(__pyx_v_step);
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_index);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":278
- *         return result
- * 
- *     def _setindex(self, index, value):             # <<<<<<<<<<<<<<
- *         '''set item at idx index.'''
- *         cdef int idx = index
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_9_setindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_10TupleProxy_8_setindex[] = "set item at idx index.";
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_9_setindex(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_index = 0;
-  PyObject *__pyx_v_value = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_setindex (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_value,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_setindex", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_setindex") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __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_index = values[0];
-    __pyx_v_value = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_setindex", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy._setindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy_8_setindex(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self), __pyx_v_index, __pyx_v_value);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_8_setindex(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
-  int __pyx_v_idx;
-  char *__pyx_v_tmp;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  char *__pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_setindex", 0);
-  __Pyx_INCREF(__pyx_v_value);
-
-  /* "pysam/TabProxies.pyx":280
- *     def _setindex(self, index, value):
- *         '''set item at idx index.'''
- *         cdef int idx = index             # <<<<<<<<<<<<<<
- *         if idx < 0:
- *             raise IndexError("list index out of range")
- */
-  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_idx = __pyx_t_1;
-
-  /* "pysam/TabProxies.pyx":281
- *         '''set item at idx index.'''
- *         cdef int idx = index
- *         if idx < 0:             # <<<<<<<<<<<<<<
- *             raise IndexError("list index out of range")
- *         if idx >= self.nfields:
- */
-  __pyx_t_2 = ((__pyx_v_idx < 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":282
- *         cdef int idx = index
- *         if idx < 0:
- *             raise IndexError("list index out of range")             # <<<<<<<<<<<<<<
- *         if idx >= self.nfields:
- *             raise IndexError("list index out of range")
- */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":283
- *         if idx < 0:
- *             raise IndexError("list index out of range")
- *         if idx >= self.nfields:             # <<<<<<<<<<<<<<
- *             raise IndexError("list index out of range")
- * 
- */
-  __pyx_t_2 = ((__pyx_v_idx >= __pyx_v_self->nfields) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":284
- *             raise IndexError("list index out of range")
- *         if idx >= self.nfields:
- *             raise IndexError("list index out of range")             # <<<<<<<<<<<<<<
- * 
- *         if isNew(self.fields[idx], self.data, self.nbytes):
- */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":286
- *             raise IndexError("list index out of range")
- * 
- *         if isNew(self.fields[idx], self.data, self.nbytes):             # <<<<<<<<<<<<<<
- *             free(self.fields[idx] )
- * 
- */
-  __pyx_t_2 = (__pyx_f_5pysam_10TabProxies_isNew((__pyx_v_self->fields[__pyx_v_idx]), __pyx_v_self->data, __pyx_v_self->nbytes) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":287
- * 
- *         if isNew(self.fields[idx], self.data, self.nbytes):
- *             free(self.fields[idx] )             # <<<<<<<<<<<<<<
- * 
- *         self.is_modified = 1
- */
-    free((__pyx_v_self->fields[__pyx_v_idx]));
-    goto __pyx_L5;
-  }
-  __pyx_L5:;
-
-  /* "pysam/TabProxies.pyx":289
- *             free(self.fields[idx] )
- * 
- *         self.is_modified = 1             # <<<<<<<<<<<<<<
- * 
- *         if value is None:
- */
-  __pyx_v_self->is_modified = 1;
-
-  /* "pysam/TabProxies.pyx":291
- *         self.is_modified = 1
- * 
- *         if value is None:             # <<<<<<<<<<<<<<
- *             self.fields[idx] = NULL
- *             return
- */
-  __pyx_t_2 = (__pyx_v_value == Py_None);
-  __pyx_t_4 = (__pyx_t_2 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/TabProxies.pyx":292
- * 
- *         if value is None:
- *             self.fields[idx] = NULL             # <<<<<<<<<<<<<<
- *             return
- * 
- */
-    (__pyx_v_self->fields[__pyx_v_idx]) = NULL;
-
-    /* "pysam/TabProxies.pyx":293
- *         if value is None:
- *             self.fields[idx] = NULL
- *             return             # <<<<<<<<<<<<<<
- * 
- *         # conversion with error checking
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":296
- * 
- *         # conversion with error checking
- *         value = _force_bytes(value)             # <<<<<<<<<<<<<<
- *         cdef char * tmp = <char*>value
- *         self.fields[idx] = <char*>malloc((strlen( tmp ) + 1) * sizeof(char))
- */
-  __pyx_t_3 = __pyx_f_5pysam_10TabProxies__force_bytes(__pyx_v_value, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/TabProxies.pyx":297
- *         # conversion with error checking
- *         value = _force_bytes(value)
- *         cdef char * tmp = <char*>value             # <<<<<<<<<<<<<<
- *         self.fields[idx] = <char*>malloc((strlen( tmp ) + 1) * sizeof(char))
- *         if self.fields[idx] == NULL:
- */
-  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_tmp = ((char *)__pyx_t_5);
-
-  /* "pysam/TabProxies.pyx":298
- *         value = _force_bytes(value)
- *         cdef char * tmp = <char*>value
- *         self.fields[idx] = <char*>malloc((strlen( tmp ) + 1) * sizeof(char))             # <<<<<<<<<<<<<<
- *         if self.fields[idx] == NULL:
- *             raise ValueError("out of memory" )
- */
-  (__pyx_v_self->fields[__pyx_v_idx]) = ((char *)malloc(((strlen(__pyx_v_tmp) + 1) * (sizeof(char)))));
-
-  /* "pysam/TabProxies.pyx":299
- *         cdef char * tmp = <char*>value
- *         self.fields[idx] = <char*>malloc((strlen( tmp ) + 1) * sizeof(char))
- *         if self.fields[idx] == NULL:             # <<<<<<<<<<<<<<
- *             raise ValueError("out of memory" )
- *         strcpy(self.fields[idx], tmp)
- */
-  __pyx_t_4 = (((__pyx_v_self->fields[__pyx_v_idx]) == NULL) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/TabProxies.pyx":300
- *         self.fields[idx] = <char*>malloc((strlen( tmp ) + 1) * sizeof(char))
- *         if self.fields[idx] == NULL:
- *             raise ValueError("out of memory" )             # <<<<<<<<<<<<<<
- *         strcpy(self.fields[idx], tmp)
- * 
- */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":301
- *         if self.fields[idx] == NULL:
- *             raise ValueError("out of memory" )
- *         strcpy(self.fields[idx], tmp)             # <<<<<<<<<<<<<<
- * 
- *     def __setitem__(self, index, value):
- */
-  strcpy((__pyx_v_self->fields[__pyx_v_idx]), __pyx_v_tmp);
-
-  /* "pysam/TabProxies.pyx":278
- *         return result
- * 
- *     def _setindex(self, index, value):             # <<<<<<<<<<<<<<
- *         '''set item at idx index.'''
- *         cdef int idx = index
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy._setindex", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":303
- *         strcpy(self.fields[idx], tmp)
- * 
- *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
- *         '''set item at *index* to *value*'''
- *         cdef int i = index
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_10TupleProxy_11__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_10TupleProxy_10__setitem__[] = "set item at *index* to *value*";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_10__setitem__;
-#endif
-static int __pyx_pw_5pysam_10TabProxies_10TupleProxy_11__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy_10__setitem__(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_10TupleProxy_10__setitem__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
-  int __pyx_v_i;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__setitem__", 0);
-
-  /* "pysam/TabProxies.pyx":305
- *     def __setitem__(self, index, value):
- *         '''set item at *index* to *value*'''
- *         cdef int i = index             # <<<<<<<<<<<<<<
- *         if i < 0:
- *             i += self.nfields
- */
-  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_i = __pyx_t_1;
-
-  /* "pysam/TabProxies.pyx":306
- *         '''set item at *index* to *value*'''
- *         cdef int i = index
- *         if i < 0:             # <<<<<<<<<<<<<<
- *             i += self.nfields
- *         i += self.offset
- */
-  __pyx_t_2 = ((__pyx_v_i < 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":307
- *         cdef int i = index
- *         if i < 0:
- *             i += self.nfields             # <<<<<<<<<<<<<<
- *         i += self.offset
- * 
- */
-    __pyx_v_i = (__pyx_v_i + __pyx_v_self->nfields);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":308
- *         if i < 0:
- *             i += self.nfields
- *         i += self.offset             # <<<<<<<<<<<<<<
- * 
- *         self._setindex(i, value)
- */
-  __pyx_v_i = (__pyx_v_i + __pyx_v_self->offset);
-
-  /* "pysam/TabProxies.pyx":310
- *         i += self.offset
- * 
- *         self._setindex(i, value)             # <<<<<<<<<<<<<<
- * 
- *     def __len__(self):
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/TabProxies.pyx":303
- *         strcpy(self.fields[idx], tmp)
- * 
- *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
- *         '''set item at *index* to *value*'''
- *         cdef int i = index
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":312
- *         self._setindex(i, value)
- * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         return self.nfields
- * 
- */
-
-/* Python wrapper */
-static Py_ssize_t __pyx_pw_5pysam_10TabProxies_10TupleProxy_13__len__(PyObject *__pyx_v_self); /*proto*/
-static Py_ssize_t __pyx_pw_5pysam_10TabProxies_10TupleProxy_13__len__(PyObject *__pyx_v_self) {
-  Py_ssize_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy_12__len__(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static Py_ssize_t __pyx_pf_5pysam_10TabProxies_10TupleProxy_12__len__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self) {
-  Py_ssize_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__len__", 0);
-
-  /* "pysam/TabProxies.pyx":313
- * 
- *     def __len__(self):
- *         return self.nfields             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __pyx_r = __pyx_v_self->nfields;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":312
- *         self._setindex(i, value)
- * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         return self.nfields
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":315
- *         return self.nfields
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         self.index = 0
- *         return self
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_15__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_15__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy_14__iter__(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_14__iter__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-
-  /* "pysam/TabProxies.pyx":316
- * 
- *     def __iter__(self):
- *         self.index = 0             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-  __pyx_v_self->index = 0;
-
-  /* "pysam/TabProxies.pyx":317
- *     def __iter__(self):
- *         self.index = 0
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":315
- *         return self.nfields
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         self.index = 0
- *         return self
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":319
- *         return self
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_17__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_10TupleProxy_16__next__[] = "python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_16__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_17__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy_16__next__(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_16__next__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self) {
-  char *__pyx_v_retval;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  struct __pyx_opt_args_5pysam_10TabProxies__force_str __pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/TabProxies.pyx":322
- *         """python version of next().
- *         """
- *         if self.index >= self.nfields:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- *         cdef char * retval = self.fields[self.index]
- */
-  __pyx_t_1 = ((__pyx_v_self->index >= __pyx_v_self->nfields) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":323
- *         """
- *         if self.index >= self.nfields:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- *         cdef char * retval = self.fields[self.index]
- *         self.index += 1
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":324
- *         if self.index >= self.nfields:
- *             raise StopIteration
- *         cdef char * retval = self.fields[self.index]             # <<<<<<<<<<<<<<
- *         self.index += 1
- *         if retval == NULL:
- */
-  __pyx_v_retval = (__pyx_v_self->fields[__pyx_v_self->index]);
-
-  /* "pysam/TabProxies.pyx":325
- *             raise StopIteration
- *         cdef char * retval = self.fields[self.index]
- *         self.index += 1             # <<<<<<<<<<<<<<
- *         if retval == NULL:
- *             return None
- */
-  __pyx_v_self->index = (__pyx_v_self->index + 1);
-
-  /* "pysam/TabProxies.pyx":326
- *         cdef char * retval = self.fields[self.index]
- *         self.index += 1
- *         if retval == NULL:             # <<<<<<<<<<<<<<
- *             return None
- *         else:
- */
-  __pyx_t_1 = ((__pyx_v_retval == NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":327
- *         self.index += 1
- *         if retval == NULL:
- *             return None             # <<<<<<<<<<<<<<
- *         else:
- *             return _force_str(retval, self.encoding)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":329
- *             return None
- *         else:
- *             return _force_str(retval, self.encoding)             # <<<<<<<<<<<<<<
- * 
- *     def __str__(self):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_retval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __pyx_v_self->encoding;
-    __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_5.__pyx_n = 1;
-    __pyx_t_5.encoding = __pyx_t_3;
-    __pyx_t_4 = __pyx_f_5pysam_10TabProxies__force_str(__pyx_t_2, &__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":319
- *         return self
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":331
- *             return _force_str(retval, self.encoding)
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         '''return original data'''
- *         # copy and replace \0 bytes with \t characters
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_19__str__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_10TupleProxy_18__str__[] = "return original data";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_18__str__;
-#endif
-static PyObject *__pyx_pw_5pysam_10TabProxies_10TupleProxy_19__str__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_10TupleProxy_18__str__(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_10TupleProxy_18__str__(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_self) {
-  PyObject *__pyx_v_result = NULL;
-  long __pyx_v_x;
-  char *__pyx_v_cpy;
-  PyObject *__pyx_v_r = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  long __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__str__", 0);
-
-  /* "pysam/TabProxies.pyx":334
- *         '''return original data'''
- *         # copy and replace \0 bytes with \t characters
- *         if self.is_modified:             # <<<<<<<<<<<<<<
- *             # todo: treat NULL values
- *             result = []
- */
-  __pyx_t_1 = (__pyx_v_self->is_modified != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":336
- *         if self.is_modified:
- *             # todo: treat NULL values
- *             result = []             # <<<<<<<<<<<<<<
- *             for x in xrange(0, self.nfields):
- *                 result.append(StrOrEmpty(self.fields[x]).decode(self.encoding))
- */
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_result = __pyx_t_2;
-    __pyx_t_2 = 0;
-
-    /* "pysam/TabProxies.pyx":337
- *             # todo: treat NULL values
- *             result = []
- *             for x in xrange(0, self.nfields):             # <<<<<<<<<<<<<<
- *                 result.append(StrOrEmpty(self.fields[x]).decode(self.encoding))
- *             return "\t".join(result)
- */
-    __pyx_t_3 = __pyx_v_self->nfields;
-    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
-      __pyx_v_x = __pyx_t_4;
-
-      /* "pysam/TabProxies.pyx":338
- *             result = []
- *             for x in xrange(0, self.nfields):
- *                 result.append(StrOrEmpty(self.fields[x]).decode(self.encoding))             # <<<<<<<<<<<<<<
- *             return "\t".join(result)
- *         else:
- */
-      __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_f_5pysam_10TabProxies_StrOrEmpty((__pyx_v_self->fields[__pyx_v_x]))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_self->encoding);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->encoding);
-      __Pyx_GIVEREF(__pyx_v_self->encoding);
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    }
-
-    /* "pysam/TabProxies.pyx":339
- *             for x in xrange(0, self.nfields):
- *                 result.append(StrOrEmpty(self.fields[x]).decode(self.encoding))
- *             return "\t".join(result)             # <<<<<<<<<<<<<<
- *         else:
- *             cpy = <char*>calloc(sizeof(char), self.nbytes+1)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_v_result); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_r = __pyx_t_6;
-    __pyx_t_6 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":341
- *             return "\t".join(result)
- *         else:
- *             cpy = <char*>calloc(sizeof(char), self.nbytes+1)             # <<<<<<<<<<<<<<
- *             if cpy == NULL:
- *                 raise ValueError("out of memory")
- */
-    __pyx_v_cpy = ((char *)calloc((sizeof(char)), (__pyx_v_self->nbytes + 1)));
-
-    /* "pysam/TabProxies.pyx":342
- *         else:
- *             cpy = <char*>calloc(sizeof(char), self.nbytes+1)
- *             if cpy == NULL:             # <<<<<<<<<<<<<<
- *                 raise ValueError("out of memory")
- *             memcpy(cpy, self.data, self.nbytes+1)
- */
-    __pyx_t_1 = ((__pyx_v_cpy == NULL) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/TabProxies.pyx":343
- *             cpy = <char*>calloc(sizeof(char), self.nbytes+1)
- *             if cpy == NULL:
- *                 raise ValueError("out of memory")             # <<<<<<<<<<<<<<
- *             memcpy(cpy, self.data, self.nbytes+1)
- *             for x from 0 <= x < self.nbytes:
- */
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/TabProxies.pyx":344
- *             if cpy == NULL:
- *                 raise ValueError("out of memory")
- *             memcpy(cpy, self.data, self.nbytes+1)             # <<<<<<<<<<<<<<
- *             for x from 0 <= x < self.nbytes:
- *                 if cpy[x] == '\0':
- */
-    memcpy(__pyx_v_cpy, __pyx_v_self->data, (__pyx_v_self->nbytes + 1));
-
-    /* "pysam/TabProxies.pyx":345
- *                 raise ValueError("out of memory")
- *             memcpy(cpy, self.data, self.nbytes+1)
- *             for x from 0 <= x < self.nbytes:             # <<<<<<<<<<<<<<
- *                 if cpy[x] == '\0':
- *                     cpy[x] = '\t'
- */
-    __pyx_t_3 = __pyx_v_self->nbytes;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_3; __pyx_v_x++) {
-
-      /* "pysam/TabProxies.pyx":346
- *             memcpy(cpy, self.data, self.nbytes+1)
- *             for x from 0 <= x < self.nbytes:
- *                 if cpy[x] == '\0':             # <<<<<<<<<<<<<<
- *                     cpy[x] = '\t'
- *             result = cpy[:self.nbytes]
- */
-      __pyx_t_1 = (((__pyx_v_cpy[__pyx_v_x]) == '\x00') != 0);
-      if (__pyx_t_1) {
-
-        /* "pysam/TabProxies.pyx":347
- *             for x from 0 <= x < self.nbytes:
- *                 if cpy[x] == '\0':
- *                     cpy[x] = '\t'             # <<<<<<<<<<<<<<
- *             result = cpy[:self.nbytes]
- *             free(cpy)
- */
-        (__pyx_v_cpy[__pyx_v_x]) = '\t';
-        goto __pyx_L9;
-      }
-      __pyx_L9:;
-    }
-
-    /* "pysam/TabProxies.pyx":348
- *                 if cpy[x] == '\0':
- *                     cpy[x] = '\t'
- *             result = cpy[:self.nbytes]             # <<<<<<<<<<<<<<
- *             free(cpy)
- *             r = result.decode(self.encoding)
- */
-    __pyx_t_6 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_cpy + 0, __pyx_v_self->nbytes - 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_v_result = __pyx_t_6;
-    __pyx_t_6 = 0;
-
-    /* "pysam/TabProxies.pyx":349
- *                     cpy[x] = '\t'
- *             result = cpy[:self.nbytes]
- *             free(cpy)             # <<<<<<<<<<<<<<
- *             r = result.decode(self.encoding)
- *             return r
- */
-    free(__pyx_v_cpy);
-
-    /* "pysam/TabProxies.pyx":350
- *             result = cpy[:self.nbytes]
- *             free(cpy)
- *             r = result.decode(self.encoding)             # <<<<<<<<<<<<<<
- *             return r
- * 
- */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_self->encoding);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->encoding);
-    __Pyx_GIVEREF(__pyx_v_self->encoding);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_r = __pyx_t_5;
-    __pyx_t_5 = 0;
-
-    /* "pysam/TabProxies.pyx":351
- *             free(cpy)
- *             r = result.decode(self.encoding)
- *             return r             # <<<<<<<<<<<<<<
- * 
- * def toDot(v):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_r);
-    __pyx_r = __pyx_v_r;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":331
- *             return _force_str(retval, self.encoding)
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         '''return original data'''
- *         # copy and replace \0 bytes with \t characters
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.TabProxies.TupleProxy.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":353
- *             return r
- * 
- * def toDot(v):             # <<<<<<<<<<<<<<
- *     '''convert value to '.' if None'''
- *     if v is None:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_1toDot(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_toDot[] = "convert value to '.' if None";
-static PyMethodDef __pyx_mdef_5pysam_10TabProxies_1toDot = {__Pyx_NAMESTR("toDot"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_1toDot, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_toDot)};
-static PyObject *__pyx_pw_5pysam_10TabProxies_1toDot(PyObject *__pyx_self, PyObject *__pyx_v_v) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("toDot (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_toDot(__pyx_self, ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_toDot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("toDot", 0);
-
-  /* "pysam/TabProxies.pyx":355
- * def toDot(v):
- *     '''convert value to '.' if None'''
- *     if v is None:             # <<<<<<<<<<<<<<
- *         return "."
- *     else:
- */
-  __pyx_t_1 = (__pyx_v_v == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":356
- *     '''convert value to '.' if None'''
- *     if v is None:
- *         return "."             # <<<<<<<<<<<<<<
- *     else:
- *         return str(v)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_kp_s__10);
-    __pyx_r = __pyx_kp_s__10;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":358
- *         return "."
- *     else:
- *         return str(v)             # <<<<<<<<<<<<<<
- * 
- * def quote(v):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_v);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_v);
-    __Pyx_GIVEREF(__pyx_v_v);
-    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":353
- *             return r
- * 
- * def toDot(v):             # <<<<<<<<<<<<<<
- *     '''convert value to '.' if None'''
- *     if v is None:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.TabProxies.toDot", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":360
- *         return str(v)
- * 
- * def quote(v):             # <<<<<<<<<<<<<<
- *     '''return a quoted attribute.'''
- *     if type(v) in types.StringTypes:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_3quote(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_2quote[] = "return a quoted attribute.";
-static PyMethodDef __pyx_mdef_5pysam_10TabProxies_3quote = {__Pyx_NAMESTR("quote"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_3quote, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_2quote)};
-static PyObject *__pyx_pw_5pysam_10TabProxies_3quote(PyObject *__pyx_self, PyObject *__pyx_v_v) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("quote (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_2quote(__pyx_self, ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_2quote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("quote", 0);
-
-  /* "pysam/TabProxies.pyx":362
- * def quote(v):
- *     '''return a quoted attribute.'''
- *     if type(v) in types.StringTypes:             # <<<<<<<<<<<<<<
- *         return '"%s"' % v
- *     else:
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_StringTypes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = (__Pyx_PySequence_Contains(((PyObject *)Py_TYPE(__pyx_v_v)), __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = (__pyx_t_3 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/TabProxies.pyx":363
- *     '''return a quoted attribute.'''
- *     if type(v) in types.StringTypes:
- *         return '"%s"' % v             # <<<<<<<<<<<<<<
- *     else:
- *         return str(v)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":365
- *         return '"%s"' % v
- *     else:
- *         return str(v)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_v);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_v);
-    __Pyx_GIVEREF(__pyx_v_v);
-    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":360
- *         return str(v)
- * 
- * def quote(v):             # <<<<<<<<<<<<<<
- *     '''return a quoted attribute.'''
- *     if type(v) in types.StringTypes:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.quote", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":381
- *     '''
- * 
- *     def __cinit__(self):             # <<<<<<<<<<<<<<
- *         # automatically calls TupleProxy.__cinit__
- *         self.hasOwnAttributes = False
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
-  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy___cinit__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy___cinit__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-
-  /* "pysam/TabProxies.pyx":383
- *     def __cinit__(self):
- *         # automatically calls TupleProxy.__cinit__
- *         self.hasOwnAttributes = False             # <<<<<<<<<<<<<<
- *         self._attributes = NULL
- * 
- */
-  __pyx_v_self->hasOwnAttributes = 0;
-
-  /* "pysam/TabProxies.pyx":384
- *         # automatically calls TupleProxy.__cinit__
- *         self.hasOwnAttributes = False
- *         self._attributes = NULL             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-  __pyx_v_self->_attributes = NULL;
-
-  /* "pysam/TabProxies.pyx":381
- *     '''
- * 
- *     def __cinit__(self):             # <<<<<<<<<<<<<<
- *         # automatically calls TupleProxy.__cinit__
- *         self.hasOwnAttributes = False
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":386
- *         self._attributes = NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         # automatically calls TupleProxy.__dealloc__
- *         if self.hasOwnAttributes:
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_10TabProxies_8GTFProxy_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_10TabProxies_8GTFProxy_3__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_10TabProxies_8GTFProxy_2__dealloc__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_10TabProxies_8GTFProxy_2__dealloc__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-
-  /* "pysam/TabProxies.pyx":388
- *     def __dealloc__(self):
- *         # automatically calls TupleProxy.__dealloc__
- *         if self.hasOwnAttributes:             # <<<<<<<<<<<<<<
- *             free(self._attributes)
- * 
- */
-  __pyx_t_1 = (__pyx_v_self->hasOwnAttributes != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":389
- *         # automatically calls TupleProxy.__dealloc__
- *         if self.hasOwnAttributes:
- *             free(self._attributes)             # <<<<<<<<<<<<<<
- * 
- *     cdef int getMinFields(self):
- */
-    free(__pyx_v_self->_attributes);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":386
- *         self._attributes = NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         # automatically calls TupleProxy.__dealloc__
- *         if self.hasOwnAttributes:
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/TabProxies.pyx":391
- *             free(self._attributes)
- * 
- *     cdef int getMinFields(self):             # <<<<<<<<<<<<<<
- *         '''return minimum number of fields.'''
- *         return 3
- */
-
-static int __pyx_f_5pysam_10TabProxies_8GTFProxy_getMinFields(CYTHON_UNUSED struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getMinFields", 0);
-
-  /* "pysam/TabProxies.pyx":393
- *     cdef int getMinFields(self):
- *         '''return minimum number of fields.'''
- *         return 3             # <<<<<<<<<<<<<<
- * 
- *     cdef int getMaxFields(self):
- */
-  __pyx_r = 3;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":391
- *             free(self._attributes)
- * 
- *     cdef int getMinFields(self):             # <<<<<<<<<<<<<<
- *         '''return minimum number of fields.'''
- *         return 3
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":395
- *         return 3
- * 
- *     cdef int getMaxFields(self):             # <<<<<<<<<<<<<<
- *         '''return max number of fields.'''
- *         return 9
- */
-
-static int __pyx_f_5pysam_10TabProxies_8GTFProxy_getMaxFields(CYTHON_UNUSED struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getMaxFields", 0);
-
-  /* "pysam/TabProxies.pyx":397
- *     cdef int getMaxFields(self):
- *         '''return max number of fields.'''
- *         return 9             # <<<<<<<<<<<<<<
- * 
- *     property contig:
- */
-  __pyx_r = 9;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":395
- *         return 3
- * 
- *     cdef int getMaxFields(self):             # <<<<<<<<<<<<<<
- *         '''return max number of fields.'''
- *         return 9
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":401
- *     property contig:
- *        '''contig of feature.'''
- *        def __get__(self):             # <<<<<<<<<<<<<<
- *            return self._getindex(0)
- *        def __set__(self, value):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_6contig_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_6contig_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_6contig___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_6contig___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/TabProxies.pyx":402
- *        '''contig of feature.'''
- *        def __get__(self):
- *            return self._getindex(0)             # <<<<<<<<<<<<<<
- *        def __set__(self, value):
- *            self._setindex(0, value)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":401
- *     property contig:
- *        '''contig of feature.'''
- *        def __get__(self):             # <<<<<<<<<<<<<<
- *            return self._getindex(0)
- *        def __set__(self, value):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.contig.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":403
- *        def __get__(self):
- *            return self._getindex(0)
- *        def __set__(self, value):             # <<<<<<<<<<<<<<
- *            self._setindex(0, value)
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_6contig_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_6contig_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_6contig_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_6contig_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__set__", 0);
-
-  /* "pysam/TabProxies.pyx":404
- *            return self._getindex(0)
- *        def __set__(self, value):
- *            self._setindex(0, value)             # <<<<<<<<<<<<<<
- * 
- *     property source:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __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 = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/TabProxies.pyx":403
- *        def __get__(self):
- *            return self._getindex(0)
- *        def __set__(self, value):             # <<<<<<<<<<<<<<
- *            self._setindex(0, value)
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.contig.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":408
- *     property source:
- *        '''feature source.'''
- *        def __get__(self):             # <<<<<<<<<<<<<<
- *            return self._getindex(1)
- *        def __set__(self, value):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_6source_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_6source_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_6source___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_6source___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/TabProxies.pyx":409
- *        '''feature source.'''
- *        def __get__(self):
- *            return self._getindex(1)             # <<<<<<<<<<<<<<
- *        def __set__(self, value):
- *            self._setindex(1, value)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":408
- *     property source:
- *        '''feature source.'''
- *        def __get__(self):             # <<<<<<<<<<<<<<
- *            return self._getindex(1)
- *        def __set__(self, value):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.source.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":410
- *        def __get__(self):
- *            return self._getindex(1)
- *        def __set__(self, value):             # <<<<<<<<<<<<<<
- *            self._setindex(1, value)
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_6source_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_6source_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_6source_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_6source_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__set__", 0);
-
-  /* "pysam/TabProxies.pyx":411
- *            return self._getindex(1)
- *        def __set__(self, value):
- *            self._setindex(1, value)             # <<<<<<<<<<<<<<
- * 
- *     property feature:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __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 = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/TabProxies.pyx":410
- *        def __get__(self):
- *            return self._getindex(1)
- *        def __set__(self, value):             # <<<<<<<<<<<<<<
- *            self._setindex(1, value)
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.source.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":415
- *     property feature:
- *        '''feature name.'''
- *        def __get__( self ): return self._getindex( 2 )             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 2, value )
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_7feature_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_7feature_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_7feature___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_7feature___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.feature.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":416
- *        '''feature name.'''
- *        def __get__( self ): return self._getindex( 2 )
- *        def __set__( self, value ): self._setindex( 2, value )             # <<<<<<<<<<<<<<
- * 
- *     property start:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_7feature_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_7feature_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_7feature_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_7feature_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__set__", 0);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __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 = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_2);
-  __Pyx_GIVEREF(__pyx_int_2);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.feature.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":420
- *     property start:
- *        '''feature start (in 0-based open/closed coordinates).'''
- *        def __get__( self ): return int( self._getindex( 3 )) - 1             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 3, str(value+1) )
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_5start_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_5start_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_5start___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_5start___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); 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_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __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_Int(__pyx_t_2); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":421
- *        '''feature start (in 0-based open/closed coordinates).'''
- *        def __get__( self ): return int( self._getindex( 3 )) - 1
- *        def __set__( self, value ): self._setindex( 3, str(value+1) )             # <<<<<<<<<<<<<<
- * 
- *     property end:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_5start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_5start_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_5start_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__set__", 0);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyNumber_Add(__pyx_v_value, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_3);
-  __Pyx_GIVEREF(__pyx_int_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":425
- *     property end:
- *        '''feature end (in 0-based open/closed coordinates).'''
- *        def __get__( self ): return int( self._getindex( 4 ) )             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 4, str(value) )
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_3end_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_3end_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_3end___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_3end___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":426
- *        '''feature end (in 0-based open/closed coordinates).'''
- *        def __get__( self ): return int( self._getindex( 4 ) )
- *        def __set__( self, value ): self._setindex( 4, str(value) )             # <<<<<<<<<<<<<<
- * 
- *     property score:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_3end_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_3end_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_3end_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__set__", 0);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_4);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_4);
-  __Pyx_GIVEREF(__pyx_int_4);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.end.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":430
- *     property score:
- *        '''feature score.'''
- *        def __get__( self ):             # <<<<<<<<<<<<<<
- *            v = self._getindex(5)
- *            if v == "" or v[0] == '.':
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_5score_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_5score_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_5score___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_5score___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_v_v = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  double __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/TabProxies.pyx":431
- *        '''feature score.'''
- *        def __get__( self ):
- *            v = self._getindex(5)             # <<<<<<<<<<<<<<
- *            if v == "" or v[0] == '.':
- *                return None
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_v = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":432
- *        def __get__( self ):
- *            v = self._getindex(5)
- *            if v == "" or v[0] == '.':             # <<<<<<<<<<<<<<
- *                return None
- *            else:
- */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_v, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_3) {
-    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__10, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_5 = __pyx_t_4;
-  } else {
-    __pyx_t_5 = __pyx_t_3;
-  }
-  if (__pyx_t_5) {
-
-    /* "pysam/TabProxies.pyx":433
- *            v = self._getindex(5)
- *            if v == "" or v[0] == '.':
- *                return None             # <<<<<<<<<<<<<<
- *            else:
- *                return float(v)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":435
- *                return None
- *            else:
- *                return float(v)             # <<<<<<<<<<<<<<
- * 
- *        def __set__( self, value ): self._setindex( 5, value )
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_v_v); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_2 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":430
- *     property score:
- *        '''feature score.'''
- *        def __get__( self ):             # <<<<<<<<<<<<<<
- *            v = self._getindex(5)
- *            if v == "" or v[0] == '.':
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.score.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_v);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":437
- *                return float(v)
- * 
- *        def __set__( self, value ): self._setindex( 5, value )             # <<<<<<<<<<<<<<
- * 
- *     property strand:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_5score_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_5score_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_5score_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_5score_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__set__", 0);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __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 = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_5);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_5);
-  __Pyx_GIVEREF(__pyx_int_5);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.score.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":441
- *     property strand:
- *        '''feature strand.'''
- *        def __get__( self ): return self._getindex( 6 )             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 6, value )
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_6strand_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_6strand_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_6strand___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_6strand___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); 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_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.strand.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":442
- *        '''feature strand.'''
- *        def __get__( self ): return self._getindex( 6 )
- *        def __set__( self, value ): self._setindex( 6, value )             # <<<<<<<<<<<<<<
- * 
- *     property frame:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_6strand_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_6strand_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_6strand_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_6strand_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__set__", 0);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __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 = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_6);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_6);
-  __Pyx_GIVEREF(__pyx_int_6);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.strand.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":446
- *     property frame:
- *        '''feature frame.'''
- *        def __get__( self ): return self._getindex( 7 )             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 7, value )
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_5frame_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_5frame_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_5frame___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_5frame___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); 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);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.frame.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":447
- *        '''feature frame.'''
- *        def __get__( self ): return self._getindex( 7 )
- *        def __set__( self, value ): self._setindex( 7, value )             # <<<<<<<<<<<<<<
- * 
- *     property attributes:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_5frame_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_5frame_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_5frame_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_5frame_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__set__", 0);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __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 = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_7);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_7);
-  __Pyx_GIVEREF(__pyx_int_7);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.frame.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":451
- *     property attributes:
- *        '''feature attributes (as a string).'''
- *        def __get__( self ):             # <<<<<<<<<<<<<<
- *            if self.hasOwnAttributes:
- *                return self._attributes
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_10attributes_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_10attributes_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_10attributes___get__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_10attributes___get__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/TabProxies.pyx":452
- *        '''feature attributes (as a string).'''
- *        def __get__( self ):
- *            if self.hasOwnAttributes:             # <<<<<<<<<<<<<<
- *                return self._attributes
- *            else:
- */
-  __pyx_t_1 = (__pyx_v_self->hasOwnAttributes != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":453
- *        def __get__( self ):
- *            if self.hasOwnAttributes:
- *                return self._attributes             # <<<<<<<<<<<<<<
- *            else:
- *                return self._getindex(8)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_attributes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":455
- *                return self._attributes
- *            else:
- *                return self._getindex(8)             # <<<<<<<<<<<<<<
- *        def __set__( self, value ):
- *            if self.hasOwnAttributes:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getindex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":451
- *     property attributes:
- *        '''feature attributes (as a string).'''
- *        def __get__( self ):             # <<<<<<<<<<<<<<
- *            if self.hasOwnAttributes:
- *                return self._attributes
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.attributes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":456
- *            else:
- *                return self._getindex(8)
- *        def __set__( self, value ):             # <<<<<<<<<<<<<<
- *            if self.hasOwnAttributes:
- *                free(self._attributes)
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_10attributes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8GTFProxy_10attributes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_10attributes_2__set__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8GTFProxy_10attributes_2__set__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__set__", 0);
-
-  /* "pysam/TabProxies.pyx":457
- *                return self._getindex(8)
- *        def __set__( self, value ):
- *            if self.hasOwnAttributes:             # <<<<<<<<<<<<<<
- *                free(self._attributes)
- *                self._attributes = NULL
- */
-  __pyx_t_1 = (__pyx_v_self->hasOwnAttributes != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":458
- *        def __set__( self, value ):
- *            if self.hasOwnAttributes:
- *                free(self._attributes)             # <<<<<<<<<<<<<<
- *                self._attributes = NULL
- *                self.hasOwnAttributes = False
- */
-    free(__pyx_v_self->_attributes);
-
-    /* "pysam/TabProxies.pyx":459
- *            if self.hasOwnAttributes:
- *                free(self._attributes)
- *                self._attributes = NULL             # <<<<<<<<<<<<<<
- *                self.hasOwnAttributes = False
- *            self._setindex(8, value )
- */
-    __pyx_v_self->_attributes = NULL;
-
-    /* "pysam/TabProxies.pyx":460
- *                free(self._attributes)
- *                self._attributes = NULL
- *                self.hasOwnAttributes = False             # <<<<<<<<<<<<<<
- *            self._setindex(8, value )
- * 
- */
-    __pyx_v_self->hasOwnAttributes = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":461
- *                self._attributes = NULL
- *                self.hasOwnAttributes = False
- *            self._setindex(8, value )             # <<<<<<<<<<<<<<
- * 
- *     cdef char * getAttributes(self):
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setindex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_8);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_8);
-  __Pyx_GIVEREF(__pyx_int_8);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/TabProxies.pyx":456
- *            else:
- *                return self._getindex(8)
- *        def __set__( self, value ):             # <<<<<<<<<<<<<<
- *            if self.hasOwnAttributes:
- *                free(self._attributes)
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.attributes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":463
- *            self._setindex(8, value )
- * 
- *     cdef char * getAttributes(self):             # <<<<<<<<<<<<<<
- *        '''return pointer to attributes.'''
- *        if self.hasOwnAttributes:
- */
-
-static char *__pyx_f_5pysam_10TabProxies_8GTFProxy_getAttributes(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  char *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("getAttributes", 0);
-
-  /* "pysam/TabProxies.pyx":465
- *     cdef char * getAttributes(self):
- *        '''return pointer to attributes.'''
- *        if self.hasOwnAttributes:             # <<<<<<<<<<<<<<
- *            return self._attributes
- *        else:
- */
-  __pyx_t_1 = (__pyx_v_self->hasOwnAttributes != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":466
- *        '''return pointer to attributes.'''
- *        if self.hasOwnAttributes:
- *            return self._attributes             # <<<<<<<<<<<<<<
- *        else:
- *            return self.fields[8]
- */
-    __pyx_r = __pyx_v_self->_attributes;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":468
- *            return self._attributes
- *        else:
- *            return self.fields[8]             # <<<<<<<<<<<<<<
- * 
- *     def asDict( self ):
- */
-    __pyx_r = (__pyx_v_self->__pyx_base.fields[8]);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":463
- *            self._setindex(8, value )
- * 
- *     cdef char * getAttributes(self):             # <<<<<<<<<<<<<<
- *        '''return pointer to attributes.'''
- *        if self.hasOwnAttributes:
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":470
- *            return self.fields[8]
- * 
- *     def asDict( self ):             # <<<<<<<<<<<<<<
- *         """parse attributes - return as dict
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_5asDict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8GTFProxy_4asDict[] = "parse attributes - return as dict\n        ";
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_5asDict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("asDict (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_4asDict(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_4asDict(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_v_attributes = NULL;
-  PyObject *__pyx_v_fields = NULL;
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_v_f = NULL;
-  PyObject *__pyx_v_d = NULL;
-  PyObject *__pyx_v_n = NULL;
-  PyObject *__pyx_v_v = NULL;
-  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)(PyObject *);
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  Py_ssize_t __pyx_t_9;
-  int __pyx_t_10;
-  int __pyx_t_11;
-  int __pyx_t_12;
-  PyObject *__pyx_t_13 = NULL;
-  PyObject *__pyx_t_14 = NULL;
-  PyObject *__pyx_t_15 = NULL;
-  double __pyx_t_16;
-  int __pyx_t_17;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("asDict", 0);
-
-  /* "pysam/TabProxies.pyx":475
- * 
- *         # remove comments
- *         attributes = self.attributes             # <<<<<<<<<<<<<<
- * 
- *         # separate into fields
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_attributes = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":478
- * 
- *         # separate into fields
- *         fields = [x.strip() for x in attributes.split(";")[:-1]]             # <<<<<<<<<<<<<<
- * 
- *         result = {}
- */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_attributes, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, -1, NULL, NULL, &__pyx_slice__22, 0, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
-    __pyx_t_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 = 478; __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;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
-      if (unlikely(!__pyx_t_2)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_2);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __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_v_fields = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":480
- *         fields = [x.strip() for x in attributes.split(";")[:-1]]
- * 
- *         result = {}             # <<<<<<<<<<<<<<
- * 
- *         for f in fields:
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_result = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":482
- *         result = {}
- * 
- *         for f in fields:             # <<<<<<<<<<<<<<
- *             # split at most once in order to avoid separating
- *             # multi-word values
- */
-  __pyx_t_1 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
-  for (;;) {
-    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #else
-    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #endif
-    __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_3);
-    __pyx_t_3 = 0;
-
-    /* "pysam/TabProxies.pyx":485
- *             # split at most once in order to avoid separating
- *             # multi-word values
- *             d = [x.strip() for x in string.split(f, " ", maxsplit=1)]             # <<<<<<<<<<<<<<
- * 
- *             n,v = d[0], d[1]
- */
-    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_string); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_INCREF(__pyx_v_f);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_f);
-    __Pyx_GIVEREF(__pyx_v_f);
-    __Pyx_INCREF(__pyx_kp_s__23);
-    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_s__23);
-    __Pyx_GIVEREF(__pyx_kp_s__23);
-    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_maxsplit, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
-      __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_9 = 0;
-      __pyx_t_5 = NULL;
-    } else {
-      __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext;
-    }
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    for (;;) {
-      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_7)) {
-        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_7)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_7)) {
-        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_8 = __pyx_t_5(__pyx_t_7);
-        if (unlikely(!__pyx_t_8)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_8);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8);
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_d, ((PyObject*)__pyx_t_3));
-    __pyx_t_3 = 0;
-
-    /* "pysam/TabProxies.pyx":487
- *             d = [x.strip() for x in string.split(f, " ", maxsplit=1)]
- * 
- *             n,v = d[0], d[1]             # <<<<<<<<<<<<<<
- *             if len(d) > 2:
- *                 v = d[1:]
- */
-    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_d, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
-    __pyx_t_7 = 0;
-
-    /* "pysam/TabProxies.pyx":488
- * 
- *             n,v = d[0], d[1]
- *             if len(d) > 2:             # <<<<<<<<<<<<<<
- *                 v = d[1:]
- * 
- */
-    __pyx_t_9 = PyList_GET_SIZE(__pyx_v_d); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_10 = ((__pyx_t_9 > 2) != 0);
-    if (__pyx_t_10) {
-
-      /* "pysam/TabProxies.pyx":489
- *             n,v = d[0], d[1]
- *             if len(d) > 2:
- *                 v = d[1:]             # <<<<<<<<<<<<<<
- * 
- *             if v[0] == '"' and v[-1] == '"':
- */
-      __pyx_t_7 = __Pyx_PyList_GetSlice(__pyx_v_d, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_7);
-      __pyx_t_7 = 0;
-      goto __pyx_L9;
-    }
-    __pyx_L9:;
-
-    /* "pysam/TabProxies.pyx":491
- *                 v = d[1:]
- * 
- *             if v[0] == '"' and v[-1] == '"':             # <<<<<<<<<<<<<<
- *                 v = v[1:-1]
- *             else:
- */
-    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_v, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_kp_s__24, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (__pyx_t_10) {
-      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_v, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_kp_s__24, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_12 = __pyx_t_11;
-    } else {
-      __pyx_t_12 = __pyx_t_10;
-    }
-    if (__pyx_t_12) {
-
-      /* "pysam/TabProxies.pyx":492
- * 
- *             if v[0] == '"' and v[-1] == '"':
- *                 v = v[1:-1]             # <<<<<<<<<<<<<<
- *             else:
- *                 ## try to convert to a value
- */
-      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_v, 1, -1, NULL, NULL, &__pyx_slice__25, 1, 1, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_7);
-      __pyx_t_7 = 0;
-      goto __pyx_L10;
-    }
-    /*else*/ {
-
-      /* "pysam/TabProxies.pyx":495
- *             else:
- *                 ## try to convert to a value
- *                 try:             # <<<<<<<<<<<<<<
- *                     v = float(v)
- *                     v = int(v)
- */
-      {
-        __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
-        __Pyx_XGOTREF(__pyx_t_13);
-        __Pyx_XGOTREF(__pyx_t_14);
-        __Pyx_XGOTREF(__pyx_t_15);
-        /*try:*/ {
-
-          /* "pysam/TabProxies.pyx":496
- *                 ## try to convert to a value
- *                 try:
- *                     v = float(v)             # <<<<<<<<<<<<<<
- *                     v = int(v)
- *                 except ValueError:
- */
-          __pyx_t_16 = __Pyx_PyObject_AsDouble(__pyx_v_v); if (unlikely(__pyx_t_16 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
-          __pyx_t_7 = PyFloat_FromDouble(__pyx_t_16); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_7);
-          __pyx_t_7 = 0;
-
-          /* "pysam/TabProxies.pyx":497
- *                 try:
- *                     v = float(v)
- *                     v = int(v)             # <<<<<<<<<<<<<<
- *                 except ValueError:
- *                     pass
- */
-          __pyx_t_7 = PyNumber_Int(__pyx_v_v); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_7);
-          __pyx_t_7 = 0;
-        }
-        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
-        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
-        goto __pyx_L18_try_end;
-        __pyx_L11_error:;
-        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-        /* "pysam/TabProxies.pyx":498
- *                     v = float(v)
- *                     v = int(v)
- *                 except ValueError:             # <<<<<<<<<<<<<<
- *                     pass
- *                 except TypeError:
- */
-        __pyx_t_17 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-        if (__pyx_t_17) {
-          PyErr_Restore(0,0,0);
-          goto __pyx_L12_exception_handled;
-        }
-
-        /* "pysam/TabProxies.pyx":500
- *                 except ValueError:
- *                     pass
- *                 except TypeError:             # <<<<<<<<<<<<<<
- *                     pass
- * 
- */
-        __pyx_t_17 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
-        if (__pyx_t_17) {
-          PyErr_Restore(0,0,0);
-          goto __pyx_L12_exception_handled;
-        }
-        goto __pyx_L13_except_error;
-        __pyx_L13_except_error:;
-        __Pyx_XGIVEREF(__pyx_t_13);
-        __Pyx_XGIVEREF(__pyx_t_14);
-        __Pyx_XGIVEREF(__pyx_t_15);
-        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
-        goto __pyx_L1_error;
-        __pyx_L12_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_13);
-        __Pyx_XGIVEREF(__pyx_t_14);
-        __Pyx_XGIVEREF(__pyx_t_15);
-        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
-        __pyx_L18_try_end:;
-      }
-    }
-    __pyx_L10:;
-
-    /* "pysam/TabProxies.pyx":503
- *                     pass
- * 
- *             result[n] = v             # <<<<<<<<<<<<<<
- * 
- *         return result
- */
-    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_n, __pyx_v_v) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":505
- *             result[n] = v
- * 
- *         return result             # <<<<<<<<<<<<<<
- * 
- *     def fromDict(self, d):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":470
- *            return self.fields[8]
- * 
- *     def asDict( self ):             # <<<<<<<<<<<<<<
- *         """parse attributes - return as dict
- *         """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.asDict", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_attributes);
-  __Pyx_XDECREF(__pyx_v_fields);
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_XDECREF(__pyx_v_d);
-  __Pyx_XDECREF(__pyx_v_n);
-  __Pyx_XDECREF(__pyx_v_v);
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":507
- *         return result
- * 
- *     def fromDict(self, d):             # <<<<<<<<<<<<<<
- *         '''set attributes from a dictionary.'''
- *         cdef char * p
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_7fromDict(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8GTFProxy_6fromDict[] = "set attributes from a dictionary.";
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_7fromDict(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("fromDict (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_6fromDict(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_d));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_6fromDict(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_d) {
-  char *__pyx_v_p;
-  int __pyx_v_l;
-  PyObject *__pyx_v_aa = NULL;
-  PyObject *__pyx_v_k = NULL;
-  PyObject *__pyx_v_v = NULL;
-  PyObject *__pyx_v_a = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  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;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *(*__pyx_t_9)(PyObject *);
-  int __pyx_t_10;
-  int __pyx_t_11;
-  char *__pyx_t_12;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("fromDict", 0);
-
-  /* "pysam/TabProxies.pyx":513
- * 
- *         # clean up if this field is set twice
- *         if self.hasOwnAttributes:             # <<<<<<<<<<<<<<
- *             free(self._attributes)
- * 
- */
-  __pyx_t_1 = (__pyx_v_self->hasOwnAttributes != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":514
- *         # clean up if this field is set twice
- *         if self.hasOwnAttributes:
- *             free(self._attributes)             # <<<<<<<<<<<<<<
- * 
- *         aa = []
- */
-    free(__pyx_v_self->_attributes);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":516
- *             free(self._attributes)
- * 
- *         aa = []             # <<<<<<<<<<<<<<
- *         for k,v in d.items():
- *             if type(v) in types.StringTypes:
- */
-  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_aa = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":517
- * 
- *         aa = []
- *         for k,v in d.items():             # <<<<<<<<<<<<<<
- *             if type(v) in types.StringTypes:
- *                 aa.append( '%s "%s"' % (k,v) )
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
-    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  for (;;) {
-    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
-      if (unlikely(!__pyx_t_3)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_3);
-    }
-    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
-      PyObject* sequence = __pyx_t_3;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 2)) {
-        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
-      } else {
-        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
-      }
-      __Pyx_INCREF(__pyx_t_6);
-      __Pyx_INCREF(__pyx_t_7);
-      #else
-      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      #endif
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_6);
-      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L7_unpacking_done;
-      __pyx_L6_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L7_unpacking_done:;
-    }
-    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
-    __pyx_t_6 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
-    __pyx_t_7 = 0;
-
-    /* "pysam/TabProxies.pyx":518
- *         aa = []
- *         for k,v in d.items():
- *             if type(v) in types.StringTypes:             # <<<<<<<<<<<<<<
- *                 aa.append( '%s "%s"' % (k,v) )
- *             else:
- */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_StringTypes); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)Py_TYPE(__pyx_v_v)), __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_10 = (__pyx_t_1 != 0);
-    if (__pyx_t_10) {
-
-      /* "pysam/TabProxies.pyx":519
- *         for k,v in d.items():
- *             if type(v) in types.StringTypes:
- *                 aa.append( '%s "%s"' % (k,v) )             # <<<<<<<<<<<<<<
- *             else:
- *                 aa.append( '%s %s' % (k,str(v)) )
- */
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_v_k);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_k);
-      __Pyx_GIVEREF(__pyx_v_k);
-      __Pyx_INCREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_v);
-      __Pyx_GIVEREF(__pyx_v_v);
-      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_aa, __pyx_t_3); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      goto __pyx_L8;
-    }
-    /*else*/ {
-
-      /* "pysam/TabProxies.pyx":521
- *                 aa.append( '%s "%s"' % (k,v) )
- *             else:
- *                 aa.append( '%s %s' % (k,str(v)) )             # <<<<<<<<<<<<<<
- * 
- *         a = "; ".join( aa ) + ";"
- */
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_v);
-      __Pyx_GIVEREF(__pyx_v_v);
-      __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_v_k);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_k);
-      __Pyx_GIVEREF(__pyx_v_k);
-      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_aa, __pyx_t_7); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    }
-    __pyx_L8:;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":523
- *                 aa.append( '%s %s' % (k,str(v)) )
- * 
- *         a = "; ".join( aa ) + ";"             # <<<<<<<<<<<<<<
- *         p = a
- *         l = len(a)
- */
-  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__26, __pyx_v_aa); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__20); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_a = ((PyObject*)__pyx_t_7);
-  __pyx_t_7 = 0;
-
-  /* "pysam/TabProxies.pyx":524
- * 
- *         a = "; ".join( aa ) + ";"
- *         p = a             # <<<<<<<<<<<<<<
- *         l = len(a)
- *         self._attributes = <char *>calloc( l + 1, sizeof(char) )
- */
-  __pyx_t_12 = __Pyx_PyObject_AsString(__pyx_v_a); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_p = __pyx_t_12;
-
-  /* "pysam/TabProxies.pyx":525
- *         a = "; ".join( aa ) + ";"
- *         p = a
- *         l = len(a)             # <<<<<<<<<<<<<<
- *         self._attributes = <char *>calloc( l + 1, sizeof(char) )
- *         if self._attributes == NULL:
- */
-  __pyx_t_4 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_l = __pyx_t_4;
-
-  /* "pysam/TabProxies.pyx":526
- *         p = a
- *         l = len(a)
- *         self._attributes = <char *>calloc( l + 1, sizeof(char) )             # <<<<<<<<<<<<<<
- *         if self._attributes == NULL:
- *             raise ValueError("out of memory" )
- */
-  __pyx_v_self->_attributes = ((char *)calloc((__pyx_v_l + 1), (sizeof(char))));
-
-  /* "pysam/TabProxies.pyx":527
- *         l = len(a)
- *         self._attributes = <char *>calloc( l + 1, sizeof(char) )
- *         if self._attributes == NULL:             # <<<<<<<<<<<<<<
- *             raise ValueError("out of memory" )
- *         memcpy( self._attributes, p, l )
- */
-  __pyx_t_10 = ((__pyx_v_self->_attributes == NULL) != 0);
-  if (__pyx_t_10) {
-
-    /* "pysam/TabProxies.pyx":528
- *         self._attributes = <char *>calloc( l + 1, sizeof(char) )
- *         if self._attributes == NULL:
- *             raise ValueError("out of memory" )             # <<<<<<<<<<<<<<
- *         memcpy( self._attributes, p, l )
- * 
- */
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":529
- *         if self._attributes == NULL:
- *             raise ValueError("out of memory" )
- *         memcpy( self._attributes, p, l )             # <<<<<<<<<<<<<<
- * 
- *         self.hasOwnAttributes = True
- */
-  memcpy(__pyx_v_self->_attributes, __pyx_v_p, __pyx_v_l);
-
-  /* "pysam/TabProxies.pyx":531
- *         memcpy( self._attributes, p, l )
- * 
- *         self.hasOwnAttributes = True             # <<<<<<<<<<<<<<
- *         self.is_modified = True
- * 
- */
-  __pyx_v_self->hasOwnAttributes = 1;
-
-  /* "pysam/TabProxies.pyx":532
- * 
- *         self.hasOwnAttributes = True
- *         self.is_modified = True             # <<<<<<<<<<<<<<
- * 
- *     def __str__(self):
- */
-  __pyx_v_self->__pyx_base.is_modified = 1;
-
-  /* "pysam/TabProxies.pyx":507
- *         return result
- * 
- *     def fromDict(self, d):             # <<<<<<<<<<<<<<
- *         '''set attributes from a dictionary.'''
- *         cdef char * p
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.fromDict", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_aa);
-  __Pyx_XDECREF(__pyx_v_k);
-  __Pyx_XDECREF(__pyx_v_v);
-  __Pyx_XDECREF(__pyx_v_a);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":534
- *         self.is_modified = True
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         cdef char * cpy
- *         cdef int x
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_9__str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_9__str__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_8__str__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_8__str__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__str__", 0);
-
-  /* "pysam/TabProxies.pyx":538
- *         cdef int x
- * 
- *         if self.is_modified:             # <<<<<<<<<<<<<<
- *             return "\t".join(
- *                 (self.contig,
- */
-  __pyx_t_1 = (__pyx_v_self->__pyx_base.is_modified != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":539
- * 
- *         if self.is_modified:
- *             return "\t".join(             # <<<<<<<<<<<<<<
- *                 (self.contig,
- *                  self.source,
- */
-    __Pyx_XDECREF(__pyx_r);
-
-    /* "pysam/TabProxies.pyx":540
- *         if self.is_modified:
- *             return "\t".join(
- *                 (self.contig,             # <<<<<<<<<<<<<<
- *                  self.source,
- *                  self.feature,
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_contig); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-
-    /* "pysam/TabProxies.pyx":541
- *             return "\t".join(
- *                 (self.contig,
- *                  self.source,             # <<<<<<<<<<<<<<
- *                  self.feature,
- *                  str(self.start+1),
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_source); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-
-    /* "pysam/TabProxies.pyx":542
- *                 (self.contig,
- *                  self.source,
- *                  self.feature,             # <<<<<<<<<<<<<<
- *                  str(self.start+1),
- *                  str(self.end),
- */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_feature); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-
-    /* "pysam/TabProxies.pyx":543
- *                  self.source,
- *                  self.feature,
- *                  str(self.start+1),             # <<<<<<<<<<<<<<
- *                  str(self.end),
- *                  toDot(self.score),
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __pyx_t_6 = 0;
-    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-    /* "pysam/TabProxies.pyx":544
- *                  self.feature,
- *                  str(self.start+1),
- *                  str(self.end),             # <<<<<<<<<<<<<<
- *                  toDot(self.score),
- *                  self.strand,
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-    /* "pysam/TabProxies.pyx":545
- *                  str(self.start+1),
- *                  str(self.end),
- *                  toDot(self.score),             # <<<<<<<<<<<<<<
- *                  self.strand,
- *                  self.frame,
- */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_toDot); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_score); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    __pyx_t_8 = 0;
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-    /* "pysam/TabProxies.pyx":546
- *                  str(self.end),
- *                  toDot(self.score),
- *                  self.strand,             # <<<<<<<<<<<<<<
- *                  self.frame,
- *                  self.attributes ) )
- */
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-
-    /* "pysam/TabProxies.pyx":547
- *                  toDot(self.score),
- *                  self.strand,
- *                  self.frame,             # <<<<<<<<<<<<<<
- *                  self.attributes ) )
- *         else:
- */
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_frame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-
-    /* "pysam/TabProxies.pyx":548
- *                  self.strand,
- *                  self.frame,
- *                  self.attributes ) )             # <<<<<<<<<<<<<<
- *         else:
- *             return TupleProxy.__str__(self)
- */
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-
-    /* "pysam/TabProxies.pyx":540
- *         if self.is_modified:
- *             return "\t".join(
- *                 (self.contig,             # <<<<<<<<<<<<<<
- *                  self.source,
- *                  self.feature,
- */
-    __pyx_t_11 = PyTuple_New(9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_t_10);
-    __Pyx_GIVEREF(__pyx_t_10);
-    __pyx_t_2 = 0;
-    __pyx_t_3 = 0;
-    __pyx_t_4 = 0;
-    __pyx_t_6 = 0;
-    __pyx_t_5 = 0;
-    __pyx_t_8 = 0;
-    __pyx_t_9 = 0;
-    __pyx_t_7 = 0;
-    __pyx_t_10 = 0;
-
-    /* "pysam/TabProxies.pyx":539
- * 
- *         if self.is_modified:
- *             return "\t".join(             # <<<<<<<<<<<<<<
- *                 (self.contig,
- *                  self.source,
- */
-    __pyx_t_10 = __Pyx_PyString_Join(__pyx_kp_s__8, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_r = __pyx_t_10;
-    __pyx_t_10 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":550
- *                  self.attributes ) )
- *         else:
- *             return TupleProxy.__str__(self)             # <<<<<<<<<<<<<<
- * 
- *     def invert(self, int lcontig):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_TupleProxy)), __pyx_n_s_str); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_INCREF(((PyObject *)__pyx_v_self));
-    PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_v_self));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_r = __pyx_t_7;
-    __pyx_t_7 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":534
- *         self.is_modified = True
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         cdef char * cpy
- *         cdef int x
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":552
- *             return TupleProxy.__str__(self)
- * 
- *     def invert(self, int lcontig):             # <<<<<<<<<<<<<<
- *         '''invert coordinates to negative strand coordinates
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_11invert(PyObject *__pyx_v_self, PyObject *__pyx_arg_lcontig); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8GTFProxy_10invert[] = "invert coordinates to negative strand coordinates\n        \n        This method will only act if the feature is on the\n        negative strand.";
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_11invert(PyObject *__pyx_v_self, PyObject *__pyx_arg_lcontig) {
-  int __pyx_v_lcontig;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("invert (wrapper)", 0);
-  assert(__pyx_arg_lcontig); {
-    __pyx_v_lcontig = __Pyx_PyInt_As_int(__pyx_arg_lcontig); if (unlikely((__pyx_v_lcontig == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.invert", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_10invert(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((int)__pyx_v_lcontig));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_10invert(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, int __pyx_v_lcontig) {
-  PyObject *__pyx_v_start = NULL;
-  PyObject *__pyx_v_end = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("invert", 0);
-
-  /* "pysam/TabProxies.pyx":558
- *         negative strand.'''
- * 
- *         if self.strand[0] == '-':             # <<<<<<<<<<<<<<
- *             start = min(self.start, self.end)
- *             end = max(self.start, self.end)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_strand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__28, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
-
-    /* "pysam/TabProxies.pyx":559
- * 
- *         if self.strand[0] == '-':
- *             start = min(self.start, self.end)             # <<<<<<<<<<<<<<
- *             end = max(self.start, self.end)
- *             self.start, self.end = lcontig - end, lcontig - start
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_3) {
-      __Pyx_INCREF(__pyx_t_2);
-      __pyx_t_4 = __pyx_t_2;
-    } else {
-      __Pyx_INCREF(__pyx_t_1);
-      __pyx_t_4 = __pyx_t_1;
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __pyx_t_4;
-    __Pyx_INCREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_v_start = __pyx_t_2;
-    __pyx_t_2 = 0;
-
-    /* "pysam/TabProxies.pyx":560
- *         if self.strand[0] == '-':
- *             start = min(self.start, self.end)
- *             end = max(self.start, self.end)             # <<<<<<<<<<<<<<
- *             self.start, self.end = lcontig - end, lcontig - start
- * 
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_3) {
-      __Pyx_INCREF(__pyx_t_2);
-      __pyx_t_1 = __pyx_t_2;
-    } else {
-      __Pyx_INCREF(__pyx_t_4);
-      __pyx_t_1 = __pyx_t_4;
-    }
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __pyx_t_1;
-    __Pyx_INCREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_end = __pyx_t_2;
-    __pyx_t_2 = 0;
-
-    /* "pysam/TabProxies.pyx":561
- *             start = min(self.start, self.end)
- *             end = max(self.start, self.end)
- *             self.start, self.end = lcontig - end, lcontig - start             # <<<<<<<<<<<<<<
- * 
- *     def keys( self ):
- */
-    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_lcontig); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_lcontig); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":552
- *             return TupleProxy.__str__(self)
- * 
- *     def invert(self, int lcontig):             # <<<<<<<<<<<<<<
- *         '''invert coordinates to negative strand coordinates
- * 
- */
-
-  /* function exit code */
-  __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_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.invert", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_start);
-  __Pyx_XDECREF(__pyx_v_end);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":563
- *             self.start, self.end = lcontig - end, lcontig - start
- * 
- *     def keys( self ):             # <<<<<<<<<<<<<<
- *         '''return a list of attributes defined in this entry.'''
- *         r = self.attributes
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_13keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8GTFProxy_12keys[] = "return a list of attributes defined in this entry.";
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_13keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("keys (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_12keys(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_12keys(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self) {
-  PyObject *__pyx_v_r = NULL;
-  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)(PyObject *);
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("keys", 0);
-
-  /* "pysam/TabProxies.pyx":565
- *     def keys( self ):
- *         '''return a list of attributes defined in this entry.'''
- *         r = self.attributes             # <<<<<<<<<<<<<<
- *         return [x.strip().split(" ")[0]
- *                 for x in r.split(";") if x.strip() != '']
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_attributes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":566
- *         '''return a list of attributes defined in this entry.'''
- *         r = self.attributes
- *         return [x.strip().split(" ")[0]             # <<<<<<<<<<<<<<
- *                 for x in r.split(";") if x.strip() != '']
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/TabProxies.pyx":567
- *         r = self.attributes
- *         return [x.strip().split(" ")[0]
- *                 for x in r.split(";") if x.strip() != '']             # <<<<<<<<<<<<<<
- * 
- *     def __getitem__(self, key):
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
-    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  for (;;) {
-    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
-      if (unlikely(!__pyx_t_3)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_3);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_kp_s_, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_7) {
-
-      /* "pysam/TabProxies.pyx":566
- *         '''return a list of attributes defined in this entry.'''
- *         r = self.attributes
- *         return [x.strip().split(" ")[0]             # <<<<<<<<<<<<<<
- *                 for x in r.split(";") if x.strip() != '']
- * 
- */
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_strip); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      goto __pyx_L5;
-    }
-    __pyx_L5:;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":563
- *             self.start, self.end = lcontig - end, lcontig - start
- * 
- *     def keys( self ):             # <<<<<<<<<<<<<<
- *         '''return a list of attributes defined in this entry.'''
- *         r = self.attributes
- */
-
-  /* function exit code */
-  __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("pysam.TabProxies.GTFProxy.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_r);
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":569
- *                 for x in r.split(";") if x.strip() != '']
- * 
- *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
- *         return self.__getattr__(key)
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_15__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_14__getitem__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_key));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_14__getitem__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_key) {
-  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_RefNannySetupContext("__getitem__", 0);
-
-  /* "pysam/TabProxies.pyx":570
- * 
- *     def __getitem__(self, key):
- *         return self.__getattr__(key)             # <<<<<<<<<<<<<<
- * 
- *     def __getattr__(self, item):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getattr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __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 = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_key);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
-  __Pyx_GIVEREF(__pyx_v_key);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":569
- *                 for x in r.split(";") if x.strip() != '']
- * 
- *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
- *         return self.__getattr__(key)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":572
- *         return self.__getattr__(key)
- * 
- *     def __getattr__(self, item):             # <<<<<<<<<<<<<<
- *         """Generic lookup of attribute from GFF/GTF attributes
- *         Only called if there *isn't* an attribute with this name
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_17__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8GTFProxy_16__getattr__[] = "Generic lookup of attribute from GFF/GTF attributes \n        Only called if there *isn't* an attribute with this name\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_10TabProxies_8GTFProxy_16__getattr__;
-#endif
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_17__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_16__getattr__(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_item));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_16__getattr__(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_item) {
-  char *__pyx_v_start;
-  char *__pyx_v_query;
-  char *__pyx_v_end;
-  int __pyx_v_l;
-  char *__pyx_v_attributes;
-  PyObject *__pyx_v_r = NULL;
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  char *__pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
-  struct __pyx_opt_args_5pysam_10TabProxies__force_str __pyx_t_8;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__getattr__", 0);
-
-  /* "pysam/TabProxies.pyx":595
- *         # disappeard after accessing the C data structures
- *         # directly and so did the bug.
- *         cdef char * attributes = self.getAttributes()             # <<<<<<<<<<<<<<
- * 
- *         # add space in order to make sure
- */
-  __pyx_v_attributes = ((struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->getAttributes(__pyx_v_self);
-
-  /* "pysam/TabProxies.pyx":599
- *         # add space in order to make sure
- *         # to not pick up a field that is a prefix of another field
- *         r = _force_bytes(item + " ")             # <<<<<<<<<<<<<<
- *         query = r
- *         start = strstr(attributes, query)
- */
-  __pyx_t_1 = PyNumber_Add(__pyx_v_item, __pyx_kp_s__23); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_5pysam_10TabProxies__force_bytes(__pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_r = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":600
- *         # to not pick up a field that is a prefix of another field
- *         r = _force_bytes(item + " ")
- *         query = r             # <<<<<<<<<<<<<<
- *         start = strstr(attributes, query)
- * 
- */
-  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_r); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_query = __pyx_t_3;
-
-  /* "pysam/TabProxies.pyx":601
- *         r = _force_bytes(item + " ")
- *         query = r
- *         start = strstr(attributes, query)             # <<<<<<<<<<<<<<
- * 
- *         if start == NULL:
- */
-  __pyx_v_start = strstr(__pyx_v_attributes, __pyx_v_query);
-
-  /* "pysam/TabProxies.pyx":603
- *         start = strstr(attributes, query)
- * 
- *         if start == NULL:             # <<<<<<<<<<<<<<
- *             raise AttributeError("'GTFProxy' has no attribute '%s'" % item)
- * 
- */
-  __pyx_t_4 = ((__pyx_v_start == NULL) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/TabProxies.pyx":604
- * 
- *         if start == NULL:
- *             raise AttributeError("'GTFProxy' has no attribute '%s'" % item)             # <<<<<<<<<<<<<<
- * 
- *         start += strlen(query)
- */
-    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_GTFProxy_has_no_attribute_s, __pyx_v_item); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":606
- *             raise AttributeError("'GTFProxy' has no attribute '%s'" % item)
- * 
- *         start += strlen(query)             # <<<<<<<<<<<<<<
- *         # skip gaps before
- *         while start[0] == ' ':
- */
-  __pyx_v_start = (__pyx_v_start + strlen(__pyx_v_query));
-
-  /* "pysam/TabProxies.pyx":608
- *         start += strlen(query)
- *         # skip gaps before
- *         while start[0] == ' ':             # <<<<<<<<<<<<<<
- *             start += 1
- * 
- */
-  while (1) {
-    __pyx_t_4 = (((__pyx_v_start[0]) == ' ') != 0);
-    if (!__pyx_t_4) break;
-
-    /* "pysam/TabProxies.pyx":609
- *         # skip gaps before
- *         while start[0] == ' ':
- *             start += 1             # <<<<<<<<<<<<<<
- * 
- *         if start[0] == '"':
- */
-    __pyx_v_start = (__pyx_v_start + 1);
-  }
-
-  /* "pysam/TabProxies.pyx":611
- *             start += 1
- * 
- *         if start[0] == '"':             # <<<<<<<<<<<<<<
- *             start += 1
- *             end = start
- */
-  __pyx_t_4 = (((__pyx_v_start[0]) == '"') != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/TabProxies.pyx":612
- * 
- *         if start[0] == '"':
- *             start += 1             # <<<<<<<<<<<<<<
- *             end = start
- *             while end[0] != '\0' and end[0] != '"':
- */
-    __pyx_v_start = (__pyx_v_start + 1);
-
-    /* "pysam/TabProxies.pyx":613
- *         if start[0] == '"':
- *             start += 1
- *             end = start             # <<<<<<<<<<<<<<
- *             while end[0] != '\0' and end[0] != '"':
- *                 end += 1
- */
-    __pyx_v_end = __pyx_v_start;
-
-    /* "pysam/TabProxies.pyx":614
- *             start += 1
- *             end = start
- *             while end[0] != '\0' and end[0] != '"':             # <<<<<<<<<<<<<<
- *                 end += 1
- *             l = end - start
- */
-    while (1) {
-      __pyx_t_4 = (((__pyx_v_end[0]) != '\x00') != 0);
-      if (__pyx_t_4) {
-        __pyx_t_5 = (((__pyx_v_end[0]) != '"') != 0);
-        __pyx_t_6 = __pyx_t_5;
-      } else {
-        __pyx_t_6 = __pyx_t_4;
-      }
-      if (!__pyx_t_6) break;
-
-      /* "pysam/TabProxies.pyx":615
- *             end = start
- *             while end[0] != '\0' and end[0] != '"':
- *                 end += 1             # <<<<<<<<<<<<<<
- *             l = end - start
- *             result = _force_str(PyBytes_FromStringAndSize(start, l),
- */
-      __pyx_v_end = (__pyx_v_end + 1);
-    }
-
-    /* "pysam/TabProxies.pyx":616
- *             while end[0] != '\0' and end[0] != '"':
- *                 end += 1
- *             l = end - start             # <<<<<<<<<<<<<<
- *             result = _force_str(PyBytes_FromStringAndSize(start, l),
- *                                 self.encoding)
- */
-    __pyx_v_l = (__pyx_v_end - __pyx_v_start);
-
-    /* "pysam/TabProxies.pyx":617
- *                 end += 1
- *             l = end - start
- *             result = _force_str(PyBytes_FromStringAndSize(start, l),             # <<<<<<<<<<<<<<
- *                                 self.encoding)
- *             return result
- */
-    __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_v_start, __pyx_v_l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-
-    /* "pysam/TabProxies.pyx":618
- *             l = end - start
- *             result = _force_str(PyBytes_FromStringAndSize(start, l),
- *                                 self.encoding)             # <<<<<<<<<<<<<<
- *             return result
- *         else:
- */
-    __pyx_t_1 = __pyx_v_self->__pyx_base.encoding;
-    __Pyx_INCREF(__pyx_t_1);
-
-    /* "pysam/TabProxies.pyx":617
- *                 end += 1
- *             l = end - start
- *             result = _force_str(PyBytes_FromStringAndSize(start, l),             # <<<<<<<<<<<<<<
- *                                 self.encoding)
- *             return result
- */
-    __pyx_t_8.__pyx_n = 1;
-    __pyx_t_8.encoding = __pyx_t_1;
-    __pyx_t_7 = __pyx_f_5pysam_10TabProxies__force_str(__pyx_t_2, &__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_result = __pyx_t_7;
-    __pyx_t_7 = 0;
-
-    /* "pysam/TabProxies.pyx":619
- *             result = _force_str(PyBytes_FromStringAndSize(start, l),
- *                                 self.encoding)
- *             return result             # <<<<<<<<<<<<<<
- *         else:
- *             return _force_str(start, self.encoding)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_result);
-    __pyx_r = __pyx_v_result;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/TabProxies.pyx":621
- *             return result
- *         else:
- *             return _force_str(start, self.encoding)             # <<<<<<<<<<<<<<
- * 
- *     def setAttribute(self, name, value):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_start); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_1 = __pyx_v_self->__pyx_base.encoding;
-    __Pyx_INCREF(__pyx_t_1);
-    __pyx_t_8.__pyx_n = 1;
-    __pyx_t_8.encoding = __pyx_t_1;
-    __pyx_t_2 = __pyx_f_5pysam_10TabProxies__force_str(__pyx_t_7, &__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":572
- *         return self.__getattr__(key)
- * 
- *     def __getattr__(self, item):             # <<<<<<<<<<<<<<
- *         """Generic lookup of attribute from GFF/GTF attributes
- *         Only called if there *isn't* an attribute with this name
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_r);
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":623
- *             return _force_str(start, self.encoding)
- * 
- *     def setAttribute(self, name, value):             # <<<<<<<<<<<<<<
- *         '''convenience method to set an attribute.'''
- *         r = self.asDict()
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_19setAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8GTFProxy_18setAttribute[] = "convenience method to set an attribute.";
-static PyObject *__pyx_pw_5pysam_10TabProxies_8GTFProxy_19setAttribute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_name = 0;
-  PyObject *__pyx_v_value = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setAttribute (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_value,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setAttribute", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAttribute") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __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_name = values[0];
-    __pyx_v_value = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setAttribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.TabProxies.GTFProxy.setAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8GTFProxy_18setAttribute(((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_v_self), __pyx_v_name, __pyx_v_value);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8GTFProxy_18setAttribute(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
-  PyObject *__pyx_v_r = NULL;
-  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_RefNannySetupContext("setAttribute", 0);
-
-  /* "pysam/TabProxies.pyx":625
- *     def setAttribute(self, name, value):
- *         '''convenience method to set an attribute.'''
- *         r = self.asDict()             # <<<<<<<<<<<<<<
- *         r[name] = value
- *         self.fromDict(r)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_asDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":626
- *         '''convenience method to set an attribute.'''
- *         r = self.asDict()
- *         r[name] = value             # <<<<<<<<<<<<<<
- *         self.fromDict(r)
- * 
- */
-  if (unlikely(PyObject_SetItem(__pyx_v_r, __pyx_v_name, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/TabProxies.pyx":627
- *         r = self.asDict()
- *         r[name] = value
- *         self.fromDict(r)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fromDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_r);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_r);
-  __Pyx_GIVEREF(__pyx_v_r);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/TabProxies.pyx":623
- *             return _force_str(start, self.encoding)
- * 
- *     def setAttribute(self, name, value):             # <<<<<<<<<<<<<<
- *         '''convenience method to set an attribute.'''
- *         r = self.asDict()
- */
-
-  /* function exit code */
-  __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("pysam.TabProxies.GTFProxy.setAttribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":634
- *     map_key2field = {}
- * 
- *     def __setattr__(self, key, value):             # <<<<<<<<<<<<<<
- *         '''set attribute.'''
- *         cdef int idx
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_15NamedTupleProxy_1__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_15NamedTupleProxy___setattr__[] = "set attribute.";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_10TabProxies_15NamedTupleProxy___setattr__;
-#endif
-static int __pyx_pw_5pysam_10TabProxies_15NamedTupleProxy_1__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_15NamedTupleProxy___setattr__(((struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_15NamedTupleProxy___setattr__(struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
-  int __pyx_v_idx;
-  CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *(*__pyx_t_5)(PyObject *);
-  int __pyx_t_6;
-  int __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__setattr__", 0);
-
-  /* "pysam/TabProxies.pyx":637
- *         '''set attribute.'''
- *         cdef int idx
- *         idx, f = self.map_key2field[key]             # <<<<<<<<<<<<<<
- *         if self.nfields < idx:
- *             raise KeyError("field %s not set" % key)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_key2field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
-    PyObject* sequence = __pyx_t_2;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 2)) {
-      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
-    } else {
-      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
-    }
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_t_3);
-    #else
-    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    #endif
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
-    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_1);
-    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = NULL;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    goto __pyx_L4_unpacking_done;
-    __pyx_L3_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L4_unpacking_done:;
-  }
-  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_idx = __pyx_t_6;
-  __pyx_v_f = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/TabProxies.pyx":638
- *         cdef int idx
- *         idx, f = self.map_key2field[key]
- *         if self.nfields < idx:             # <<<<<<<<<<<<<<
- *             raise KeyError("field %s not set" % key)
- *         TupleProxy.__setitem__(self, idx, str(value))
- */
-  __pyx_t_7 = ((__pyx_v_self->__pyx_base.nfields < __pyx_v_idx) != 0);
-  if (__pyx_t_7) {
-
-    /* "pysam/TabProxies.pyx":639
- *         idx, f = self.map_key2field[key]
- *         if self.nfields < idx:
- *             raise KeyError("field %s not set" % key)             # <<<<<<<<<<<<<<
- *         TupleProxy.__setitem__(self, idx, str(value))
- * 
- */
-    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_field_s_not_set, __pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":640
- *         if self.nfields < idx:
- *             raise KeyError("field %s not set" % key)
- *         TupleProxy.__setitem__(self, idx, str(value))             # <<<<<<<<<<<<<<
- * 
- *     def __getattr__(self, key):
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_TupleProxy)), __pyx_n_s_setitem); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/TabProxies.pyx":634
- *     map_key2field = {}
- * 
- *     def __setattr__(self, key, value):             # <<<<<<<<<<<<<<
- *         '''set attribute.'''
- *         cdef int idx
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.TabProxies.NamedTupleProxy.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":642
- *         TupleProxy.__setitem__(self, idx, str(value))
- * 
- *     def __getattr__(self, key):             # <<<<<<<<<<<<<<
- *         cdef int idx
- *         idx, f = self.map_key2field[key]
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_15NamedTupleProxy_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_15NamedTupleProxy_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_15NamedTupleProxy_2__getattr__(((struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy *)__pyx_v_self), ((PyObject *)__pyx_v_key));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_15NamedTupleProxy_2__getattr__(struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy *__pyx_v_self, PyObject *__pyx_v_key) {
-  int __pyx_v_idx;
-  PyObject *__pyx_v_f = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *(*__pyx_t_5)(PyObject *);
-  int __pyx_t_6;
-  int __pyx_t_7;
-  struct __pyx_opt_args_5pysam_10TabProxies__force_str __pyx_t_8;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__getattr__", 0);
-
-  /* "pysam/TabProxies.pyx":644
- *     def __getattr__(self, key):
- *         cdef int idx
- *         idx, f = self.map_key2field[key]             # <<<<<<<<<<<<<<
- *         if self.nfields < idx:
- *             raise KeyError("field %s not set" % key)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_key2field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
-    PyObject* sequence = __pyx_t_2;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 2)) {
-      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
-    } else {
-      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
-    }
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_t_3);
-    #else
-    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    #endif
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
-    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_1);
-    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = NULL;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    goto __pyx_L4_unpacking_done;
-    __pyx_L3_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L4_unpacking_done:;
-  }
-  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_idx = __pyx_t_6;
-  __pyx_v_f = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/TabProxies.pyx":645
- *         cdef int idx
- *         idx, f = self.map_key2field[key]
- *         if self.nfields < idx:             # <<<<<<<<<<<<<<
- *             raise KeyError("field %s not set" % key)
- *         if f == str:
- */
-  __pyx_t_7 = ((__pyx_v_self->__pyx_base.nfields < __pyx_v_idx) != 0);
-  if (__pyx_t_7) {
-
-    /* "pysam/TabProxies.pyx":646
- *         idx, f = self.map_key2field[key]
- *         if self.nfields < idx:
- *             raise KeyError("field %s not set" % key)             # <<<<<<<<<<<<<<
- *         if f == str:
- *             return _force_str(self.fields[idx],
- */
-    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_field_s_not_set, __pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":647
- *         if self.nfields < idx:
- *             raise KeyError("field %s not set" % key)
- *         if f == str:             # <<<<<<<<<<<<<<
- *             return _force_str(self.fields[idx],
- *                               self.encoding)
- */
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v_f, ((PyObject *)((PyObject*)(&PyString_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_7) {
-
-    /* "pysam/TabProxies.pyx":648
- *             raise KeyError("field %s not set" % key)
- *         if f == str:
- *             return _force_str(self.fields[idx],             # <<<<<<<<<<<<<<
- *                               self.encoding)
- *         return f(self.fields[idx])
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[__pyx_v_idx])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-
-    /* "pysam/TabProxies.pyx":649
- *         if f == str:
- *             return _force_str(self.fields[idx],
- *                               self.encoding)             # <<<<<<<<<<<<<<
- *         return f(self.fields[idx])
- * 
- */
-    __pyx_t_3 = __pyx_v_self->__pyx_base.encoding;
-    __Pyx_INCREF(__pyx_t_3);
-
-    /* "pysam/TabProxies.pyx":648
- *             raise KeyError("field %s not set" % key)
- *         if f == str:
- *             return _force_str(self.fields[idx],             # <<<<<<<<<<<<<<
- *                               self.encoding)
- *         return f(self.fields[idx])
- */
-    __pyx_t_8.__pyx_n = 1;
-    __pyx_t_8.encoding = __pyx_t_3;
-    __pyx_t_1 = __pyx_f_5pysam_10TabProxies__force_str(__pyx_t_2, &__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/TabProxies.pyx":650
- *             return _force_str(self.fields[idx],
- *                               self.encoding)
- *         return f(self.fields[idx])             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[__pyx_v_idx])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __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 = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_f, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":642
- *         TupleProxy.__setitem__(self, idx, str(value))
- * 
- *     def __getattr__(self, key):             # <<<<<<<<<<<<<<
- *         cdef int idx
- *         idx, f = self.map_key2field[key]
- */
-
-  /* function exit code */
-  __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("pysam.TabProxies.NamedTupleProxy.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":672
- *         'blockStarts': (11, str), }
- * 
- *     cdef int getMinFields(self):             # <<<<<<<<<<<<<<
- *         '''return minimum number of fields.'''
- *         return 3
- */
-
-static int __pyx_f_5pysam_10TabProxies_8BedProxy_getMinFields(CYTHON_UNUSED struct __pyx_obj_5pysam_10TabProxies_BedProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getMinFields", 0);
-
-  /* "pysam/TabProxies.pyx":674
- *     cdef int getMinFields(self):
- *         '''return minimum number of fields.'''
- *         return 3             # <<<<<<<<<<<<<<
- * 
- *     cdef int getMaxFields(self):
- */
-  __pyx_r = 3;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":672
- *         'blockStarts': (11, str), }
- * 
- *     cdef int getMinFields(self):             # <<<<<<<<<<<<<<
- *         '''return minimum number of fields.'''
- *         return 3
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":676
- *         return 3
- * 
- *     cdef int getMaxFields(self):             # <<<<<<<<<<<<<<
- *         '''return max number of fields.'''
- *         return 12
- */
-
-static int __pyx_f_5pysam_10TabProxies_8BedProxy_getMaxFields(CYTHON_UNUSED struct __pyx_obj_5pysam_10TabProxies_BedProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getMaxFields", 0);
-
-  /* "pysam/TabProxies.pyx":678
- *     cdef int getMaxFields(self):
- *         '''return max number of fields.'''
- *         return 12             # <<<<<<<<<<<<<<
- * 
- *     cdef update(self, char * buffer, size_t nbytes):
- */
-  __pyx_r = 12;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":676
- *         return 3
- * 
- *     cdef int getMaxFields(self):             # <<<<<<<<<<<<<<
- *         '''return max number of fields.'''
- *         return 12
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":680
- *         return 12
- * 
- *     cdef update(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''update internal data.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies_8BedProxy_update(struct __pyx_obj_5pysam_10TabProxies_BedProxy *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("update", 0);
-
-  /* "pysam/TabProxies.pyx":685
- *         nbytes does not include the terminal '\0'.
- *         '''
- *         TupleProxy.update(self, buffer, nbytes)             # <<<<<<<<<<<<<<
- * 
- *         if self.nfields < 3:
- */
-  __pyx_t_1 = __pyx_vtabptr_5pysam_10TabProxies_TupleProxy->update(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self), __pyx_v_buffer, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":687
- *         TupleProxy.update(self, buffer, nbytes)
- * 
- *         if self.nfields < 3:             # <<<<<<<<<<<<<<
- *             raise ValueError(
- *                 "bed format requires at least three columns")
- */
-  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx_base.nfields < 3) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/TabProxies.pyx":688
- * 
- *         if self.nfields < 3:
- *             raise ValueError(             # <<<<<<<<<<<<<<
- *                 "bed format requires at least three columns")
- * 
- */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/TabProxies.pyx":692
- * 
- *         # determines bed format
- *         self.bedfields = self.nfields             # <<<<<<<<<<<<<<
- * 
- *         # do automatic conversion
- */
-  __pyx_t_3 = __pyx_v_self->__pyx_base.__pyx_base.nfields;
-  __pyx_v_self->bedfields = __pyx_t_3;
-
-  /* "pysam/TabProxies.pyx":695
- * 
- *         # do automatic conversion
- *         self.contig = self.fields[0]             # <<<<<<<<<<<<<<
- *         self.start = atoi( self.fields[1] )
- *         self.end = atoi( self.fields[2] )
- */
-  __pyx_v_self->contig = (__pyx_v_self->__pyx_base.__pyx_base.fields[0]);
-
-  /* "pysam/TabProxies.pyx":696
- *         # do automatic conversion
- *         self.contig = self.fields[0]
- *         self.start = atoi( self.fields[1] )             # <<<<<<<<<<<<<<
- *         self.end = atoi( self.fields[2] )
- * 
- */
-  __pyx_v_self->start = atoi((__pyx_v_self->__pyx_base.__pyx_base.fields[1]));
-
-  /* "pysam/TabProxies.pyx":697
- *         self.contig = self.fields[0]
- *         self.start = atoi( self.fields[1] )
- *         self.end = atoi( self.fields[2] )             # <<<<<<<<<<<<<<
- * 
- *     # __setattr__ in base class seems to take precedence
- */
-  __pyx_v_self->end = atoi((__pyx_v_self->__pyx_base.__pyx_base.fields[2]));
-
-  /* "pysam/TabProxies.pyx":680
- *         return 12
- * 
- *     cdef update(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''update internal data.
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.TabProxies.BedProxy.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":706
- *     #    def __get__( self ): return self.end
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- * 
- *         cdef int save_fields = self.nfields
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8BedProxy_1__str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8BedProxy_1__str__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8BedProxy___str__(((struct __pyx_obj_5pysam_10TabProxies_BedProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8BedProxy___str__(struct __pyx_obj_5pysam_10TabProxies_BedProxy *__pyx_v_self) {
-  int __pyx_v_save_fields;
-  PyObject *__pyx_v_retval = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__str__", 0);
-
-  /* "pysam/TabProxies.pyx":708
- *     def __str__(self):
- * 
- *         cdef int save_fields = self.nfields             # <<<<<<<<<<<<<<
- *         # ensure fields to use correct format
- *         self.nfields = self.bedfields
- */
-  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.nfields;
-  __pyx_v_save_fields = __pyx_t_1;
-
-  /* "pysam/TabProxies.pyx":710
- *         cdef int save_fields = self.nfields
- *         # ensure fields to use correct format
- *         self.nfields = self.bedfields             # <<<<<<<<<<<<<<
- *         retval = TupleProxy.__str__( self )
- *         self.nfields = save_fields
- */
-  __pyx_t_1 = __pyx_v_self->bedfields;
-  __pyx_v_self->__pyx_base.__pyx_base.nfields = __pyx_t_1;
-
-  /* "pysam/TabProxies.pyx":711
- *         # ensure fields to use correct format
- *         self.nfields = self.bedfields
- *         retval = TupleProxy.__str__( self )             # <<<<<<<<<<<<<<
- *         self.nfields = save_fields
- *         return retval
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_TupleProxy)), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_v_retval = __pyx_t_4;
-  __pyx_t_4 = 0;
-
-  /* "pysam/TabProxies.pyx":712
- *         self.nfields = self.bedfields
- *         retval = TupleProxy.__str__( self )
- *         self.nfields = save_fields             # <<<<<<<<<<<<<<
- *         return retval
- * 
- */
-  __pyx_v_self->__pyx_base.__pyx_base.nfields = __pyx_v_save_fields;
-
-  /* "pysam/TabProxies.pyx":713
- *         retval = TupleProxy.__str__( self )
- *         self.nfields = save_fields
- *         return retval             # <<<<<<<<<<<<<<
- * 
- *     def __setattr__(self, key, value ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_retval);
-  __pyx_r = __pyx_v_retval;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":706
- *     #    def __get__( self ): return self.end
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- * 
- *         cdef int save_fields = self.nfields
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.TabProxies.BedProxy.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_retval);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":715
- *         return retval
- * 
- *     def __setattr__(self, key, value ):             # <<<<<<<<<<<<<<
- *         '''set attribute.'''
- *         if key == "start": self.start = value
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8BedProxy_3__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8BedProxy_2__setattr__[] = "set attribute.";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_10TabProxies_8BedProxy_2__setattr__;
-#endif
-static int __pyx_pw_5pysam_10TabProxies_8BedProxy_3__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8BedProxy_2__setattr__(((struct __pyx_obj_5pysam_10TabProxies_BedProxy *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8BedProxy_2__setattr__(struct __pyx_obj_5pysam_10TabProxies_BedProxy *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
-  int __pyx_v_idx;
-  CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  uint32_t __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *(*__pyx_t_7)(PyObject *);
-  int __pyx_t_8;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__setattr__", 0);
-
-  /* "pysam/TabProxies.pyx":717
- *     def __setattr__(self, key, value ):
- *         '''set attribute.'''
- *         if key == "start": self.start = value             # <<<<<<<<<<<<<<
- *         elif key == "end": self.end = value
- * 
- */
-  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_start, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_1) {
-    __pyx_t_2 = __Pyx_PyInt_As_uint32_t(__pyx_v_value); if (unlikely((__pyx_t_2 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_self->start = __pyx_t_2;
-    goto __pyx_L3;
-  }
-
-  /* "pysam/TabProxies.pyx":718
- *         '''set attribute.'''
- *         if key == "start": self.start = value
- *         elif key == "end": self.end = value             # <<<<<<<<<<<<<<
- * 
- *         cdef int idx
- */
-  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_end, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_1) {
-    __pyx_t_2 = __Pyx_PyInt_As_uint32_t(__pyx_v_value); if (unlikely((__pyx_t_2 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_self->end = __pyx_t_2;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":721
- * 
- *         cdef int idx
- *         idx, f = self.map_key2field[key]             # <<<<<<<<<<<<<<
- *         TupleProxy._setindex(self, idx, str(value) )
- * 
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_key2field); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_v_key); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-    PyObject* sequence = __pyx_t_4;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 2)) {
-      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
-    } else {
-      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
-    }
-    __Pyx_INCREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_t_5);
-    #else
-    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    #endif
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
-    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_3);
-    index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_5);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = NULL;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    goto __pyx_L5_unpacking_done;
-    __pyx_L4_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_7 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L5_unpacking_done:;
-  }
-  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_v_idx = __pyx_t_8;
-  __pyx_v_f = __pyx_t_5;
-  __pyx_t_5 = 0;
-
-  /* "pysam/TabProxies.pyx":722
- *         cdef int idx
- *         idx, f = self.map_key2field[key]
- *         TupleProxy._setindex(self, idx, str(value) )             # <<<<<<<<<<<<<<
- * 
- * cdef class VCFProxy(NamedTupleProxy):
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_TupleProxy)), __pyx_n_s_setindex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_5 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "pysam/TabProxies.pyx":715
- *         return retval
- * 
- *     def __setattr__(self, key, value ):             # <<<<<<<<<<<<<<
- *         '''set attribute.'''
- *         if key == "start": self.start = value
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.TabProxies.BedProxy.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":741
- *         'format' : (8, str) }
- * 
- *     def __cinit__(self):             # <<<<<<<<<<<<<<
- *         # automatically calls TupleProxy.__cinit__
- *         # start indexed access at genotypes
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8VCFProxy_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_10TabProxies_8VCFProxy_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
-  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8VCFProxy___cinit__(((struct __pyx_obj_5pysam_10TabProxies_VCFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8VCFProxy___cinit__(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-
-  /* "pysam/TabProxies.pyx":744
- *         # automatically calls TupleProxy.__cinit__
- *         # start indexed access at genotypes
- *         self.offset = 9             # <<<<<<<<<<<<<<
- * 
- *     cdef update(self, char * buffer, size_t nbytes):
- */
-  __pyx_v_self->__pyx_base.__pyx_base.offset = 9;
-
-  /* "pysam/TabProxies.pyx":741
- *         'format' : (8, str) }
- * 
- *     def __cinit__(self):             # <<<<<<<<<<<<<<
- *         # automatically calls TupleProxy.__cinit__
- *         # start indexed access at genotypes
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":746
- *         self.offset = 9
- * 
- *     cdef update(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''update internal data.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_10TabProxies_8VCFProxy_update(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("update", 0);
-
-  /* "pysam/TabProxies.pyx":751
- *         nbytes does not include the terminal '\0'.
- *         '''
- *         TupleProxy.update(self, buffer, nbytes)             # <<<<<<<<<<<<<<
- * 
- *         self.contig = self.fields[0]
- */
-  __pyx_t_1 = __pyx_vtabptr_5pysam_10TabProxies_TupleProxy->update(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self), __pyx_v_buffer, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":753
- *         TupleProxy.update(self, buffer, nbytes)
- * 
- *         self.contig = self.fields[0]             # <<<<<<<<<<<<<<
- *         # vcf counts from 1 - correct here
- *         self.pos = atoi(self.fields[1]) - 1
- */
-  __pyx_v_self->contig = (__pyx_v_self->__pyx_base.__pyx_base.fields[0]);
-
-  /* "pysam/TabProxies.pyx":755
- *         self.contig = self.fields[0]
- *         # vcf counts from 1 - correct here
- *         self.pos = atoi(self.fields[1]) - 1             # <<<<<<<<<<<<<<
- * 
- *     def __len__(self):
- */
-  __pyx_v_self->pos = (atoi((__pyx_v_self->__pyx_base.__pyx_base.fields[1])) - 1);
-
-  /* "pysam/TabProxies.pyx":746
- *         self.offset = 9
- * 
- *     cdef update(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''update internal data.
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.TabProxies.VCFProxy.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":757
- *         self.pos = atoi(self.fields[1]) - 1
- * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         '''return number of genotype fields.'''
- *         return max(0, self.nfields - 9)
- */
-
-/* Python wrapper */
-static Py_ssize_t __pyx_pw_5pysam_10TabProxies_8VCFProxy_3__len__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8VCFProxy_2__len__[] = "return number of genotype fields.";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_10TabProxies_8VCFProxy_2__len__;
-#endif
-static Py_ssize_t __pyx_pw_5pysam_10TabProxies_8VCFProxy_3__len__(PyObject *__pyx_v_self) {
-  Py_ssize_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8VCFProxy_2__len__(((struct __pyx_obj_5pysam_10TabProxies_VCFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static Py_ssize_t __pyx_pf_5pysam_10TabProxies_8VCFProxy_2__len__(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_self) {
-  Py_ssize_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  long __pyx_t_1;
-  long __pyx_t_2;
-  long __pyx_t_3;
-  __Pyx_RefNannySetupContext("__len__", 0);
-
-  /* "pysam/TabProxies.pyx":759
- *     def __len__(self):
- *         '''return number of genotype fields.'''
- *         return max(0, self.nfields - 9)             # <<<<<<<<<<<<<<
- * 
- *     property pos:
- */
-  __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base.nfields - 9);
-  __pyx_t_2 = 0;
-  if (((__pyx_t_1 > __pyx_t_2) != 0)) {
-    __pyx_t_3 = __pyx_t_1;
-  } else {
-    __pyx_t_3 = __pyx_t_2;
-  }
-  __pyx_r = __pyx_t_3;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":757
- *         self.pos = atoi(self.fields[1]) - 1
- * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         '''return number of genotype fields.'''
- *         return max(0, self.nfields - 9)
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":763
- *     property pos:
- *        '''feature end (in 0-based open/closed coordinates).'''
- *        def __get__(self):             # <<<<<<<<<<<<<<
- *            return self.pos
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_10TabProxies_8VCFProxy_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_10TabProxies_8VCFProxy_3pos_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8VCFProxy_3pos___get__(((struct __pyx_obj_5pysam_10TabProxies_VCFProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_10TabProxies_8VCFProxy_3pos___get__(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_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_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/TabProxies.pyx":764
- *        '''feature end (in 0-based open/closed coordinates).'''
- *        def __get__(self):
- *            return self.pos             # <<<<<<<<<<<<<<
- * 
- *     def __setattr__(self, key, value):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/TabProxies.pyx":763
- *     property pos:
- *        '''feature end (in 0-based open/closed coordinates).'''
- *        def __get__(self):             # <<<<<<<<<<<<<<
- *            return self.pos
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.TabProxies.VCFProxy.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/TabProxies.pyx":766
- *            return self.pos
- * 
- *     def __setattr__(self, key, value):             # <<<<<<<<<<<<<<
- *         '''set attribute.'''
- *         if key == "pos":
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_10TabProxies_8VCFProxy_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
-static char __pyx_doc_5pysam_10TabProxies_8VCFProxy_4__setattr__[] = "set attribute.";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_10TabProxies_8VCFProxy_4__setattr__;
-#endif
-static int __pyx_pw_5pysam_10TabProxies_8VCFProxy_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_10TabProxies_8VCFProxy_4__setattr__(((struct __pyx_obj_5pysam_10TabProxies_VCFProxy *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_10TabProxies_8VCFProxy_4__setattr__(struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
-  int __pyx_v_idx;
-  CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  uint32_t __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *(*__pyx_t_7)(PyObject *);
-  int __pyx_t_8;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__setattr__", 0);
-  __Pyx_INCREF(__pyx_v_value);
-
-  /* "pysam/TabProxies.pyx":768
- *     def __setattr__(self, key, value):
- *         '''set attribute.'''
- *         if key == "pos":             # <<<<<<<<<<<<<<
- *             self.pos = value
- *             value += 1
- */
-  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_pos, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_1) {
-
-    /* "pysam/TabProxies.pyx":769
- *         '''set attribute.'''
- *         if key == "pos":
- *             self.pos = value             # <<<<<<<<<<<<<<
- *             value += 1
- * 
- */
-    __pyx_t_2 = __Pyx_PyInt_As_uint32_t(__pyx_v_value); if (unlikely((__pyx_t_2 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_self->pos = __pyx_t_2;
-
-    /* "pysam/TabProxies.pyx":770
- *         if key == "pos":
- *             self.pos = value
- *             value += 1             # <<<<<<<<<<<<<<
- * 
- *         cdef int idx
- */
-    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_value, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
-    __pyx_t_3 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":773
- * 
- *         cdef int idx
- *         idx, f = self.map_key2field[key]             # <<<<<<<<<<<<<<
- *         TupleProxy._setindex(self, idx, str(value))
- * 
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_key2field); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_v_key); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-    PyObject* sequence = __pyx_t_4;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 2)) {
-      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
-    } else {
-      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
-    }
-    __Pyx_INCREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_t_5);
-    #else
-    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    #endif
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
-    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_3);
-    index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_5);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = NULL;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    goto __pyx_L5_unpacking_done;
-    __pyx_L4_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_7 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L5_unpacking_done:;
-  }
-  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_v_idx = __pyx_t_8;
-  __pyx_v_f = __pyx_t_5;
-  __pyx_t_5 = 0;
-
-  /* "pysam/TabProxies.pyx":774
- *         cdef int idx
- *         idx, f = self.map_key2field[key]
- *         TupleProxy._setindex(self, idx, str(value))             # <<<<<<<<<<<<<<
- * 
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_TupleProxy)), __pyx_n_s_setindex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_v_value);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_5 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "pysam/TabProxies.pyx":766
- *            return self.pos
- * 
- *     def __setattr__(self, key, value):             # <<<<<<<<<<<<<<
- *         '''set attribute.'''
- *         if key == "pos":
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.TabProxies.VCFProxy.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-static struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy __pyx_vtable_5pysam_10TabProxies_TupleProxy;
-
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_TupleProxy(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_10TabProxies_TupleProxy;
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_5pysam_10TabProxies_10TupleProxy_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_10TabProxies_TupleProxy(PyObject *o) {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy *p = (struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_10TabProxies_10TupleProxy_3__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->encoding);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_10TabProxies_TupleProxy(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy *p = (struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)o;
-  if (p->encoding) {
-    e = (*v)(p->encoding, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_10TabProxies_TupleProxy(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy *p = (struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)o;
-  tmp = ((PyObject*)p->encoding);
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-static PyObject *__pyx_sq_item_5pysam_10TabProxies_TupleProxy(PyObject *o, Py_ssize_t i) {
-  PyObject *r;
-  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
-  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
-  Py_DECREF(x);
-  return r;
-}
-
-static int __pyx_mp_ass_subscript_5pysam_10TabProxies_TupleProxy(PyObject *o, PyObject *i, PyObject *v) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_10TupleProxy_11__setitem__(o, i, v);
-  }
-  else {
-    PyErr_Format(PyExc_NotImplementedError,
-      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
-    return -1;
-  }
-}
-
-static PyMethodDef __pyx_methods_5pysam_10TabProxies_TupleProxy[] = {
-  {__Pyx_NAMESTR("_getindex"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_10TupleProxy_5_getindex, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_10TupleProxy_4_getindex)},
-  {__Pyx_NAMESTR("_setindex"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_10TupleProxy_9_setindex, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_10TupleProxy_8_setindex)},
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_10TupleProxy_17__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_10TupleProxy_16__next__)},
-  {0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_TupleProxy = {
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_13__len__, /*sq_length*/
-  0, /*sq_concat*/
-  0, /*sq_repeat*/
-  __pyx_sq_item_5pysam_10TabProxies_TupleProxy, /*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_TupleProxy = {
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_13__len__, /*mp_length*/
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_7__getitem__, /*mp_subscript*/
-  __pyx_mp_ass_subscript_5pysam_10TabProxies_TupleProxy, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_5pysam_10TabProxies_TupleProxy = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.TabProxies.TupleProxy"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_10TabProxies_TupleProxy), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_10TabProxies_TupleProxy, /*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*/
-  &__pyx_tp_as_sequence_TupleProxy, /*tp_as_sequence*/
-  &__pyx_tp_as_mapping_TupleProxy, /*tp_as_mapping*/
-  0, /*tp_hash*/
-  0, /*tp_call*/
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_19__str__, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("Proxy class for access to parsed row as a tuple.\n\n    This class represents a table row for fast read-access.\n\n    Access to individual fields is via the [] operator.\n    \n    Only read-only access is implemented.\n\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_10TabProxies_TupleProxy, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_10TabProxies_TupleProxy, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_15__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_17__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_10TabProxies_TupleProxy, /*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_5pysam_10TabProxies_TupleProxy, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy __pyx_vtable_5pysam_10TabProxies_GTFProxy;
-
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_GTFProxy(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_10TabProxies_GTFProxy *p;
-  PyObject *o = __pyx_tp_new_5pysam_10TabProxies_TupleProxy(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy*)__pyx_vtabptr_5pysam_10TabProxies_GTFProxy;
-  if (unlikely(__pyx_pw_5pysam_10TabProxies_8GTFProxy_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_10TabProxies_GTFProxy(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_10TabProxies_8GTFProxy_3__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  PyObject_GC_Track(o);
-  __pyx_tp_dealloc_5pysam_10TabProxies_TupleProxy(o);
-}
-static PyObject *__pyx_sq_item_5pysam_10TabProxies_GTFProxy(PyObject *o, Py_ssize_t i) {
-  PyObject *r;
-  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
-  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
-  Py_DECREF(x);
-  return r;
-}
-
-static PyObject *__pyx_tp_getattro_5pysam_10TabProxies_GTFProxy(PyObject *o, PyObject *n) {
-  PyObject *v = PyObject_GenericGetAttr(o, n);
-  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
-    PyErr_Clear();
-    v = __pyx_pw_5pysam_10TabProxies_8GTFProxy_17__getattr__(o, n);
-  }
-  return v;
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_contig(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_6contig_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_contig(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_6contig_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_source(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_6source_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_source(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_6source_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_feature(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_7feature_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_feature(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_7feature_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_start(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_5start_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_5start_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_end(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_3end_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_end(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_3end_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_score(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_5score_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_score(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_5score_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_strand(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_6strand_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_strand(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_6strand_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_frame(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_5frame_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_frame(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_5frame_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8GTFProxy_attributes(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8GTFProxy_10attributes_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_10TabProxies_8GTFProxy_attributes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8GTFProxy_10attributes_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyMethodDef __pyx_methods_5pysam_10TabProxies_GTFProxy[] = {
-  {__Pyx_NAMESTR("asDict"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_8GTFProxy_5asDict, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_8GTFProxy_4asDict)},
-  {__Pyx_NAMESTR("fromDict"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_8GTFProxy_7fromDict, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_8GTFProxy_6fromDict)},
-  {__Pyx_NAMESTR("invert"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_8GTFProxy_11invert, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_8GTFProxy_10invert)},
-  {__Pyx_NAMESTR("keys"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_8GTFProxy_13keys, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_8GTFProxy_12keys)},
-  {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_8GTFProxy_17__getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_8GTFProxy_16__getattr__)},
-  {__Pyx_NAMESTR("setAttribute"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_8GTFProxy_19setAttribute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_10TabProxies_8GTFProxy_18setAttribute)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_10TabProxies_GTFProxy[] = {
-  {(char *)"contig", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_contig, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_contig, __Pyx_DOCSTR(__pyx_k_contig_of_feature), 0},
-  {(char *)"source", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_source, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_source, __Pyx_DOCSTR(__pyx_k_feature_source), 0},
-  {(char *)"feature", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_feature, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_feature, __Pyx_DOCSTR(__pyx_k_feature_name), 0},
-  {(char *)"start", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_start, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_start, __Pyx_DOCSTR(__pyx_k_feature_start_in_0_based_open_cl), 0},
-  {(char *)"end", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_end, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_end, __Pyx_DOCSTR(__pyx_k_feature_end_in_0_based_open_clos), 0},
-  {(char *)"score", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_score, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_score, __Pyx_DOCSTR(__pyx_k_feature_score), 0},
-  {(char *)"strand", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_strand, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_strand, __Pyx_DOCSTR(__pyx_k_feature_strand), 0},
-  {(char *)"frame", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_frame, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_frame, __Pyx_DOCSTR(__pyx_k_feature_frame), 0},
-  {(char *)"attributes", __pyx_getprop_5pysam_10TabProxies_8GTFProxy_attributes, __pyx_setprop_5pysam_10TabProxies_8GTFProxy_attributes, __Pyx_DOCSTR(__pyx_k_feature_attributes_as_a_string), 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_GTFProxy = {
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_13__len__, /*sq_length*/
-  #else
-  0, /*sq_length*/
-  #endif
-  0, /*sq_concat*/
-  0, /*sq_repeat*/
-  __pyx_sq_item_5pysam_10TabProxies_GTFProxy, /*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_GTFProxy = {
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_13__len__, /*mp_length*/
-  #else
-  0, /*mp_length*/
-  #endif
-  __pyx_pw_5pysam_10TabProxies_8GTFProxy_15__getitem__, /*mp_subscript*/
-  0, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_5pysam_10TabProxies_GTFProxy = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.TabProxies.GTFProxy"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_10TabProxies_GTFProxy), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_10TabProxies_GTFProxy, /*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*/
-  &__pyx_tp_as_sequence_GTFProxy, /*tp_as_sequence*/
-  &__pyx_tp_as_mapping_GTFProxy, /*tp_as_mapping*/
-  0, /*tp_hash*/
-  0, /*tp_call*/
-  __pyx_pw_5pysam_10TabProxies_8GTFProxy_9__str__, /*tp_str*/
-  __pyx_tp_getattro_5pysam_10TabProxies_GTFProxy, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("Proxy class for access to GTF fields.\n\n    This class represents a GTF entry for fast read-access.\n    Write-access has been added as well, though some care must\n    be taken. If any of the string fields (contig, source, ...)\n    are set, the new value is tied to the lifetime of the\n    argument that was supplied.\n\n    The only exception is the attributes field when set from\n    a dictionary - this field will manage its own memory.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_10TabProxies_TupleProxy, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_10TabProxies_TupleProxy, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_15__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_17__next__, /*tp_iternext*/
-  #else
-  0, /*tp_iternext*/
-  #endif
-  __pyx_methods_5pysam_10TabProxies_GTFProxy, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_10TabProxies_GTFProxy, /*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_5pysam_10TabProxies_GTFProxy, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy __pyx_vtable_5pysam_10TabProxies_NamedTupleProxy;
-
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_NamedTupleProxy(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy *p;
-  PyObject *o = __pyx_tp_new_5pysam_10TabProxies_TupleProxy(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy*)__pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy;
-  return o;
-}
-
-static PyObject *__pyx_tp_getattro_5pysam_10TabProxies_NamedTupleProxy(PyObject *o, PyObject *n) {
-  PyObject *v = PyObject_GenericGetAttr(o, n);
-  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
-    PyErr_Clear();
-    v = __pyx_pw_5pysam_10TabProxies_15NamedTupleProxy_3__getattr__(o, n);
-  }
-  return v;
-}
-
-static int __pyx_tp_setattro_5pysam_10TabProxies_NamedTupleProxy(PyObject *o, PyObject *n, PyObject *v) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_15NamedTupleProxy_1__setattr__(o, n, v);
-  }
-  else {
-    if (__pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_setattro)
-      return __pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_setattro(o, n, v);
-    return PyObject_GenericSetAttr(o, n, 0);
-  }
-}
-
-static PyMethodDef __pyx_methods_5pysam_10TabProxies_NamedTupleProxy[] = {
-  {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_pw_5pysam_10TabProxies_15NamedTupleProxy_3__getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_10TabProxies_NamedTupleProxy = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.TabProxies.NamedTupleProxy"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_10TabProxies_TupleProxy, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_19__str__, /*tp_str*/
-  #else
-  0, /*tp_str*/
-  #endif
-  __pyx_tp_getattro_5pysam_10TabProxies_NamedTupleProxy, /*tp_getattro*/
-  __pyx_tp_setattro_5pysam_10TabProxies_NamedTupleProxy, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_10TabProxies_TupleProxy, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_10TabProxies_TupleProxy, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_15__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_17__next__, /*tp_iternext*/
-  #else
-  0, /*tp_iternext*/
-  #endif
-  __pyx_methods_5pysam_10TabProxies_NamedTupleProxy, /*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_5pysam_10TabProxies_NamedTupleProxy, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy __pyx_vtable_5pysam_10TabProxies_BedProxy;
-
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_BedProxy(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_10TabProxies_BedProxy *p;
-  PyObject *o = __pyx_tp_new_5pysam_10TabProxies_NamedTupleProxy(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_10TabProxies_BedProxy *)o);
-  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy*)__pyx_vtabptr_5pysam_10TabProxies_BedProxy;
-  return o;
-}
-
-static int __pyx_tp_setattro_5pysam_10TabProxies_BedProxy(PyObject *o, PyObject *n, PyObject *v) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8BedProxy_3__setattr__(o, n, v);
-  }
-  else {
-    if (__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy->tp_setattro)
-      return __pyx_ptype_5pysam_10TabProxies_NamedTupleProxy->tp_setattro(o, n, v);
-    return PyObject_GenericSetAttr(o, n, 0);
-  }
-}
-
-static PyMethodDef __pyx_methods_5pysam_10TabProxies_BedProxy[] = {
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_10TabProxies_BedProxy = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.TabProxies.BedProxy"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_10TabProxies_BedProxy), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_10TabProxies_TupleProxy, /*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*/
-  __pyx_pw_5pysam_10TabProxies_8BedProxy_1__str__, /*tp_str*/
-  0, /*tp_getattro*/
-  __pyx_tp_setattro_5pysam_10TabProxies_BedProxy, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("Proxy class for access to Bed fields.\n\n    This class represents a BED entry for fast read-access.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_10TabProxies_TupleProxy, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_10TabProxies_TupleProxy, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_15__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_17__next__, /*tp_iternext*/
-  #else
-  0, /*tp_iternext*/
-  #endif
-  __pyx_methods_5pysam_10TabProxies_BedProxy, /*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_5pysam_10TabProxies_BedProxy, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy __pyx_vtable_5pysam_10TabProxies_VCFProxy;
-
-static PyObject *__pyx_tp_new_5pysam_10TabProxies_VCFProxy(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_10TabProxies_VCFProxy *p;
-  PyObject *o = __pyx_tp_new_5pysam_10TabProxies_NamedTupleProxy(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_10TabProxies_VCFProxy *)o);
-  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy*)__pyx_vtabptr_5pysam_10TabProxies_VCFProxy;
-  if (unlikely(__pyx_pw_5pysam_10TabProxies_8VCFProxy_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static int __pyx_tp_setattro_5pysam_10TabProxies_VCFProxy(PyObject *o, PyObject *n, PyObject *v) {
-  if (v) {
-    return __pyx_pw_5pysam_10TabProxies_8VCFProxy_5__setattr__(o, n, v);
-  }
-  else {
-    if (__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy->tp_setattro)
-      return __pyx_ptype_5pysam_10TabProxies_NamedTupleProxy->tp_setattro(o, n, v);
-    return PyObject_GenericSetAttr(o, n, 0);
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_10TabProxies_8VCFProxy_pos(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_10TabProxies_8VCFProxy_3pos_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_10TabProxies_VCFProxy[] = {
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_10TabProxies_VCFProxy[] = {
-  {(char *)"pos", __pyx_getprop_5pysam_10TabProxies_8VCFProxy_pos, 0, __Pyx_DOCSTR(__pyx_k_feature_end_in_0_based_open_clos), 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_VCFProxy = {
-  __pyx_pw_5pysam_10TabProxies_8VCFProxy_3__len__, /*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_VCFProxy = {
-  __pyx_pw_5pysam_10TabProxies_8VCFProxy_3__len__, /*mp_length*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_7__getitem__, /*mp_subscript*/
-  #else
-  0, /*mp_subscript*/
-  #endif
-  0, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_5pysam_10TabProxies_VCFProxy = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.TabProxies.VCFProxy"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_10TabProxies_VCFProxy), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_10TabProxies_TupleProxy, /*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*/
-  &__pyx_tp_as_sequence_VCFProxy, /*tp_as_sequence*/
-  &__pyx_tp_as_mapping_VCFProxy, /*tp_as_mapping*/
-  0, /*tp_hash*/
-  0, /*tp_call*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_19__str__, /*tp_str*/
-  #else
-  0, /*tp_str*/
-  #endif
-  0, /*tp_getattro*/
-  __pyx_tp_setattro_5pysam_10TabProxies_VCFProxy, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("Proxy class for access to VCF fields.\n\n    The genotypes are accessed via a numeric index.\n    Sample headers are not available.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_10TabProxies_TupleProxy, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_10TabProxies_TupleProxy, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_15__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_10TabProxies_10TupleProxy_17__next__, /*tp_iternext*/
-  #else
-  0, /*tp_iternext*/
-  #endif
-  __pyx_methods_5pysam_10TabProxies_VCFProxy, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_10TabProxies_VCFProxy, /*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_5pysam_10TabProxies_VCFProxy, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
-  {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
-    PyModuleDef_HEAD_INIT,
-  #endif
-    __Pyx_NAMESTR("TabProxies"),
-    0, /* m_doc */
-    -1, /* m_size */
-    __pyx_methods /* m_methods */,
-    NULL, /* m_reload */
-    NULL, /* m_traverse */
-    NULL, /* m_clear */
-    NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
-  {&__pyx_kp_u_Argument_must_be_string_bytes_or, __pyx_k_Argument_must_be_string_bytes_or, sizeof(__pyx_k_Argument_must_be_string_bytes_or), 0, 1, 0, 0},
-  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
-  {&__pyx_kp_s_GTFProxy_has_no_attribute_s, __pyx_k_GTFProxy_has_no_attribute_s, sizeof(__pyx_k_GTFProxy_has_no_attribute_s), 0, 0, 1, 0},
-  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
-  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
-  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
-  {&__pyx_n_s_StringTypes, __pyx_k_StringTypes, sizeof(__pyx_k_StringTypes), 0, 0, 1, 1},
-  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
-  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
-  {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0},
-  {&__pyx_kp_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 0},
-  {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
-  {&__pyx_kp_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 0},
-  {&__pyx_kp_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 0},
-  {&__pyx_kp_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 0},
-  {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
-  {&__pyx_n_s_alt, __pyx_k_alt, sizeof(__pyx_k_alt), 0, 0, 1, 1},
-  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
-  {&__pyx_n_s_asDict, __pyx_k_asDict, sizeof(__pyx_k_asDict), 0, 0, 1, 1},
-  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
-  {&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1},
-  {&__pyx_kp_s_bed_format_requires_at_least_thr, __pyx_k_bed_format_requires_at_least_thr, sizeof(__pyx_k_bed_format_requires_at_least_thr), 0, 0, 1, 0},
-  {&__pyx_n_s_blockCount, __pyx_k_blockCount, sizeof(__pyx_k_blockCount), 0, 0, 1, 1},
-  {&__pyx_n_s_blockSizes, __pyx_k_blockSizes, sizeof(__pyx_k_blockSizes), 0, 0, 1, 1},
-  {&__pyx_n_s_blockStarts, __pyx_k_blockStarts, sizeof(__pyx_k_blockStarts), 0, 0, 1, 1},
-  {&__pyx_n_s_contig, __pyx_k_contig, sizeof(__pyx_k_contig), 0, 0, 1, 1},
-  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
-  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
-  {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1},
-  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
-  {&__pyx_n_s_feature, __pyx_k_feature, sizeof(__pyx_k_feature), 0, 0, 1, 1},
-  {&__pyx_kp_s_field_s_not_set, __pyx_k_field_s_not_set, sizeof(__pyx_k_field_s_not_set), 0, 0, 1, 0},
-  {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1},
-  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
-  {&__pyx_n_s_frame, __pyx_k_frame, sizeof(__pyx_k_frame), 0, 0, 1, 1},
-  {&__pyx_n_s_fromDict, __pyx_k_fromDict, sizeof(__pyx_k_fromDict), 0, 0, 1, 1},
-  {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
-  {&__pyx_n_s_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_getindex, __pyx_k_getindex, sizeof(__pyx_k_getindex), 0, 0, 1, 1},
-  {&__pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_k_home_andreas_devel_pysam_pysam, sizeof(__pyx_k_home_andreas_devel_pysam_pysam), 0, 0, 1, 0},
-  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
-  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_kp_s_incomplete_line_at_s, __pyx_k_incomplete_line_at_s, sizeof(__pyx_k_incomplete_line_at_s), 0, 0, 1, 0},
-  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
-  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
-  {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
-  {&__pyx_n_s_itemRGB, __pyx_k_itemRGB, sizeof(__pyx_k_itemRGB), 0, 0, 1, 1},
-  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
-  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
-  {&__pyx_kp_s_length_of_buffer_i_number_of_byt, __pyx_k_length_of_buffer_i_number_of_byt, sizeof(__pyx_k_length_of_buffer_i_number_of_byt), 0, 0, 1, 0},
-  {&__pyx_kp_s_list_index_out_of_range, __pyx_k_list_index_out_of_range, sizeof(__pyx_k_list_index_out_of_range), 0, 0, 1, 0},
-  {&__pyx_kp_s_list_index_out_of_range_i_i, __pyx_k_list_index_out_of_range_i_i, sizeof(__pyx_k_list_index_out_of_range_i_i), 0, 0, 1, 0},
-  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
-  {&__pyx_kp_s_malformatted_entry_at_s, __pyx_k_malformatted_entry_at_s, sizeof(__pyx_k_malformatted_entry_at_s), 0, 0, 1, 0},
-  {&__pyx_n_s_map_key2field, __pyx_k_map_key2field, sizeof(__pyx_k_map_key2field), 0, 0, 1, 1},
-  {&__pyx_n_s_maxsplit, __pyx_k_maxsplit, sizeof(__pyx_k_maxsplit), 0, 0, 1, 1},
-  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
-  {&__pyx_kp_s_out_of_memory, __pyx_k_out_of_memory, sizeof(__pyx_k_out_of_memory), 0, 0, 1, 0},
-  {&__pyx_kp_s_out_of_memory_in_TupleProxy_copy, __pyx_k_out_of_memory_in_TupleProxy_copy, sizeof(__pyx_k_out_of_memory_in_TupleProxy_copy), 0, 0, 1, 0},
-  {&__pyx_kp_s_out_of_memory_in_TupleProxy_upda, __pyx_k_out_of_memory_in_TupleProxy_upda, sizeof(__pyx_k_out_of_memory_in_TupleProxy_upda), 0, 0, 1, 0},
-  {&__pyx_kp_s_parsing_error_fewer_that_i_field, __pyx_k_parsing_error_fewer_that_i_field, sizeof(__pyx_k_parsing_error_fewer_that_i_field), 0, 0, 1, 0},
-  {&__pyx_kp_s_parsing_error_more_than_i_fields, __pyx_k_parsing_error_more_than_i_fields, sizeof(__pyx_k_parsing_error_more_than_i_fields), 0, 0, 1, 0},
-  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
-  {&__pyx_n_s_pysam_TabProxies, __pyx_k_pysam_TabProxies, sizeof(__pyx_k_pysam_TabProxies), 0, 0, 1, 1},
-  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
-  {&__pyx_n_s_qual, __pyx_k_qual, sizeof(__pyx_k_qual), 0, 0, 1, 1},
-  {&__pyx_n_s_quote, __pyx_k_quote, sizeof(__pyx_k_quote), 0, 0, 1, 1},
-  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
-  {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
-  {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_s_s_2, __pyx_k_s_s_2, sizeof(__pyx_k_s_s_2), 0, 0, 1, 0},
-  {&__pyx_n_s_score, __pyx_k_score, sizeof(__pyx_k_score), 0, 0, 1, 1},
-  {&__pyx_n_s_setindex, __pyx_k_setindex, sizeof(__pyx_k_setindex), 0, 0, 1, 1},
-  {&__pyx_n_s_setitem, __pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 0, 1, 1},
-  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
-  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
-  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
-  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
-  {&__pyx_n_s_strand, __pyx_k_strand, sizeof(__pyx_k_strand), 0, 0, 1, 1},
-  {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
-  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
-  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
-  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
-  {&__pyx_n_s_thickEnd, __pyx_k_thickEnd, sizeof(__pyx_k_thickEnd), 0, 0, 1, 1},
-  {&__pyx_n_s_thickStart, __pyx_k_thickStart, sizeof(__pyx_k_thickStart), 0, 0, 1, 1},
-  {&__pyx_n_s_toDot, __pyx_k_toDot, sizeof(__pyx_k_toDot), 0, 0, 1, 1},
-  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
-  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
-  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 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) {
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if PY_MAJOR_VERSION >= 3
-  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #else
-  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __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);
-
-  /* "pysam/TabProxies.pyx":144
- *         self.data = <char*>malloc(s)
- *         if self.data == NULL:
- *             raise ValueError("out of memory in TupleProxy.copy()")             # <<<<<<<<<<<<<<
- *         self.nbytes = nbytes
- *         memcpy(<char*>self.data, buffer, s)
- */
-  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_out_of_memory_in_TupleProxy_copy); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__2);
-  __Pyx_GIVEREF(__pyx_tuple__2);
-
-  /* "pysam/TabProxies.pyx":220
- *         self.fields = <char **>calloc(max_fields, sizeof(char *))
- *         if self.fields == NULL:
- *             raise ValueError("out of memory in TupleProxy.update()")             # <<<<<<<<<<<<<<
- * 
- *         #################################
- */
-  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_out_of_memory_in_TupleProxy_upda); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__3);
-  __Pyx_GIVEREF(__pyx_tuple__3);
-
-  /* "pysam/TabProxies.pyx":258
- *             i += self.nfields
- *         if i < 0:
- *             raise IndexError("list index out of range")             # <<<<<<<<<<<<<<
- *         # apply offset - separating a fixed number
- *         # of fields from a variable number such as in VCF
- */
-  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_list_index_out_of_range); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__4);
-  __Pyx_GIVEREF(__pyx_tuple__4);
-
-  /* "pysam/TabProxies.pyx":282
- *         cdef int idx = index
- *         if idx < 0:
- *             raise IndexError("list index out of range")             # <<<<<<<<<<<<<<
- *         if idx >= self.nfields:
- *             raise IndexError("list index out of range")
- */
-  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_list_index_out_of_range); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__5);
-  __Pyx_GIVEREF(__pyx_tuple__5);
-
-  /* "pysam/TabProxies.pyx":284
- *             raise IndexError("list index out of range")
- *         if idx >= self.nfields:
- *             raise IndexError("list index out of range")             # <<<<<<<<<<<<<<
- * 
- *         if isNew(self.fields[idx], self.data, self.nbytes):
- */
-  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_list_index_out_of_range); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__6);
-  __Pyx_GIVEREF(__pyx_tuple__6);
-
-  /* "pysam/TabProxies.pyx":300
- *         self.fields[idx] = <char*>malloc((strlen( tmp ) + 1) * sizeof(char))
- *         if self.fields[idx] == NULL:
- *             raise ValueError("out of memory" )             # <<<<<<<<<<<<<<
- *         strcpy(self.fields[idx], tmp)
- * 
- */
-  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_out_of_memory); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__7);
-  __Pyx_GIVEREF(__pyx_tuple__7);
-
-  /* "pysam/TabProxies.pyx":343
- *             cpy = <char*>calloc(sizeof(char), self.nbytes+1)
- *             if cpy == NULL:
- *                 raise ValueError("out of memory")             # <<<<<<<<<<<<<<
- *             memcpy(cpy, self.data, self.nbytes+1)
- *             for x from 0 <= x < self.nbytes:
- */
-  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_out_of_memory); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__9);
-  __Pyx_GIVEREF(__pyx_tuple__9);
-
-  /* "pysam/TabProxies.pyx":402
- *        '''contig of feature.'''
- *        def __get__(self):
- *            return self._getindex(0)             # <<<<<<<<<<<<<<
- *        def __set__(self, value):
- *            self._setindex(0, value)
- */
-  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__11);
-  __Pyx_GIVEREF(__pyx_tuple__11);
-
-  /* "pysam/TabProxies.pyx":409
- *        '''feature source.'''
- *        def __get__(self):
- *            return self._getindex(1)             # <<<<<<<<<<<<<<
- *        def __set__(self, value):
- *            self._setindex(1, value)
- */
-  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__12);
-  __Pyx_GIVEREF(__pyx_tuple__12);
-
-  /* "pysam/TabProxies.pyx":415
- *     property feature:
- *        '''feature name.'''
- *        def __get__( self ): return self._getindex( 2 )             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 2, value )
- * 
- */
-  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__13);
-  __Pyx_GIVEREF(__pyx_tuple__13);
-
-  /* "pysam/TabProxies.pyx":420
- *     property start:
- *        '''feature start (in 0-based open/closed coordinates).'''
- *        def __get__( self ): return int( self._getindex( 3 )) - 1             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 3, str(value+1) )
- * 
- */
-  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__14);
-  __Pyx_GIVEREF(__pyx_tuple__14);
-
-  /* "pysam/TabProxies.pyx":425
- *     property end:
- *        '''feature end (in 0-based open/closed coordinates).'''
- *        def __get__( self ): return int( self._getindex( 4 ) )             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 4, str(value) )
- * 
- */
-  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__15);
-  __Pyx_GIVEREF(__pyx_tuple__15);
-
-  /* "pysam/TabProxies.pyx":431
- *        '''feature score.'''
- *        def __get__( self ):
- *            v = self._getindex(5)             # <<<<<<<<<<<<<<
- *            if v == "" or v[0] == '.':
- *                return None
- */
-  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_int_5); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__16);
-  __Pyx_GIVEREF(__pyx_tuple__16);
-
-  /* "pysam/TabProxies.pyx":441
- *     property strand:
- *        '''feature strand.'''
- *        def __get__( self ): return self._getindex( 6 )             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 6, value )
- * 
- */
-  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_int_6); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__17);
-  __Pyx_GIVEREF(__pyx_tuple__17);
-
-  /* "pysam/TabProxies.pyx":446
- *     property frame:
- *        '''feature frame.'''
- *        def __get__( self ): return self._getindex( 7 )             # <<<<<<<<<<<<<<
- *        def __set__( self, value ): self._setindex( 7, value )
- * 
- */
-  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_7); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__18);
-  __Pyx_GIVEREF(__pyx_tuple__18);
-
-  /* "pysam/TabProxies.pyx":455
- *                return self._attributes
- *            else:
- *                return self._getindex(8)             # <<<<<<<<<<<<<<
- *        def __set__( self, value ):
- *            if self.hasOwnAttributes:
- */
-  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_int_8); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__19);
-  __Pyx_GIVEREF(__pyx_tuple__19);
-
-  /* "pysam/TabProxies.pyx":478
- * 
- *         # separate into fields
- *         fields = [x.strip() for x in attributes.split(";")[:-1]]             # <<<<<<<<<<<<<<
- * 
- *         result = {}
- */
-  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s__20); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__21);
-  __Pyx_GIVEREF(__pyx_tuple__21);
-  __pyx_slice__22 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__22);
-  __Pyx_GIVEREF(__pyx_slice__22);
-
-  /* "pysam/TabProxies.pyx":492
- * 
- *             if v[0] == '"' and v[-1] == '"':
- *                 v = v[1:-1]             # <<<<<<<<<<<<<<
- *             else:
- *                 ## try to convert to a value
- */
-  __pyx_slice__25 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__25);
-  __Pyx_GIVEREF(__pyx_slice__25);
-
-  /* "pysam/TabProxies.pyx":528
- *         self._attributes = <char *>calloc( l + 1, sizeof(char) )
- *         if self._attributes == NULL:
- *             raise ValueError("out of memory" )             # <<<<<<<<<<<<<<
- *         memcpy( self._attributes, p, l )
- * 
- */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_out_of_memory); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
-
-  /* "pysam/TabProxies.pyx":567
- *         r = self.attributes
- *         return [x.strip().split(" ")[0]
- *                 for x in r.split(";") if x.strip() != '']             # <<<<<<<<<<<<<<
- * 
- *     def __getitem__(self, key):
- */
-  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s__20); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__29);
-  __Pyx_GIVEREF(__pyx_tuple__29);
-
-  /* "pysam/TabProxies.pyx":566
- *         '''return a list of attributes defined in this entry.'''
- *         r = self.attributes
- *         return [x.strip().split(" ")[0]             # <<<<<<<<<<<<<<
- *                 for x in r.split(";") if x.strip() != '']
- * 
- */
-  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s__23); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
-
-  /* "pysam/TabProxies.pyx":688
- * 
- *         if self.nfields < 3:
- *             raise ValueError(             # <<<<<<<<<<<<<<
- *                 "bed format requires at least three columns")
- * 
- */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_bed_format_requires_at_least_thr); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
-
-  /* "pysam/TabProxies.pyx":353
- *             return r
- * 
- * def toDot(v):             # <<<<<<<<<<<<<<
- *     '''convert value to '.' if None'''
- *     if v is None:
- */
-  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_v); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
-  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_toDot, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/TabProxies.pyx":360
- *         return str(v)
- * 
- * def quote(v):             # <<<<<<<<<<<<<<
- *     '''return a quoted attribute.'''
- *     if type(v) in types.StringTypes:
- */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_v); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
-  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_quote, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __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_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  return 0;
-  __pyx_L1_error:;
-  return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC initTabProxies(void); /*proto*/
-PyMODINIT_FUNC initTabProxies(void)
-#else
-PyMODINIT_FUNC PyInit_TabProxies(void); /*proto*/
-PyMODINIT_FUNC PyInit_TabProxies(void)
-#endif
-{
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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_TabProxies(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("TabProxies"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
-  #else
-  __pyx_m = PyModule_Create(&__pyx_moduledef);
-  #endif
-  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_d);
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  if (__pyx_module_is_main_pysam__TabProxies) {
-    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;};
-  }
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pysam.TabProxies")) {
-      if (unlikely(PyDict_SetItemString(modules, "pysam.TabProxies", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  /*--- 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_5pysam_10TabProxies__FILENAME_ENCODING = ((PyObject*)Py_None); Py_INCREF(Py_None);
-  /*--- Variable export code ---*/
-  /*--- Function export code ---*/
-  /*--- Type init code ---*/
-  __pyx_vtabptr_5pysam_10TabProxies_TupleProxy = &__pyx_vtable_5pysam_10TabProxies_TupleProxy;
-  __pyx_vtable_5pysam_10TabProxies_TupleProxy.getMaxFields = (int (*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *))__pyx_f_5pysam_10TabProxies_10TupleProxy_getMaxFields;
-  __pyx_vtable_5pysam_10TabProxies_TupleProxy.getMinFields = (int (*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *))__pyx_f_5pysam_10TabProxies_10TupleProxy_getMinFields;
-  __pyx_vtable_5pysam_10TabProxies_TupleProxy.take = (PyObject *(*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_5pysam_10TabProxies_10TupleProxy_take;
-  __pyx_vtable_5pysam_10TabProxies_TupleProxy.present = (PyObject *(*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_5pysam_10TabProxies_10TupleProxy_present;
-  __pyx_vtable_5pysam_10TabProxies_TupleProxy.copy = (PyObject *(*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_5pysam_10TabProxies_10TupleProxy_copy;
-  __pyx_vtable_5pysam_10TabProxies_TupleProxy.update = (PyObject *(*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_5pysam_10TabProxies_10TupleProxy_update;
-  if (PyType_Ready(&__pyx_type_5pysam_10TabProxies_TupleProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_10TabProxies_TupleProxy.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_10TabProxies_TupleProxy, "__setitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_10__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_10__setitem__.doc = __pyx_doc_5pysam_10TabProxies_10TupleProxy_10__setitem__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_10__setitem__;
-    }
-  }
-  #endif
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_10TabProxies_TupleProxy, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_16__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_16__next__.doc = __pyx_doc_5pysam_10TabProxies_10TupleProxy_16__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_16__next__;
-    }
-  }
-  #endif
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_10TabProxies_TupleProxy, "__str__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_18__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_18__str__.doc = __pyx_doc_5pysam_10TabProxies_10TupleProxy_18__str__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_10TabProxies_10TupleProxy_18__str__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_10TabProxies_TupleProxy.tp_dict, __pyx_vtabptr_5pysam_10TabProxies_TupleProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "TupleProxy", (PyObject *)&__pyx_type_5pysam_10TabProxies_TupleProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_TupleProxy = &__pyx_type_5pysam_10TabProxies_TupleProxy;
-  __pyx_vtabptr_5pysam_10TabProxies_GTFProxy = &__pyx_vtable_5pysam_10TabProxies_GTFProxy;
-  __pyx_vtable_5pysam_10TabProxies_GTFProxy.__pyx_base = *__pyx_vtabptr_5pysam_10TabProxies_TupleProxy;
-  __pyx_vtable_5pysam_10TabProxies_GTFProxy.__pyx_base.getMaxFields = (int (*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *))__pyx_f_5pysam_10TabProxies_8GTFProxy_getMaxFields;
-  __pyx_vtable_5pysam_10TabProxies_GTFProxy.__pyx_base.getMinFields = (int (*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *))__pyx_f_5pysam_10TabProxies_8GTFProxy_getMinFields;
-  __pyx_vtable_5pysam_10TabProxies_GTFProxy.getAttributes = (char *(*)(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *))__pyx_f_5pysam_10TabProxies_8GTFProxy_getAttributes;
-  __pyx_type_5pysam_10TabProxies_GTFProxy.tp_base = __pyx_ptype_5pysam_10TabProxies_TupleProxy;
-  if (PyType_Ready(&__pyx_type_5pysam_10TabProxies_GTFProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_10TabProxies_GTFProxy.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_10TabProxies_GTFProxy, "__getattr__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_10TabProxies_8GTFProxy_16__getattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_10TabProxies_8GTFProxy_16__getattr__.doc = __pyx_doc_5pysam_10TabProxies_8GTFProxy_16__getattr__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_10TabProxies_8GTFProxy_16__getattr__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_10TabProxies_GTFProxy.tp_dict, __pyx_vtabptr_5pysam_10TabProxies_GTFProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "GTFProxy", (PyObject *)&__pyx_type_5pysam_10TabProxies_GTFProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_GTFProxy = &__pyx_type_5pysam_10TabProxies_GTFProxy;
-  __pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy = &__pyx_vtable_5pysam_10TabProxies_NamedTupleProxy;
-  __pyx_vtable_5pysam_10TabProxies_NamedTupleProxy.__pyx_base = *__pyx_vtabptr_5pysam_10TabProxies_TupleProxy;
-  __pyx_type_5pysam_10TabProxies_NamedTupleProxy.tp_base = __pyx_ptype_5pysam_10TabProxies_TupleProxy;
-  if (PyType_Ready(&__pyx_type_5pysam_10TabProxies_NamedTupleProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_10TabProxies_NamedTupleProxy.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_10TabProxies_NamedTupleProxy, "__setattr__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_10TabProxies_15NamedTupleProxy___setattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_10TabProxies_15NamedTupleProxy___setattr__.doc = __pyx_doc_5pysam_10TabProxies_15NamedTupleProxy___setattr__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_10TabProxies_15NamedTupleProxy___setattr__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_10TabProxies_NamedTupleProxy.tp_dict, __pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "NamedTupleProxy", (PyObject *)&__pyx_type_5pysam_10TabProxies_NamedTupleProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_NamedTupleProxy = &__pyx_type_5pysam_10TabProxies_NamedTupleProxy;
-  __pyx_vtabptr_5pysam_10TabProxies_BedProxy = &__pyx_vtable_5pysam_10TabProxies_BedProxy;
-  __pyx_vtable_5pysam_10TabProxies_BedProxy.__pyx_base = *__pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy;
-  __pyx_vtable_5pysam_10TabProxies_BedProxy.__pyx_base.__pyx_base.getMaxFields = (int (*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *))__pyx_f_5pysam_10TabProxies_8BedProxy_getMaxFields;
-  __pyx_vtable_5pysam_10TabProxies_BedProxy.__pyx_base.__pyx_base.getMinFields = (int (*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *))__pyx_f_5pysam_10TabProxies_8BedProxy_getMinFields;
-  __pyx_vtable_5pysam_10TabProxies_BedProxy.__pyx_base.__pyx_base.update = (PyObject *(*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_5pysam_10TabProxies_8BedProxy_update;
-  __pyx_type_5pysam_10TabProxies_BedProxy.tp_base = __pyx_ptype_5pysam_10TabProxies_NamedTupleProxy;
-  if (PyType_Ready(&__pyx_type_5pysam_10TabProxies_BedProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_10TabProxies_BedProxy.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_10TabProxies_BedProxy, "__setattr__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_10TabProxies_8BedProxy_2__setattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_10TabProxies_8BedProxy_2__setattr__.doc = __pyx_doc_5pysam_10TabProxies_8BedProxy_2__setattr__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_10TabProxies_8BedProxy_2__setattr__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_10TabProxies_BedProxy.tp_dict, __pyx_vtabptr_5pysam_10TabProxies_BedProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "BedProxy", (PyObject *)&__pyx_type_5pysam_10TabProxies_BedProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_BedProxy = &__pyx_type_5pysam_10TabProxies_BedProxy;
-  __pyx_vtabptr_5pysam_10TabProxies_VCFProxy = &__pyx_vtable_5pysam_10TabProxies_VCFProxy;
-  __pyx_vtable_5pysam_10TabProxies_VCFProxy.__pyx_base = *__pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy;
-  __pyx_vtable_5pysam_10TabProxies_VCFProxy.__pyx_base.__pyx_base.update = (PyObject *(*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_5pysam_10TabProxies_8VCFProxy_update;
-  __pyx_type_5pysam_10TabProxies_VCFProxy.tp_base = __pyx_ptype_5pysam_10TabProxies_NamedTupleProxy;
-  if (PyType_Ready(&__pyx_type_5pysam_10TabProxies_VCFProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_10TabProxies_VCFProxy.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_10TabProxies_VCFProxy, "__len__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_10TabProxies_8VCFProxy_2__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_10TabProxies_8VCFProxy_2__len__.doc = __pyx_doc_5pysam_10TabProxies_8VCFProxy_2__len__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_10TabProxies_8VCFProxy_2__len__;
-    }
-  }
-  #endif
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_10TabProxies_VCFProxy, "__setattr__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_10TabProxies_8VCFProxy_4__setattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_10TabProxies_8VCFProxy_4__setattr__.doc = __pyx_doc_5pysam_10TabProxies_8VCFProxy_4__setattr__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_10TabProxies_8VCFProxy_4__setattr__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_10TabProxies_VCFProxy.tp_dict, __pyx_vtabptr_5pysam_10TabProxies_VCFProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "VCFProxy", (PyObject *)&__pyx_type_5pysam_10TabProxies_VCFProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_VCFProxy = &__pyx_type_5pysam_10TabProxies_VCFProxy;
-  /*--- Type import code ---*/
-  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
-  #if CYTHON_COMPILING_IN_PYPY
-  sizeof(PyTypeObject),
-  #else
-  sizeof(PyHeapTypeObject),
-  #endif
-  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Variable import code ---*/
-  /*--- Function import code ---*/
-  /*--- Execution code ---*/
-
-  /* "pysam/TabProxies.pyx":1
- * import types             # <<<<<<<<<<<<<<
- * import sys
- * import string
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_types, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":2
- * import types
- * import sys             # <<<<<<<<<<<<<<
- * import string
- * 
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":3
- * import types
- * import sys
- * import string             # <<<<<<<<<<<<<<
- * 
- * from cpython.version cimport PY_MAJOR_VERSION
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_string, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":20
- * # filename encoding (copied from lxml.etree.pyx)
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_XGOTREF(__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":21
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- */
-  __pyx_t_3 = (__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_4 = (__pyx_t_3 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/TabProxies.pyx":22
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XGOTREF(__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L2;
-  }
-  __pyx_L2:;
-
-  /* "pysam/TabProxies.pyx":23
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = 'ascii'
- * 
- */
-  __pyx_t_4 = (__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_3 = (__pyx_t_4 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/TabProxies.pyx":24
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'             # <<<<<<<<<<<<<<
- * 
- * cdef bytes _force_bytes(object s, encoding="ascii"):
- */
-    __Pyx_INCREF(__pyx_n_s_ascii);
-    __Pyx_XGOTREF(__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_10TabProxies__FILENAME_ENCODING, __pyx_n_s_ascii);
-    __Pyx_GIVEREF(__pyx_n_s_ascii);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/TabProxies.pyx":353
- *             return r
- * 
- * def toDot(v):             # <<<<<<<<<<<<<<
- *     '''convert value to '.' if None'''
- *     if v is None:
- */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysam_10TabProxies_1toDot, NULL, __pyx_n_s_pysam_TabProxies); 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);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_toDot, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":360
- *         return str(v)
- * 
- * def quote(v):             # <<<<<<<<<<<<<<
- *     '''return a quoted attribute.'''
- *     if type(v) in types.StringTypes:
- */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysam_10TabProxies_3quote, NULL, __pyx_n_s_pysam_TabProxies); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_quote, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/TabProxies.pyx":632
- * cdef class NamedTupleProxy(TupleProxy):
- * 
- *     map_key2field = {}             # <<<<<<<<<<<<<<
- * 
- *     def __setattr__(self, key, value):
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy->tp_dict, __pyx_n_s_map_key2field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  PyType_Modified(__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy);
-
-  /* "pysam/TabProxies.pyx":658
- *     This class represents a BED entry for fast read-access.
- *     '''
- *     map_key2field = {             # <<<<<<<<<<<<<<
- *         'contig' : (0, str),
- *         'start' : (1, int),
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/TabProxies.pyx":659
- *     '''
- *     map_key2field = {
- *         'contig' : (0, str),             # <<<<<<<<<<<<<<
- *         'start' : (1, int),
- *         'end' : (2, int),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_contig, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":660
- *     map_key2field = {
- *         'contig' : (0, str),
- *         'start' : (1, int),             # <<<<<<<<<<<<<<
- *         'end' : (2, int),
- *         'name' : (3, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_start, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":661
- *         'contig' : (0, str),
- *         'start' : (1, int),
- *         'end' : (2, int),             # <<<<<<<<<<<<<<
- *         'name' : (3, str),
- *         'score' : (4, float),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_2);
-  __Pyx_GIVEREF(__pyx_int_2);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_end, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":662
- *         'start' : (1, int),
- *         'end' : (2, int),
- *         'name' : (3, str),             # <<<<<<<<<<<<<<
- *         'score' : (4, float),
- *         'strand' : (5, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_3);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_3);
-  __Pyx_GIVEREF(__pyx_int_3);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":663
- *         'end' : (2, int),
- *         'name' : (3, str),
- *         'score' : (4, float),             # <<<<<<<<<<<<<<
- *         'strand' : (5, str),
- *         'thickStart' : (6, int),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_4);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_4);
-  __Pyx_GIVEREF(__pyx_int_4);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyFloat_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_score, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":664
- *         'name' : (3, str),
- *         'score' : (4, float),
- *         'strand' : (5, str),             # <<<<<<<<<<<<<<
- *         'thickStart' : (6, int),
- *         'thickEnd' : (7, int),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_5);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_5);
-  __Pyx_GIVEREF(__pyx_int_5);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_strand, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":665
- *         'score' : (4, float),
- *         'strand' : (5, str),
- *         'thickStart' : (6, int),             # <<<<<<<<<<<<<<
- *         'thickEnd' : (7, int),
- *         'itemRGB' : (8, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_6);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_6);
-  __Pyx_GIVEREF(__pyx_int_6);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_thickStart, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":666
- *         'strand' : (5, str),
- *         'thickStart' : (6, int),
- *         'thickEnd' : (7, int),             # <<<<<<<<<<<<<<
- *         'itemRGB' : (8, str),
- *         'blockCount': (9, int),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_7);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_7);
-  __Pyx_GIVEREF(__pyx_int_7);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_thickEnd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":667
- *         'thickStart' : (6, int),
- *         'thickEnd' : (7, int),
- *         'itemRGB' : (8, str),             # <<<<<<<<<<<<<<
- *         'blockCount': (9, int),
- *         'blockSizes': (10, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_8);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_8);
-  __Pyx_GIVEREF(__pyx_int_8);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_itemRGB, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":668
- *         'thickEnd' : (7, int),
- *         'itemRGB' : (8, str),
- *         'blockCount': (9, int),             # <<<<<<<<<<<<<<
- *         'blockSizes': (10, str),
- *         'blockStarts': (11, str), }
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_9);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_9);
-  __Pyx_GIVEREF(__pyx_int_9);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blockCount, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":669
- *         'itemRGB' : (8, str),
- *         'blockCount': (9, int),
- *         'blockSizes': (10, str),             # <<<<<<<<<<<<<<
- *         'blockStarts': (11, str), }
- * 
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_10);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_10);
-  __Pyx_GIVEREF(__pyx_int_10);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blockSizes, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":670
- *         'blockCount': (9, int),
- *         'blockSizes': (10, str),
- *         'blockStarts': (11, str), }             # <<<<<<<<<<<<<<
- * 
- *     cdef int getMinFields(self):
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_11);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_11);
-  __Pyx_GIVEREF(__pyx_int_11);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_blockStarts, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysam_10TabProxies_BedProxy->tp_dict, __pyx_n_s_map_key2field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  PyType_Modified(__pyx_ptype_5pysam_10TabProxies_BedProxy);
-
-  /* "pysam/TabProxies.pyx":730
- *     Sample headers are not available.
- *     '''
- *     map_key2field = {             # <<<<<<<<<<<<<<
- *         'contig' : (0, str),
- *         'pos' : (1, int),
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/TabProxies.pyx":731
- *     '''
- *     map_key2field = {
- *         'contig' : (0, str),             # <<<<<<<<<<<<<<
- *         'pos' : (1, int),
- *         'id' : (2, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_contig, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":732
- *     map_key2field = {
- *         'contig' : (0, str),
- *         'pos' : (1, int),             # <<<<<<<<<<<<<<
- *         'id' : (2, str),
- *         'ref' : (3, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pos, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":733
- *         'contig' : (0, str),
- *         'pos' : (1, int),
- *         'id' : (2, str),             # <<<<<<<<<<<<<<
- *         'ref' : (3, str),
- *         'alt' : (4, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_2);
-  __Pyx_GIVEREF(__pyx_int_2);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_id, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":734
- *         'pos' : (1, int),
- *         'id' : (2, str),
- *         'ref' : (3, str),             # <<<<<<<<<<<<<<
- *         'alt' : (4, str),
- *         'qual' : (5, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_3);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_3);
-  __Pyx_GIVEREF(__pyx_int_3);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ref, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":735
- *         'id' : (2, str),
- *         'ref' : (3, str),
- *         'alt' : (4, str),             # <<<<<<<<<<<<<<
- *         'qual' : (5, str),
- *         'filter' : (6, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_4);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_4);
-  __Pyx_GIVEREF(__pyx_int_4);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":736
- *         'ref' : (3, str),
- *         'alt' : (4, str),
- *         'qual' : (5, str),             # <<<<<<<<<<<<<<
- *         'filter' : (6, str),
- *         'info' : (7, str),
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_5);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_5);
-  __Pyx_GIVEREF(__pyx_int_5);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_qual, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":737
- *         'alt' : (4, str),
- *         'qual' : (5, str),
- *         'filter' : (6, str),             # <<<<<<<<<<<<<<
- *         'info' : (7, str),
- *         'format' : (8, str) }
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_6);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_6);
-  __Pyx_GIVEREF(__pyx_int_6);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":738
- *         'qual' : (5, str),
- *         'filter' : (6, str),
- *         'info' : (7, str),             # <<<<<<<<<<<<<<
- *         'format' : (8, str) }
- * 
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_7);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_7);
-  __Pyx_GIVEREF(__pyx_int_7);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_info, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/TabProxies.pyx":739
- *         'filter' : (6, str),
- *         'info' : (7, str),
- *         'format' : (8, str) }             # <<<<<<<<<<<<<<
- * 
- *     def __cinit__(self):
- */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_8);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_8);
-  __Pyx_GIVEREF(__pyx_int_8);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_format, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_5pysam_10TabProxies_VCFProxy->tp_dict, __pyx_n_s_map_key2field, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  PyType_Modified(__pyx_ptype_5pysam_10TabProxies_VCFProxy);
-
-  /* "pysam/TabProxies.pyx":1
- * import types             # <<<<<<<<<<<<<<
- * import sys
- * import string
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  if (__pyx_m) {
-    __Pyx_AddTraceback("init pysam.TabProxies", __pyx_clineno, __pyx_lineno, __pyx_filename);
-    Py_DECREF(__pyx_m); __pyx_m = 0;
-  } else if (!PyErr_Occurred()) {
-    PyErr_SetString(PyExc_ImportError, "init pysam.TabProxies");
-  }
-  __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_GetBuiltinName(PyObject *name) {
-    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
-    if (unlikely(!result)) {
-        PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
-            "name '%U' is not defined", name);
-#else
-            "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
-    }
-    return result;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
-         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
-         const char* encoding, const char* errors,
-         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
-    Py_ssize_t length;
-    if (unlikely((start < 0) | (stop < 0))) {
-        length = strlen(cstring);
-        if (start < 0) {
-            start += length;
-            if (start < 0)
-                start = 0;
-        }
-        if (stop < 0)
-            stop += length;
-    }
-    length = stop - start;
-    if (unlikely(length <= 0))
-        return PyUnicode_FromUnicode(NULL, 0);
-    cstring += start;
-    if (decode_func) {
-        return decode_func(cstring, length, errors);
-    } else {
-        return PyUnicode_Decode(cstring, length, encoding, errors);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyObject *result;
-    ternaryfunc call = func->ob_type->tp_call;
-    if (unlikely(!call))
-        return PyObject_Call(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
-        return NULL;
-#endif
-    result = (*call)(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    Py_LeaveRecursiveCall();
-#endif
-    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
-        PyErr_SetString(
-            PyExc_SystemError,
-            "NULL result without error in PyObject_Call");
-    }
-    return result;
-}
-#endif
-
-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);
-    if (!value || value == Py_None)
-        value = NULL;
-    else
-        Py_INCREF(value);
-    if (!tb || tb == Py_None)
-        tb = NULL;
-    else {
-        Py_INCREF(tb);
-        if (!PyTraceBack_Check(tb)) {
-            PyErr_SetString(PyExc_TypeError,
-                "raise: arg 3 must be a traceback or None");
-            goto raise_error;
-        }
-    }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
-    if (PyType_Check(type)) {
-    #endif
-#if CYTHON_COMPILING_IN_PYPY
-        if (!value) {
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-#endif
-        PyErr_NormalizeException(&type, &value, &tb);
-    } else {
-        if (value) {
-            PyErr_SetString(PyExc_TypeError,
-                "instance exception may not have a separate value");
-            goto raise_error;
-        }
-        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) {
-    PyObject* owned_instance = NULL;
-    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)) {
-        PyObject *instance_class = NULL;
-        if (value && PyExceptionInstance_Check(value)) {
-            instance_class = (PyObject*) Py_TYPE(value);
-            if (instance_class != type) {
-                if (PyObject_IsSubclass(instance_class, type)) {
-                    type = instance_class;
-                } else {
-                    instance_class = NULL;
-                }
-            }
-        }
-        if (!instance_class) {
-            PyObject *args;
-            if (!value)
-                args = PyTuple_New(0);
-            else if (PyTuple_Check(value)) {
-                Py_INCREF(value);
-                args = value;
-            } else
-                args = PyTuple_Pack(1, value);
-            if (!args)
-                goto bad;
-            owned_instance = PyObject_Call(type, args, NULL);
-            Py_DECREF(args);
-            if (!owned_instance)
-                goto bad;
-            value = owned_instance;
-            if (!PyExceptionInstance_Check(value)) {
-                PyErr_Format(PyExc_TypeError,
-                             "calling %R should have returned an instance of "
-                             "BaseException, not %R",
-                             type, Py_TYPE(value));
-                goto bad;
-            }
-        }
-    } else {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: exception class must be a subclass of BaseException");
-        goto bad;
-    }
-#if PY_VERSION_HEX >= 0x03030000
-    if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
-        PyObject *fixed_cause;
-        if (cause == Py_None) {
-            fixed_cause = NULL;
-        } else 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;
-        }
-        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:
-    Py_XDECREF(owned_instance);
-    return;
-}
-#endif
-
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
-                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
-                                  int full_traceback) {
-    PyObject *old_exc, *old_val, *old_tb;
-    PyObject *ctx;
-    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
-    if (full_traceback) {
-        Py_XINCREF(old_exc);
-        Py_XINCREF(old_val);
-        Py_XINCREF(old_tb);
-        __Pyx_ErrRestore(old_exc, old_val, old_tb);
-        PyErr_PrintEx(1);
-    }
-    #if PY_MAJOR_VERSION < 3
-    ctx = PyString_FromString(name);
-    #else
-    ctx = PyUnicode_FromString(name);
-    #endif
-    __Pyx_ErrRestore(old_exc, old_val, old_tb);
-    if (!ctx) {
-        PyErr_WriteUnraisable(Py_None);
-    } else {
-        PyErr_WriteUnraisable(ctx);
-        Py_DECREF(ctx);
-    }
-}
-
-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_AsString(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;
-            continue;
-        }
-        name = first_kw_arg;
-        #if PY_MAJOR_VERSION < 3
-        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
-            while (*name) {
-                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
-                        && _PyString_Eq(**name, key)) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    if ((**argname == key) || (
-                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
-                             && _PyString_Eq(**argname, key))) {
-                        goto arg_passed_twice;
-                    }
-                    argname++;
-                }
-            }
-        } else
-        #endif
-        if (likely(PyUnicode_Check(key))) {
-            while (*name) {
-                int cmp = (**name == key) ? 0 :
-                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
-                #endif
-                    PyUnicode_Compare(**name, key);
-                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                if (cmp == 0) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    int cmp = (**argname == key) ? 0 :
-                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
-                    #endif
-                        PyUnicode_Compare(**argname, key);
-                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                    if (cmp == 0) goto arg_passed_twice;
-                    argname++;
-                }
-            }
-        } else
-            goto invalid_keyword_type;
-        if (kwds2) {
-            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
-        } else {
-            goto invalid_keyword;
-        }
-    }
-    return 0;
-arg_passed_twice:
-    __Pyx_RaiseDoubleKeywordsError(function_name, key);
-    goto bad;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    goto bad;
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-bad:
-    return -1;
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
-    const char* func_name,
-    int exact,
-    Py_ssize_t num_min,
-    Py_ssize_t num_max,
-    Py_ssize_t num_found)
-{
-    Py_ssize_t num_expected;
-    const char *more_or_less;
-    if (num_found < num_min) {
-        num_expected = num_min;
-        more_or_less = "at least";
-    } else {
-        num_expected = num_max;
-        more_or_less = "at most";
-    }
-    if (exact) {
-        more_or_less = "exactly";
-    }
-    PyErr_Format(PyExc_TypeError,
-                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
-                 func_name, more_or_less, num_expected,
-                 (num_expected == 1) ? "" : "s", num_found);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
-    PyErr_Format(PyExc_ValueError,
-                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
-    PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
-                 index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyThreadState *tstate = PyThreadState_GET();
-    PyObject* exc_type = tstate->curexc_type;
-    if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
-            PyObject *exc_value, *exc_tb;
-            exc_value = tstate->curexc_value;
-            exc_tb = tstate->curexc_traceback;
-            tstate->curexc_type = 0;
-            tstate->curexc_value = 0;
-            tstate->curexc_traceback = 0;
-            Py_DECREF(exc_type);
-            Py_XDECREF(exc_value);
-            Py_XDECREF(exc_tb);
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#endif
-}
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
-    if (unlikely(retval)) {
-        Py_DECREF(retval);
-        __Pyx_RaiseTooManyValuesError(expected);
-        return -1;
-    } else {
-        return __Pyx_IterFinish();
-    }
-    return 0;
-}
-
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
-    if (likely(PyList_CheckExact(L))) {
-        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
-    } else {
-        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
-        if (unlikely(!retval))
-            return -1;
-        Py_DECREF(retval);
-    }
-    return 0;
-}
-
-#if !CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
-    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL)
-}
-#endif
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
-    PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
-    result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
-        Py_INCREF(result);
-    } else {
-#else
-    result = PyObject_GetItem(__pyx_d, name);
-    if (!result) {
-        PyErr_Clear();
-#endif
-        result = __Pyx_GetBuiltinName(name);
-    }
-    return result;
-}
-
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
-    PyObject *kwdict,
-    const char* function_name,
-    int kw_allowed)
-{
-    PyObject* key = 0;
-    Py_ssize_t pos = 0;
-#if CPYTHON_COMPILING_IN_PYPY
-    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
-        goto invalid_keyword;
-    return 1;
-#else
-    while (PyDict_Next(kwdict, &pos, &key, 0)) {
-        #if PY_MAJOR_VERSION < 3
-        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
-        #endif
-            if (unlikely(!PyUnicode_Check(key)))
-                goto invalid_keyword_type;
-    }
-    if ((!kw_allowed) && unlikely(key))
-        goto invalid_keyword;
-    return 1;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    return 0;
-#endif
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-    return 0;
-}
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-    if (s1 == s2) {
-        return (equals == Py_EQ);
-    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
-        const char *ps1, *ps2;
-        Py_ssize_t length = PyBytes_GET_SIZE(s1);
-        if (length != PyBytes_GET_SIZE(s2))
-            return (equals == Py_NE);
-        ps1 = PyBytes_AS_STRING(s1);
-        ps2 = PyBytes_AS_STRING(s2);
-        if (ps1[0] != ps2[0]) {
-            return (equals == Py_NE);
-        } else if (length == 1) {
-            return (equals == Py_EQ);
-        } else {
-            int result = memcmp(ps1, ps2, (size_t)length);
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
-        return (equals == Py_NE);
-    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
-        return (equals == Py_NE);
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-#endif
-}
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-#if PY_MAJOR_VERSION < 3
-    PyObject* owned_ref = NULL;
-#endif
-    int s1_is_unicode, s2_is_unicode;
-    if (s1 == s2) {
-        goto return_eq;
-    }
-    s1_is_unicode = PyUnicode_CheckExact(s1);
-    s2_is_unicode = PyUnicode_CheckExact(s2);
-#if PY_MAJOR_VERSION < 3
-    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
-        owned_ref = PyUnicode_FromObject(s2);
-        if (unlikely(!owned_ref))
-            return -1;
-        s2 = owned_ref;
-        s2_is_unicode = 1;
-    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
-        owned_ref = PyUnicode_FromObject(s1);
-        if (unlikely(!owned_ref))
-            return -1;
-        s1 = owned_ref;
-        s1_is_unicode = 1;
-    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
-        return __Pyx_PyBytes_Equals(s1, s2, equals);
-    }
-#endif
-    if (s1_is_unicode & s2_is_unicode) {
-        Py_ssize_t length;
-        int kind;
-        void *data1, *data2;
-        #if CYTHON_PEP393_ENABLED
-        if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
-            return -1;
-        #endif
-        length = __Pyx_PyUnicode_GET_LENGTH(s1);
-        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
-            goto return_ne;
-        }
-        kind = __Pyx_PyUnicode_KIND(s1);
-        if (kind != __Pyx_PyUnicode_KIND(s2)) {
-            goto return_ne;
-        }
-        data1 = __Pyx_PyUnicode_DATA(s1);
-        data2 = __Pyx_PyUnicode_DATA(s2);
-        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
-            goto return_ne;
-        } else if (length == 1) {
-            goto return_eq;
-        } else {
-            int result = memcmp(data1, data2, length * kind);
-            #if PY_MAJOR_VERSION < 3
-            Py_XDECREF(owned_ref);
-            #endif
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & s2_is_unicode) {
-        goto return_ne;
-    } else if ((s2 == Py_None) & s1_is_unicode) {
-        goto return_ne;
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-return_eq:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_EQ);
-return_ne:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_NE);
-#endif
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
-    PyObject *r;
-    if (!j) return NULL;
-    r = PyObject_GetItem(o, j);
-    Py_DECREF(j);
-    return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        PyObject *r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        PyObject *r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (is_list || PyList_CheckExact(o)) {
-        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if ((!boundscheck) || (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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
-        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    } else {
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_item)) {
-            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (likely(l >= 0)) {
-                    i += l;
-                } else {
-                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                        PyErr_Clear();
-                    else
-                        return NULL;
-                }
-            }
-            return m->sq_item(o, i);
-        }
-    }
-#else
-    if (is_list || PySequence_Check(o)) {
-        return PySequence_GetItem(o, i);
-    }
-#endif
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static double __Pyx__PyObject_AsDouble(PyObject* obj) {
-    PyObject* float_value;
-#if CYTHON_COMPILING_IN_PYPY
-    float_value = PyNumber_Float(obj);
-#else
-    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
-    if (likely(nb) && likely(nb->nb_float)) {
-        float_value = nb->nb_float(obj);
-        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
-            PyErr_Format(PyExc_TypeError,
-                "__float__ returned non-float (type %.200s)",
-                Py_TYPE(float_value)->tp_name);
-            Py_DECREF(float_value);
-            goto bad;
-        }
-    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
-#if PY_MAJOR_VERSION >= 3
-        float_value = PyFloat_FromString(obj);
-#else
-        float_value = PyFloat_FromString(obj, 0);
-#endif
-    } else {
-        PyObject* args = PyTuple_New(1);
-        if (unlikely(!args)) goto bad;
-        PyTuple_SET_ITEM(args, 0, obj);
-        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
-        PyTuple_SET_ITEM(args, 0, 0);
-        Py_DECREF(args);
-    }
-#endif
-    if (likely(float_value)) {
-        double value = PyFloat_AS_DOUBLE(float_value);
-        Py_DECREF(float_value);
-        return value;
-    }
-bad:
-    return (double)-1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
-        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
-        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
-        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
-    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
-    if (likely(ms && ms->sq_slice)) {
-        if (!has_cstart) {
-            if (_py_start && (*_py_start != Py_None)) {
-                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
-                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
-            } else
-                cstart = 0;
-        }
-        if (!has_cstop) {
-            if (_py_stop && (*_py_stop != Py_None)) {
-                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
-                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
-            } else
-                cstop = PY_SSIZE_T_MAX;
-        }
-        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
-            Py_ssize_t l = ms->sq_length(obj);
-            if (likely(l >= 0)) {
-                if (cstop < 0) {
-                    cstop += l;
-                    if (cstop < 0) cstop = 0;
-                }
-                if (cstart < 0) {
-                    cstart += l;
-                    if (cstart < 0) cstart = 0;
-                }
-            } else {
-                if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                    PyErr_Clear();
-                else
-                    goto bad;
-            }
-        }
-        return ms->sq_slice(obj, cstart, cstop);
-    }
-#endif
-    mp = Py_TYPE(obj)->tp_as_mapping;
-    if (likely(mp && mp->mp_subscript))
-#endif
-    {
-        PyObject* result;
-        PyObject *py_slice, *py_start, *py_stop;
-        if (_py_slice) {
-            py_slice = *_py_slice;
-        } else {
-            PyObject* owned_start = NULL;
-            PyObject* owned_stop = NULL;
-            if (_py_start) {
-                py_start = *_py_start;
-            } else {
-                if (has_cstart) {
-                    owned_start = py_start = PyInt_FromSsize_t(cstart);
-                    if (unlikely(!py_start)) goto bad;
-                } else
-                    py_start = Py_None;
-            }
-            if (_py_stop) {
-                py_stop = *_py_stop;
-            } else {
-                if (has_cstop) {
-                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
-                    if (unlikely(!py_stop)) {
-                        Py_XDECREF(owned_start);
-                        goto bad;
-                    }
-                } else
-                    py_stop = Py_None;
-            }
-            py_slice = PySlice_New(py_start, py_stop, Py_None);
-            Py_XDECREF(owned_start);
-            Py_XDECREF(owned_stop);
-            if (unlikely(!py_slice)) goto bad;
-        }
-#if CYTHON_COMPILING_IN_CPYTHON
-        result = mp->mp_subscript(obj, py_slice);
-#else
-        result = PyObject_GetItem(obj, py_slice);
-#endif
-        if (!_py_slice) {
-            Py_DECREF(py_slice);
-        }
-        return result;
-    }
-    PyErr_Format(PyExc_TypeError,
-        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
-bad:
-    return NULL;
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
-    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
-    if (start < 0) {
-        start += length;
-        if (start < 0)
-            start = 0;
-    }
-    if (stop < 0)
-        stop += length;
-    else if (stop > length)
-        stop = length;
-    *_length = stop - start;
-    *_start = start;
-    *_stop = stop;
-}
-static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
-    PyObject *v;
-    Py_ssize_t i;
-    for (i = 0; i < length; i++) {
-        v = dest[i] = src[i];
-        Py_INCREF(v);
-    }
-}
-static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
-            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
-    PyObject* dest;
-    Py_ssize_t length = PyList_GET_SIZE(src);
-    __Pyx_crop_slice(&start, &stop, &length);
-    if (unlikely(length <= 0))
-        return PyList_New(0);
-    dest = PyList_New(length);
-    if (unlikely(!dest))
-        return NULL;
-    __Pyx_copy_object_array(
-        ((PyListObject*)src)->ob_item + start,
-        ((PyListObject*)dest)->ob_item,
-        length);
-    return dest;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
-            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
-    PyObject* dest;
-    Py_ssize_t length = PyTuple_GET_SIZE(src);
-    __Pyx_crop_slice(&start, &stop, &length);
-    if (unlikely(length <= 0))
-        return PyTuple_New(0);
-    dest = PyTuple_New(length);
-    if (unlikely(!dest))
-        return NULL;
-    __Pyx_copy_object_array(
-        ((PyTupleObject*)src)->ob_item + start,
-        ((PyTupleObject*)dest)->ob_item,
-        length);
-    return dest;
-}
-#endif
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    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);
-#else
-    PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(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->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);
-#else
-    PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
-    PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
-    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
-    if (!ob)
-        goto bad;
-    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
-        goto bad;
-    Py_DECREF(ob);
-    return 0;
-bad:
-    Py_XDECREF(ob);
-    return -1;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
-    PyObject *empty_list = 0;
-    PyObject *module = 0;
-    PyObject *global_dict = 0;
-    PyObject *empty_dict = 0;
-    PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
-    PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
-    if (!py_import)
-        goto bad;
-    #endif
-    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, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                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);
-                #else
-                module = PyImport_ImportModuleLevelObject(
-                    name, global_dict, empty_dict, list, 1);
-                #endif
-                if (!module) {
-                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
-                        goto bad;
-                    PyErr_Clear();
-                }
-            }
-            level = 0; /* try absolute import on failure */
-        }
-        #endif
-        if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
-            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
-            module = PyImport_ImportModuleLevelObject(
-                name, global_dict, empty_dict, list, level);
-            #endif
-        }
-    }
-    #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:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
-}
-
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
-    {                                                                     \
-        func_type value = func(x);                                        \
-        if (sizeof(target_type) < sizeof(func_type)) {                    \
-            if (unlikely(value != (func_type) (target_type) value)) {     \
-                func_type zero = 0;                                       \
-                PyErr_SetString(PyExc_OverflowError,                      \
-                    (is_unsigned && unlikely(value < zero)) ?             \
-                    "can't convert negative value to " #target_type :     \
-                    "value too large to convert to " #target_type);       \
-                return (target_type) -1;                                  \
-            }                                                             \
-        }                                                                 \
-        return (target_type) value;                                       \
-    }
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            return (int) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            if (sizeof(int) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
-            } else if (sizeof(int) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int) -1;
-        }
-    } else {
-        int val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int) -1;
-        val = __Pyx_PyInt_As_int(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int),
-                                     little, !is_unsigned);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(long) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long) -1;
-            }
-            if (sizeof(long) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(long) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(long) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
-            } else if (sizeof(long) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            long val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (long) -1;
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long) -1;
-        val = __Pyx_PyInt_As_long(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(long) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(long) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(long),
-                                     little, !is_unsigned);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
-    const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(uint32_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint32_t");
-                return (uint32_t) -1;
-            }
-            return (uint32_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint32_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (uint32_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint32_t");
-                return (uint32_t) -1;
-            }
-            if (sizeof(uint32_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint32_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(uint32_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(uint32_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(uint32_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(uint32_t, long, PyLong_AsLong)
-            } else if (sizeof(uint32_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(uint32_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            uint32_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (uint32_t) -1;
-        }
-    } else {
-        uint32_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (uint32_t) -1;
-        val = __Pyx_PyInt_As_uint32_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
-    const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(uint32_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(uint32_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint32_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
-                                     little, !is_unsigned);
-    }
-}
-
-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;
-}
-
-#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
-
-#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_ssize_t basicsize;
-#ifdef Py_LIMITED_API
-    PyObject *py_basicsize;
-#endif
-    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,
-            "%.200s.%.200s is not a type object",
-            module_name, class_name);
-        goto bad;
-    }
-#ifndef Py_LIMITED_API
-    basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
-    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
-    if (!py_basicsize)
-        goto bad;
-    basicsize = PyLong_AsSsize_t(py_basicsize);
-    Py_DECREF(py_basicsize);
-    py_basicsize = 0;
-    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
-        goto bad;
-#endif
-    if (!strict && (size_t)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)basicsize != size) {
-        PyErr_Format(PyExc_ValueError,
-            "%.200s.%.200s 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
-
-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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
-    Py_ssize_t ignore;
-    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
-            }
-        }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-        return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
-    } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
-#if !CYTHON_COMPILING_IN_PYPY
-#if PY_VERSION_HEX >= 0x02060000
-    if (PyByteArray_Check(o)) {
-        *length = PyByteArray_GET_SIZE(o);
-        return PyByteArray_AS_STRING(o);
-    } else
-#endif
-#endif
-    {
-        char* result;
-        int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (unlikely(r < 0)) {
-            return NULL;
-        } else {
-            return result;
-        }
-    }
-}
-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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
-    if (!PyLong_Check(res)) {
-#endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (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;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
-  Py_ssize_t ival;
-  PyObject *x;
-#if PY_MAJOR_VERSION < 3
-  if (likely(PyInt_CheckExact(b)))
-      return PyInt_AS_LONG(b);
-#endif
-  if (likely(PyLong_CheckExact(b))) {
-    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-     #if CYTHON_USE_PYLONG_INTERNALS
-       switch (Py_SIZE(b)) {
-       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
-       case  0: return 0;
-       case  1: return ((PyLongObject*)b)->ob_digit[0];
-       }
-     #endif
-    #endif
-  #if PY_VERSION_HEX < 0x02060000
-    return PyInt_AsSsize_t(b);
-  #else
-    return PyLong_AsSsize_t(b);
-  #endif
-  }
-  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
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/pysam/calignmentfile.c b/pysam/calignmentfile.c
deleted file mode 100644
index 8924bf6..0000000
--- a/pysam/calignmentfile.c
+++ /dev/null
@@ -1,48377 +0,0 @@
-/* Generated by Cython 0.20.1 on Fri Nov 21 21:18:01 2014 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#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
-#define CYTHON_ABI "0_20_1"
-#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 Py_OptimizeFlag 0
-#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 CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #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"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-  #define __Pyx_DefaultClassType PyClass_Type
-#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)
-  #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #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 < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
-  #define Py_TPFLAGS_IS_ABSTRACT 0
-#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
-  #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
-  #define CYTHON_PEP393_ENABLED 1
-  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
-                                              0 : _PyUnicode_Ready((PyObject *)(op)))
-  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
-  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
-  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
-  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
-  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
-#else
-  #define CYTHON_PEP393_ENABLED 0
-  #define __Pyx_PyUnicode_READY(op)       (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]))
-  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
-  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
-  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
-#else
-  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
-      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
-#else
-  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
-#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_MAJOR_VERSION >= 3
-  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
-  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#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
-  #define PyNumber_Int                 PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyBoolObject                 PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x030200A4
-  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
-#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
-#ifndef CYTHON_RESTRICT
-  #if defined(__GNUC__)
-    #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER) && _MSC_VER >= 1400
-    #define CYTHON_RESTRICT __restrict
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_RESTRICT restrict
-  #else
-    #define CYTHON_RESTRICT
-  #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
-  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
-   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
-   a quiet NaN. */
-  float value;
-  memset(&value, 0xFF, sizeof(value));
-  return value;
-}
-#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__pysam__calignmentfile
-#define __PYX_HAVE_API__pysam__calignmentfile
-#include "stdint.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
-#include "zlib.h"
-#include "htslib/kstring.h"
-#include "htslib/hfile.h"
-#include "htslib/bgzf.h"
-#include "htslib/hts.h"
-#include "htslib/sam.h"
-#include "pysam_stream.h"
-#include "htslib/faidx.h"
-#include "htslib/tbx.h"
-#include "htslib_util.h"
-#include "samfile_util.h"
-#include "pythread.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#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 Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
-    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
-    (sizeof(type) > sizeof(Py_ssize_t) &&               \
-          likely(v < (type)PY_SSIZE_T_MAX ||            \
-                 v == (type)PY_SSIZE_T_MAX)  &&         \
-          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
-                                v == (type)PY_SSIZE_T_MIN)))  ||  \
-    (sizeof(type) == sizeof(Py_ssize_t) &&              \
-          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
-                               v == (type)PY_SSIZE_T_MAX)))  )
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString        PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
-    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
-    const Py_UNICODE *u_end = u;
-    while (*u_end++) ;
-    return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
-#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);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    PyObject* ascii_chars_u = NULL;
-    PyObject* ascii_chars_b = NULL;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
-        __Pyx_sys_getdefaultencoding_not_ascii = 0;
-    } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
-        char ascii_chars[128];
-        int c;
-        for (c = 0; c < 128; c++) {
-            ascii_chars[c] = c;
-        }
-        __Pyx_sys_getdefaultencoding_not_ascii = 1;
-        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
-        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
-            PyErr_Format(
-                PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
-                default_encoding_c);
-            goto bad;
-        }
-    }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    char* default_encoding_c;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
-    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
-    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
-    Py_DECREF(default_encoding);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    return -1;
-}
-#endif
-#endif
-
-
-#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_d;
-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[] = {
-  "calignmentfile.pyx",
-  "array.pxd",
-  "cfaidx.pxd",
-  "type.pxd",
-  "bool.pxd",
-  "complex.pxd",
-};
-
-/*--- Type declarations ---*/
-#ifndef _ARRAYARRAY_H
-struct arrayobject;
-typedef struct arrayobject arrayobject;
-#endif
-struct __pyx_obj_5pysam_6cfaidx_FastaFile;
-struct __pyx_obj_5pysam_6cfaidx_FastqProxy;
-struct __pyx_obj_5pysam_6cfaidx_FastqFile;
-struct __pyx_obj_5pysam_6cfaidx_Fastafile;
-struct __pyx_obj_5pysam_6cfaidx_Fastqfile;
-struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment;
-struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile;
-struct __pyx_obj_5pysam_14calignmentfile_PileupColumn;
-struct __pyx_obj_5pysam_14calignmentfile_PileupRead;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRow;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs;
-struct __pyx_obj_5pysam_14calignmentfile_IndexedReads;
-struct __pyx_obj_5pysam_14calignmentfile_SNPCall;
-struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr;
-struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr;
-struct __pyx_t_5pysam_14calignmentfile___iterdata;
-typedef struct __pyx_t_5pysam_14calignmentfile___iterdata __pyx_t_5pysam_14calignmentfile___iterdata;
-struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag;
-struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData;
-struct __pyx_opt_args_5pysam_14calignmentfile__getTypeCode;
-
-/* "pysam/calignmentfile.pxd":53
- * # Utility types
- * 
- * ctypedef struct __iterdata:             # <<<<<<<<<<<<<<
- *     htsFile * htsfile
- *     bam_hdr_t * header
- */
-struct __pyx_t_5pysam_14calignmentfile___iterdata {
-  htsFile *htsfile;
-  bam_hdr_t *header;
-  hts_itr_t *iter;
-  faidx_t *fastafile;
-  int tid;
-  char *seq;
-  int seq_len;
-};
-
-/* "pysam/calignmentfile.pxd":72
- *     # add an alignment tag with value to the AlignedSegment
- *     # an existing tag of the same name will be replaced.
- *     cpdef setTag( self, tag, value, value_type = ?, replace = ? )             # <<<<<<<<<<<<<<
- * 
- * cdef class AlignmentFile:
- */
-struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag {
-  int __pyx_n;
-  PyObject *value_type;
-  PyObject *replace;
-};
-
-/* "pysam/calignmentfile.pxd":179
- *     cdef char * getSequence( self )
- *     cdef setMask(self, mask)
- *     cdef setupIteratorData(self,             # <<<<<<<<<<<<<<
- *                            int tid,
- *                            int start,
- */
-struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData {
-  int __pyx_n;
-  int multiple_iterators;
-};
-
-/* "pysam/calignmentfile.pyx":2069
- * 
- * 
- * cdef inline uint8_t _getTypeCode(value, value_type = None):             # <<<<<<<<<<<<<<
- *     '''guess type code for a *value*. If *value_type* is None,
- *     the type code will be inferred based on the Python type of
- */
-struct __pyx_opt_args_5pysam_14calignmentfile__getTypeCode {
-  int __pyx_n;
-  PyObject *value_type;
-};
-
-/* "cfaidx.pxd":14
- *         char *s
- * 
- * cdef class FastaFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename, _references, _lengths, reference2length
- *     cdef faidx_t* fastafile
- */
-struct __pyx_obj_5pysam_6cfaidx_FastaFile {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile *__pyx_vtab;
-  PyObject *_filename;
-  PyObject *_references;
-  PyObject *_lengths;
-  PyObject *reference2length;
-  faidx_t *fastafile;
-};
-
-
-/* "cfaidx.pxd":21
- * 
- * 
- * cdef class FastqProxy:             # <<<<<<<<<<<<<<
- *     cdef kseq_t * _delegate
- * 
- */
-struct __pyx_obj_5pysam_6cfaidx_FastqProxy {
-  PyObject_HEAD
-  kseq_t *_delegate;
-};
-
-
-/* "cfaidx.pxd":25
- * 
- * 
- * cdef class FastqFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename
- *     cdef gzFile fastqfile
- */
-struct __pyx_obj_5pysam_6cfaidx_FastqFile {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile *__pyx_vtab;
-  PyObject *_filename;
-  gzFile fastqfile;
-  kseq_t *entry;
-};
-
-
-/* "cfaidx.pxd":35
- * 
- * # Compatibility Layer for pysam < 0.8
- * cdef class Fastafile(FastaFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6cfaidx_Fastafile {
-  struct __pyx_obj_5pysam_6cfaidx_FastaFile __pyx_base;
-};
-
-
-/* "cfaidx.pxd":38
- *     pass
- * 
- * cdef class Fastqfile(FastqFile):             # <<<<<<<<<<<<<<
- *     pass
- */
-struct __pyx_obj_5pysam_6cfaidx_Fastqfile {
-  struct __pyx_obj_5pysam_6cfaidx_FastqFile __pyx_base;
-};
-
-
-/* "pysam/calignmentfile.pxd":65
- * #
- * # Note: need to declare all C fields and methods here
- * cdef class AlignedSegment:             # <<<<<<<<<<<<<<
- * 
- *     # object that this AlignedSegment represents
- */
-struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment *__pyx_vtab;
-  bam1_t *_delegate;
-};
-
-
-/* "pysam/calignmentfile.pxd":74
- *     cpdef setTag( self, tag, value, value_type = ?, replace = ? )
- * 
- * cdef class AlignmentFile:             # <<<<<<<<<<<<<<
- * 
- *     cdef object _filename
- */
-struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *__pyx_vtab;
-  PyObject *_filename;
-  htsFile *htsfile;
-  BGZF *fp;
-  hts_idx_t *index;
-  bam_hdr_t *header;
-  int isbam;
-  int isstream;
-  int isremote;
-  bam1_t *b;
-  char *mode;
-  int64_t start_offset;
-};
-
-
-/* "pysam/calignmentfile.pxd":111
- *     cdef char * _getrname(self, int tid)
- * 
- * cdef class PileupColumn:             # <<<<<<<<<<<<<<
- *     cdef bam_pileup1_t ** plp
- *     cdef int tid
- */
-struct __pyx_obj_5pysam_14calignmentfile_PileupColumn {
-  PyObject_HEAD
-  bam_pileup1_t **plp;
-  int tid;
-  int pos;
-  int n_pu;
-};
-
-
-/* "pysam/calignmentfile.pxd":117
- *     cdef int n_pu
- * 
- * cdef class PileupRead:             # <<<<<<<<<<<<<<
- *     cdef AlignedSegment _alignment
- *     cdef int32_t  _qpos
- */
-struct __pyx_obj_5pysam_14calignmentfile_PileupRead {
-  PyObject_HEAD
-  struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *_alignment;
-  int32_t _qpos;
-  int _indel;
-  int _level;
-  uint32_t _is_del;
-  uint32_t _is_head;
-  uint32_t _is_tail;
-};
-
-
-/* "pysam/calignmentfile.pxd":126
- *     cdef uint32_t _is_tail
- * 
- * cdef class IteratorRow:             # <<<<<<<<<<<<<<
- *     cdef int retval
- *     cdef bam1_t * b
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRow {
-  PyObject_HEAD
-  int retval;
-  bam1_t *b;
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
-  htsFile *htsfile;
-  bam_hdr_t *header;
-  int owns_samfile;
-};
-
-
-/* "pysam/calignmentfile.pxd":134
- *     cdef int owns_samfile
- * 
- * cdef class IteratorRowRegion(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef hts_itr_t * iter
- *     cdef bam1_t * getCurrent( self )
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion *__pyx_vtab;
-  hts_itr_t *iter;
-};
-
-
-/* "pysam/calignmentfile.pxd":139
- *     cdef int cnext(self)
- * 
- * cdef class IteratorRowHead(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef int max_rows
- *     cdef int current_row
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead *__pyx_vtab;
-  int max_rows;
-  int current_row;
-};
-
-
-/* "pysam/calignmentfile.pxd":145
- *     cdef int cnext(self)
- * 
- * cdef class IteratorRowAll(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef bam1_t * getCurrent( self )
- *     cdef int cnext(self)
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll *__pyx_vtab;
-};
-
-
-/* "pysam/calignmentfile.pxd":149
- *     cdef int cnext(self)
- * 
- * cdef class IteratorRowAllRefs(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef int         tid
- *     cdef IteratorRowRegion rowiter
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  int tid;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *rowiter;
-};
-
-
-/* "pysam/calignmentfile.pxd":153
- *     cdef IteratorRowRegion rowiter
- * 
- * cdef class IteratorRowSelection(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef int current_pos
- *     cdef positions
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection *__pyx_vtab;
-  int current_pos;
-  PyObject *positions;
-  BGZF *fp;
-};
-
-
-/* "pysam/calignmentfile.pxd":160
- *     cdef BGZF * fp
- * 
- * cdef class IteratorColumn:             # <<<<<<<<<<<<<<
- * 
- *     # result of the last plbuf_push
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn *__pyx_vtab;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *iter;
-  int tid;
-  int pos;
-  int n_plp;
-  int mask;
-  bam_pileup1_t *plp;
-  bam_plp_t pileup_iter;
-  __pyx_t_5pysam_14calignmentfile___iterdata iterdata;
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
-  struct __pyx_obj_5pysam_6cfaidx_Fastafile *fastafile;
-  PyObject *stepper;
-  int max_depth;
-};
-
-
-/* "pysam/calignmentfile.pxd":188
- *     cdef _free_pileup_iter(self)
- * 
- * cdef class IteratorColumnRegion(IteratorColumn):             # <<<<<<<<<<<<<<
- *     cdef int start
- *     cdef int end
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn __pyx_base;
-  int start;
-  int end;
-  int truncate;
-};
-
-
-/* "pysam/calignmentfile.pxd":193
- *     cdef int truncate
- * 
- * cdef class IteratorColumnAllRefs(IteratorColumn):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn __pyx_base;
-};
-
-
-/* "pysam/calignmentfile.pxd":196
- *     pass
- * 
- * cdef class IndexedReads:             # <<<<<<<<<<<<<<
- *     cdef AlignmentFile samfile
- *     cdef htsFile * htsfile
- */
-struct __pyx_obj_5pysam_14calignmentfile_IndexedReads {
-  PyObject_HEAD
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
-  htsFile *htsfile;
-  PyObject *index;
-  int owns_samfile;
-  BGZF *fp;
-  bam_hdr_t *header;
-};
-
-
-/* "pysam/calignmentfile.pyx":3530
- * 
- * 
- * cdef class SNPCall:             # <<<<<<<<<<<<<<
- *     '''the results of a SNP call.'''
- *     cdef int _tid
- */
-struct __pyx_obj_5pysam_14calignmentfile_SNPCall {
-  PyObject_HEAD
-  int _tid;
-  int _pos;
-  char _reference_base;
-  char _genotype;
-  int _consensus_quality;
-  int _snp_quality;
-  int _rms_mapping_quality;
-  int _coverage;
-};
-
-
-/* "pysam/calignmentfile.pyx":110
- * cdef char* CODE2CIGAR= "MIDNSHP=X"
- * if IS_PYTHON3:
- *     CIGAR2CODE = dict( [y,x] for x,y in enumerate( CODE2CIGAR) )             # <<<<<<<<<<<<<<
- * else:
- *     CIGAR2CODE = dict( [ord(y),x] for x,y in enumerate( CODE2CIGAR) )
- */
-struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr {
-  PyObject_HEAD
-  PyObject *__pyx_v_x;
-  PyObject *__pyx_v_y;
-  PyObject *__pyx_t_0;
-  PyObject *__pyx_t_1;
-  PyObject *(*__pyx_t_2)(PyObject *);
-};
-
-
-/* "pysam/calignmentfile.pyx":112
- *     CIGAR2CODE = dict( [y,x] for x,y in enumerate( CODE2CIGAR) )
- * else:
- *     CIGAR2CODE = dict( [ord(y),x] for x,y in enumerate( CODE2CIGAR) )             # <<<<<<<<<<<<<<
- * CIGAR_REGEX = re.compile( "(\d+)([MIDNSHP=X])" )
- * 
- */
-struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr {
-  PyObject_HEAD
-  PyObject *__pyx_v_x;
-  PyObject *__pyx_v_y;
-  PyObject *__pyx_t_0;
-  PyObject *__pyx_t_1;
-  PyObject *(*__pyx_t_2)(PyObject *);
-};
-
-
-
-/* "cfaidx.pxd":14
- *         char *s
- * 
- * cdef class FastaFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename, _references, _lengths, reference2length
- *     cdef faidx_t* fastafile
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile {
-  char *(*_fetch)(struct __pyx_obj_5pysam_6cfaidx_FastaFile *, char *, int, int, int *);
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile *__pyx_vtabptr_5pysam_6cfaidx_FastaFile;
-
-
-/* "cfaidx.pxd":25
- * 
- * 
- * cdef class FastqFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename
- *     cdef gzFile fastqfile
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile {
-  kseq_t *(*getCurrent)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *);
-  int (*cnext)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *);
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile *__pyx_vtabptr_5pysam_6cfaidx_FastqFile;
-
-
-/* "cfaidx.pxd":35
- * 
- * # Compatibility Layer for pysam < 0.8
- * cdef class Fastafile(FastaFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile {
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile *__pyx_vtabptr_5pysam_6cfaidx_Fastafile;
-
-
-/* "cfaidx.pxd":38
- *     pass
- * 
- * cdef class Fastqfile(FastqFile):             # <<<<<<<<<<<<<<
- *     pass
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile {
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile *__pyx_vtabptr_5pysam_6cfaidx_Fastqfile;
-
-
-/* "pysam/calignmentfile.pyx":2176
- * ###########################################################
- * ###########################################################
- * cdef class AlignedSegment:             # <<<<<<<<<<<<<<
- *     '''Class representing an aligned segment.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment {
-  PyObject *(*setTag)(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag *__pyx_optional_args);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment *__pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment;
-
-
-/* "pysam/calignmentfile.pyx":235
- * 
- * 
- * cdef class AlignmentFile:             # <<<<<<<<<<<<<<
- *     '''*(filename, mode=None, template = None,
- *          referencenames=None, referencelengths = None,
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile {
-  bam_hdr_t *(*_buildHeader)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, PyObject *);
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *);
-  int (*write)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *, int __pyx_skip_dispatch);
-  char *(*_getrname)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, int);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *__pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile;
-
-
-/* "pysam/calignmentfile.pyx":1345
- * 
- * 
- * cdef class IteratorRowRegion(IteratorRow):             # <<<<<<<<<<<<<<
- *     """*(AlignmentFile samfile, int tid, int beg, int end,
- *     int multiple_iterators=False)*
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion {
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion;
-
-
-/* "pysam/calignmentfile.pyx":1396
- *         hts_itr_destroy(self.iter)
- * 
- * cdef class IteratorRowHead(IteratorRow):             # <<<<<<<<<<<<<<
- *     """*(AlignmentFile samfile, n, int multiple_iterators=False)*
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead {
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead;
-
-
-/* "pysam/calignmentfile.pyx":1445
- * 
- * 
- * cdef class IteratorRowAll(IteratorRow):             # <<<<<<<<<<<<<<
- *     """*(AlignmentFile samfile, int multiple_iterators=False)*
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll {
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll;
-
-
-/* "pysam/calignmentfile.pyx":1552
- * 
- * 
- * cdef class IteratorRowSelection(IteratorRow):             # <<<<<<<<<<<<<<
- *     """*(AlignmentFile samfile)*
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection {
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection;
-
-
-/* "pysam/calignmentfile.pyx":1694
- *     return ret
- * 
- * cdef class IteratorColumn:             # <<<<<<<<<<<<<<
- *     '''abstract base class for iterators over columns.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn {
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
-  char *(*getSequence)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
-  PyObject *(*setMask)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, PyObject *);
-  PyObject *(*setupIteratorData)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, int, int, int, struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData *__pyx_optional_args);
-  PyObject *(*reset)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, PyObject *, PyObject *, PyObject *);
-  PyObject *(*_free_pileup_iter)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn;
-
-
-/* "pysam/calignmentfile.pyx":1885
- * 
- * 
- * cdef class IteratorColumnRegion(IteratorColumn):             # <<<<<<<<<<<<<<
- *     '''iterates over a region only.
- *     '''
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion {
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion;
-
-
-/* "pysam/calignmentfile.pyx":1923
- * 
- * 
- * cdef class IteratorColumnAllRefs(IteratorColumn):             # <<<<<<<<<<<<<<
- *     """iterates over all columns by chaining iterators over each reference
- *     """
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs {
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs;
-#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_XDECREF_SET(r, v) do {                            \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_XDECREF(tmp);                              \
-    } while (0)
-#define __Pyx_DECREF_SET(r, v) do {                             \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_DECREF(tmp);                               \
-    } while (0)
-#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)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_getattro))
-        return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_getattr))
-        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
-    return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-#ifndef CYTHON_PROFILE
-  #define CYTHON_PROFILE 1
-#endif
-#ifndef CYTHON_TRACE
-  #define CYTHON_TRACE 0
-#endif
-#if CYTHON_TRACE
-  #undef CYTHON_PROFILE_REUSE_FRAME
-#endif
-#ifndef CYTHON_PROFILE_REUSE_FRAME
-  #define CYTHON_PROFILE_REUSE_FRAME 0
-#endif
-#if CYTHON_PROFILE || CYTHON_TRACE
-  #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_CLEAR(__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 || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc)))) {      \
-      __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 || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc))) {  \
-      PyThreadState* tstate = PyThreadState_GET();                                         \
-      tstate->use_tracing = 0;                                                             \
-      PyObject *exc_info = __Pyx_GetExceptionTuple();                                      \
-      if (exc_info) {                                                                      \
-          if (CYTHON_TRACE && tstate->c_tracefunc)                                         \
-              tstate->c_tracefunc(                                                         \
-                  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);          \
-          tstate->c_profilefunc(                                                           \
-              tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);            \
-          Py_DECREF(exc_info);                                                             \
-      }                                                                                    \
-      tstate->use_tracing = 1;                                                             \
-  }
-  #define __Pyx_TraceReturn(result)                                                  \
-  if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing) {             \
-      PyThreadState* tstate = PyThreadState_GET();                                   \
-      tstate->use_tracing = 0;                                                        \
-      if (CYTHON_TRACE && tstate->c_tracefunc)                                       \
-          tstate->c_tracefunc(                                                       \
-              tstate->c_traceobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);  \
-      if (tstate->c_profilefunc)                                                     \
-          tstate->c_profilefunc(                                                     \
-              tstate->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);  \
-      CYTHON_FRAME_DEL;                                                              \
-      tstate->use_tracing = 1;                                                       \
-  }
-  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 */
-#if CYTHON_TRACE
-  #define __Pyx_TraceLine(lineno)                                                          \
-  if (unlikely(__Pyx_use_tracing) && unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_tracefunc)) {    \
-      PyThreadState* tstate = PyThreadState_GET();                                         \
-      __pyx_frame->f_lineno = lineno;                                                     \
-      tstate->use_tracing = 0;                                                             \
-      tstate->c_tracefunc(tstate->c_traceobj, __pyx_frame, PyTrace_LINE, NULL);           \
-      tstate->use_tracing = 1;                                                             \
-  }
-#else
-  #define __Pyx_TraceLine(lineno)
-#endif
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
-#else
-#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
-#endif
-
-#include <string.h>
-
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
-         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
-         const char* encoding, const char* errors,
-         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
-
-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 int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
-
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
-    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
-#else
-#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
-#endif
-
-#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
-    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
-               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck);
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len)) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
-#endif
-
-static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
-    PyObject *method, *result = NULL;
-    if (unlikely(!args)) return NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto bad;
-    result = __Pyx_PyObject_Call(method, args, NULL);
-    Py_DECREF(method);
-bad:
-    Py_DECREF(args);
-    return result;
-}
-#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
-#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
-#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
-#define __Pyx_PyObject_CallMethod0(obj, name) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))
-
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/
-
-#if PY_MAJOR_VERSION < 3
-#define __Pyx_PyString_Join __Pyx_PyBytes_Join
-#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
-#else
-#define __Pyx_PyString_Join PyUnicode_Join
-#define __Pyx_PyBaseString_Join PyUnicode_Join
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
-    #if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyBytes_Join _PyString_Join
-    #else
-    #define __Pyx_PyBytes_Join _PyBytes_Join
-    #endif
-#else
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/
-#endif
-
-static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
-    int result = PySequence_Contains(seq, item);
-    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
-        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
-        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
-        int has_cstart, int has_cstop, int wraparound);
-
-static void __Pyx_WriteUnraisable(const char *name, int clineno,
-                                  int lineno, const char *filename,
-                                  int full_traceback); /*proto*/
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
-    int result = PyDict_Contains(dict, item);
-    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-#if PY_MAJOR_VERSION >= 3
-static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
-    PyObject *value;
-    value = PyDict_GetItemWithError(d, key);
-    if (unlikely(!value)) {
-        if (!PyErr_Occurred()) {
-            PyObject* args = PyTuple_Pack(1, key);
-            if (likely(args))
-                PyErr_SetObject(PyExc_KeyError, args);
-            Py_XDECREF(args);
-        }
-        return NULL;
-    }
-    Py_INCREF(value);
-    return value;
-}
-#else
-    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
-#endif
-
-static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /*proto*/
-
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
-
-static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
-
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
-static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_setattro))
-        return tp->tp_setattro(obj, attr_name, value);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_setattr))
-        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
-#endif
-    return PyObject_SetAttr(obj, attr_name, value);
-}
-#else
-#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
-#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
-#endif
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-static void* __Pyx_GetVtable(PyObject *dict); /*proto*/
-
-#ifndef _ARRAYARRAY_H
-#define _ARRAYARRAY_H
-typedef struct arraydescr {
-    int typecode;
-    int itemsize;
-    PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
-    int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
-#if PY_VERSION_HEX >= 0x03000000
-    char *formats;
-#endif
-} arraydescr;
-struct arrayobject {
-    PyObject_HEAD
-    Py_ssize_t ob_size;
-    union {
-        char *ob_item;
-        float *as_floats;
-        double *as_doubles;
-        int *as_ints;
-        unsigned int *as_uints;
-        unsigned char *as_uchars;
-        signed char *as_schars;
-        char *as_chars;
-        unsigned long *as_ulongs;
-        long *as_longs;
-        short *as_shorts;
-        unsigned short *as_ushorts;
-        Py_UNICODE *as_pyunicodes;
-        void *as_voidptr;
-    } data;
-    Py_ssize_t allocated;
-    struct arraydescr *ob_descr;
-    PyObject *weakreflist; /* List of weak references */
-#if PY_VERSION_HEX >= 0x03000000
-        int ob_exports;  /* Number of exported buffers */
-#endif
-};
-#ifndef NO_NEWARRAY_INLINE
-static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
-    struct arraydescr *descr) {
-    arrayobject *op;
-    size_t nbytes;
-    if (size < 0) {
-        PyErr_BadInternalCall();
-        return NULL;
-    }
-    nbytes = size * descr->itemsize;
-    if (nbytes / descr->itemsize != (size_t)size) {
-        return PyErr_NoMemory();
-    }
-    op = (arrayobject *) type->tp_alloc(type, 0);
-    if (op == NULL) {
-        return NULL;
-    }
-    op->ob_descr = descr;
-    op->allocated = size;
-    op->weakreflist = NULL;
-    op->ob_size = size;
-    if (size <= 0) {
-        op->data.ob_item = NULL;
-    }
-    else {
-        op->data.ob_item = PyMem_NEW(char, nbytes);
-        if (op->data.ob_item == NULL) {
-            Py_DECREF(op);
-            return PyErr_NoMemory();
-        }
-    }
-    return (PyObject *) op;
-}
-#else
-PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
-    struct arraydescr *descr);
-#endif /* ifndef NO_NEWARRAY_INLINE */
-static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
-    void *items = (void*) self->data.ob_item;
-    PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
-    if (items == NULL) {
-        PyErr_NoMemory();
-        return -1;
-    }
-    self->data.ob_item = (char*) items;
-    self->ob_size = n;
-    self->allocated = n;
-    return 0;
-}
-static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
-    void *items = (void*) self->data.ob_item;
-    Py_ssize_t newsize;
-    if (n < self->allocated) {
-        if (n*4 > self->allocated) {
-            self->ob_size = n;
-            return 0;
-        }
-    }
-    newsize = n  * 3 / 2 + 1;
-    PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
-    if (items == NULL) {
-        PyErr_NoMemory();
-        return -1;
-    }
-    self->data.ob_item = (char*) items;
-    self->ob_size = n;
-    self->allocated = newsize;
-    return 0;
-}
-#endif
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value);
-
-static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);
-
-static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *);
-
-static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *);
-
-static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-#define __Pyx_Generator_USED
-#include <structmember.h>
-#include <frameobject.h>
-typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
-typedef struct {
-    PyObject_HEAD
-    __pyx_generator_body_t body;
-    PyObject *closure;
-    PyObject *exc_type;
-    PyObject *exc_value;
-    PyObject *exc_traceback;
-    PyObject *gi_weakreflist;
-    PyObject *classobj;
-    PyObject *yieldfrom;
-    int resume_label;
-    char is_running;
-} __pyx_GeneratorObject;
-static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
-                                                  PyObject *closure);
-static int __pyx_Generator_init(void);
-static int __Pyx_Generator_clear(PyObject* self);
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
-#else
-#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
-#endif
-
-static int __Pyx_check_binary_version(void);
-
-#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 PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*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 'libc.stdint' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdlib' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'pysam.chtslib' */
-
-/* Module declarations from 'pysam.cfaidx' */
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastaFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastqProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastqFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_Fastafile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_Fastqfile = 0;
-
-/* Module declarations from 'cpython.version' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'cpython.exc' */
-
-/* Module declarations from 'cpython.module' */
-
-/* Module declarations from 'cpython.mem' */
-
-/* Module declarations from 'cpython.tuple' */
-
-/* Module declarations from 'cpython.list' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from 'cpython.sequence' */
-
-/* Module declarations from 'cpython.mapping' */
-
-/* Module declarations from 'cpython.iterator' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'cpython.number' */
-
-/* Module declarations from 'cpython.int' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.bool' */
-static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
-
-/* Module declarations from 'cpython.long' */
-
-/* Module declarations from 'cpython.float' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.complex' */
-static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
-
-/* Module declarations from 'cpython.string' */
-
-/* Module declarations from 'cpython.unicode' */
-
-/* Module declarations from 'cpython.dict' */
-
-/* Module declarations from 'cpython.instance' */
-
-/* Module declarations from 'cpython.function' */
-
-/* Module declarations from 'cpython.method' */
-
-/* Module declarations from 'cpython.weakref' */
-
-/* Module declarations from 'cpython.getargs' */
-
-/* Module declarations from 'cpython.pythread' */
-
-/* Module declarations from 'cpython.pystate' */
-
-/* Module declarations from 'cpython.cobject' */
-
-/* Module declarations from 'cpython.oldbuffer' */
-
-/* Module declarations from 'cpython.set' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.bytes' */
-
-/* Module declarations from 'cpython.pycapsule' */
-
-/* Module declarations from 'cpython' */
-
-/* Module declarations from 'array' */
-
-/* Module declarations from 'cpython.array' */
-static PyTypeObject *__pyx_ptype_7cpython_5array_array = 0;
-static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/
-
-/* Module declarations from 'pysam.calignmentfile' */
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_AlignedSegment = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_AlignmentFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_PileupColumn = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_PileupRead = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRow = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowHead = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumn = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IndexedReads = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_SNPCall = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile___pyx_scope_struct__genexpr = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr = 0;
-static PyObject *__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING = 0;
-static char *__pyx_v_5pysam_14calignmentfile_CODE2CIGAR;
-static int __pyx_v_5pysam_14calignmentfile_max_pos;
-static PyObject *__pyx_f_5pysam_14calignmentfile_from_string_and_size(char *, size_t); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile__encodeFilename(PyObject *); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile__forceBytes(PyObject *); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile__charptr_to_str(char *); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile__forceStr(PyObject *); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile_makeAlignedSegment(bam1_t *); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile_makePileupColumn(bam_pileup1_t **, int, int, int); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile_makePileupRead(bam_pileup1_t *); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile_convertBinaryTagToList(uint8_t *); /*proto*/
-static int __pyx_f_5pysam_14calignmentfile___advance_nofilter(void *, bam1_t *); /*proto*/
-static int __pyx_f_5pysam_14calignmentfile___advance_all(void *, bam1_t *); /*proto*/
-static int __pyx_f_5pysam_14calignmentfile___advance_snpcalls(void *, bam1_t *); /*proto*/
-static CYTHON_INLINE int32_t __pyx_f_5pysam_14calignmentfile__getQueryStart(bam1_t *); /*proto*/
-static CYTHON_INLINE int32_t __pyx_f_5pysam_14calignmentfile__getQueryEnd(bam1_t *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_14calignmentfile__getSequenceRange(bam1_t *, uint32_t, uint32_t); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_14calignmentfile__getQualitiesRange(bam1_t *, uint32_t, uint32_t); /*proto*/
-static CYTHON_INLINE uint8_t __pyx_f_5pysam_14calignmentfile__getTypeCode(PyObject *, struct __pyx_opt_args_5pysam_14calignmentfile__getTypeCode *__pyx_optional_args); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_14calignmentfile_convert_python_tag(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
-#define __Pyx_MODULE_NAME "pysam.calignmentfile"
-int __pyx_module_is_main_pysam__calignmentfile = 0;
-
-/* Implementation of 'pysam.calignmentfile' */
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_enumerate;
-static PyObject *__pyx_builtin_ord;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_IOError;
-static PyObject *__pyx_builtin_OverflowError;
-static PyObject *__pyx_builtin_NotImplementedError;
-static PyObject *__pyx_builtin_OSError;
-static PyObject *__pyx_builtin_AttributeError;
-static PyObject *__pyx_builtin_zip;
-static PyObject *__pyx_builtin_sorted;
-static PyObject *__pyx_builtin_KeyError;
-static PyObject *__pyx_builtin_StopIteration;
-static PyObject *__pyx_builtin_chr;
-static PyObject *__pyx_builtin_min;
-static PyObject *__pyx_builtin_max;
-static PyObject *__pyx_builtin_map;
-static PyObject *__pyx_builtin_MemoryError;
-static PyObject *__pyx_pf_5pysam_14calignmentfile_4genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_13AlignmentFile___cinit__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_2_isOpen(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_4_hasIndex(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6_open(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_template, PyObject *__pyx_v_referencenames, PyObject *__pyx_v_referencelengths, PyObject *__pyx_v_text, PyObject *__pyx_v_header, PyObject *__pyx_v_port, PyObject *__pyx_v_add_sq_text, PyObject *__pyx_v_check_header, PyObject *__pyx_ [...]
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8gettid(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_10getrname(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_tid); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_12_parseRegion(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_tid); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_14reset(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_16seek(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, uint64_t __pyx_v_offset, int __pyx_v_where); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_18tell(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_20fetch(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_tid, PyObject *__pyx_v_callback, PyObject *__pyx_v_until_eof, PyObject *__pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_22head(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_24mate(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_read); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_26count(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_until_eof); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_28pileup(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_30close(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_32__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_34write(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_read); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_36__enter__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_38__exit__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8filename___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_11nreferences___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_10references___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_7lengths___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6mapped___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_40_checkIndex(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8unmapped___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_12nocoordinate___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_4text___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6header___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_42_buildLine(CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_record); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_44__iter__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_46__next__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_11IteratorRow___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_multiple_iterators); /* proto */
-static void __pyx_pf_5pysam_14calignmentfile_11IteratorRow_2__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_tid, int __pyx_v_beg, int __pyx_v_end, int __pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_4__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_6__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_15IteratorRowHead___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_n, int __pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_15IteratorRowHead_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_15IteratorRowHead_4__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14IteratorRowAll___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorRowAll_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorRowAll_4__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, PyObject *__pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_2nextiter(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_4__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, PyObject *__pyx_v_positions, int __pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection_4__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14IteratorColumn___cinit__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorColumn_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorColumn_7seq_len___get__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorColumn_4addReference(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self, struct __pyx_obj_5pysam_6cfaidx_Fastafile *__pyx_v_fastafile); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorColumn_6hasReference(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_14calignmentfile_14IteratorColumn_8__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_20IteratorColumnRegion___cinit__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_tid, int __pyx_v_start, int __pyx_v_end, int __pyx_v_truncate, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_21IteratorColumnAllRefs___cinit__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_toQualityString(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_qualities); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_2fromQualityString(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_quality_string); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment___init__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_2__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4__str__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6compare(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_other); /* proto */
-static Py_hash_t __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8__hash__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10query_name___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10query_name_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_qname); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4flag___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4flag_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12reference_id___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12reference_id_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tid); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15reference_start___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15reference_start_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_pos); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_qual); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigarstring___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_cigar); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_mtid); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_mpos); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12query_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15template_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15template_length_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_isize); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14query_sequence___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_seq); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15query_qualities___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_qual); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tags___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tags_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tags); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3bin___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3bin_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_bin); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_paired___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_paired_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10is_reverse___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read1___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read1_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read2___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read2_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_secondary___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_13reference_end___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16reference_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_22query_alignment_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_24query_alignment_sequence___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_25query_alignment_qualities___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_21query_alignment_start___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_19query_alignment_end___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_21query_aligment_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10get_reference_positions(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_full_length); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12infer_query_length(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_always); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14get_aligned_pairs(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16get_blocks(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_18get_overlap(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, uint32_t __pyx_v_start, uint32_t __pyx_v_end); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigartuples___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20setTag(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value, PyObject *__pyx_v_value_type, PyObject *__pyx_v_replace); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_22opt(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qname___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qname_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3tid___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3tid_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3pos___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3pos_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mapq___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mapq_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rnext___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rnext_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5pnext___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5pnext_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5cigar___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5cigar_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tlen___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tlen_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3seq___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3seq_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qual___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qual_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4alen___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4alen_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4aend___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4aend_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4rlen___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4rlen_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5query___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5query_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qqual___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qqual_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6qstart___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6qstart_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qend___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qend_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qlen___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qlen_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mrnm___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mrnm_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mpos___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mpos_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rname___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rname_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5isize___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5isize_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6blocks___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_13aligned_pairs___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15inferred_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9positions___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_24overlap(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn___init__(CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_2__str__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_12reference_id___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_9nsegments___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn_9nsegments_2__set__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_13reference_pos___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_7pileups___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_3pos___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn_3pos_2__set__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_3tid___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn_3tid_2__set__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_1n___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn_1n_2__set__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_10PileupRead___init__(CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_2__str__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_9alignment___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_14query_position___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_5indel___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_5level___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_6is_del___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_7is_head___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_7is_tail___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_10is_refskip___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_3tid___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_3pos___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_14reference_base___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_8genotype___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_17consensus_quality___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_11snp_quality___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_15mapping_quality___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_8coverage___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall___str__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_14calignmentfile_12IndexedReads___init__(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12IndexedReads_2build(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12IndexedReads_4find(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *__pyx_v_self, PyObject *__pyx_v_query_name); /* proto */
-static void __pyx_pf_5pysam_14calignmentfile_12IndexedReads_6__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *__pyx_v_self); /* proto */
-static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
-static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_AlignedSegment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_AlignmentFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_PileupColumn(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_PileupRead(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRow(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowRegion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowHead(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowAll(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowAllRefs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowSelection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorColumn(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorColumnRegion(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorColumnAllRefs(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IndexedReads(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_SNPCall(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_A[] = "A";
-static char __pyx_k_B[] = "B";
-static char __pyx_k_C[] = "C";
-static char __pyx_k_D[] = "D";
-static char __pyx_k_F[] = "F";
-static char __pyx_k_H[] = "H";
-static char __pyx_k_I[] = "I";
-static char __pyx_k_S[] = "S";
-static char __pyx_k_Z[] = "Z";
-static char __pyx_k_b[] = "b";
-static char __pyx_k_c[] = "c";
-static char __pyx_k_d[] = "d";
-static char __pyx_k_f[] = "f";
-static char __pyx_k_h[] = "h";
-static char __pyx_k_i[] = "i";
-static char __pyx_k_n[] = "n";
-static char __pyx_k_r[] = "r";
-static char __pyx_k_s[] = "@%s";
-static char __pyx_k_w[] = "w";
-static char __pyx_k_x[] = "x";
-static char __pyx_k_AS[] = "AS";
-static char __pyx_k_CL[] = "CL";
-static char __pyx_k_CN[] = "CN";
-static char __pyx_k_CO[] = "CO";
-static char __pyx_k_DS[] = "DS";
-static char __pyx_k_DT[] = "DT";
-static char __pyx_k_FO[] = "FO";
-static char __pyx_k_GO[] = "GO";
-static char __pyx_k_HD[] = "HD";
-static char __pyx_k_ID[] = "ID";
-static char __pyx_k_KS[] = "KS";
-static char __pyx_k_LB[] = "LB";
-static char __pyx_k_LN[] = "LN";
-static char __pyx_k_M5[] = "M5";
-static char __pyx_k_PG[] = "PG";
-static char __pyx_k_PI[] = "PI";
-static char __pyx_k_PL[] = "PL";
-static char __pyx_k_PN[] = "PN";
-static char __pyx_k_PP[] = "PP";
-static char __pyx_k_PU[] = "PU";
-static char __pyx_k_RG[] = "RG";
-static char __pyx_k_SM[] = "SM";
-static char __pyx_k_SN[] = "SN";
-static char __pyx_k_SO[] = "SO";
-static char __pyx_k_SP[] = "SP";
-static char __pyx_k_SQ[] = "SQ";
-static char __pyx_k_UR[] = "UR";
-static char __pyx_k_VN[] = "VN";
-static char __pyx_k__4[] = "-";
-static char __pyx_k__7[] = "";
-static char __pyx_k_os[] = "os";
-static char __pyx_k_rU[] = "rU";
-static char __pyx_k_rb[] = "rb";
-static char __pyx_k_re[] = "re";
-static char __pyx_k_wb[] = "wb";
-static char __pyx_k_wh[] = "wh";
-static char __pyx_k__12[] = "[:-]";
-static char __pyx_k__38[] = "\n";
-static char __pyx_k__40[] = "@";
-static char __pyx_k__43[] = "\t";
-static char __pyx_k__47[] = ":";
-static char __pyx_k__74[] = "<";
-static char __pyx_k_all[] = "all";
-static char __pyx_k_bai[] = ".bai";
-static char __pyx_k_beg[] = "beg";
-static char __pyx_k_c_2[] = "%c";
-static char __pyx_k_chr[] = "chr";
-static char __pyx_k_end[] = "end";
-static char __pyx_k_ftp[] = "ftp:";
-static char __pyx_k_get[] = "get";
-static char __pyx_k_i_c[] = "%i%c";
-static char __pyx_k_map[] = "map";
-static char __pyx_k_max[] = "max";
-static char __pyx_k_min[] = "min";
-static char __pyx_k_ord[] = "ord";
-static char __pyx_k_pos[] = "pos";
-static char __pyx_k_raw[] = "raw";
-static char __pyx_k_s_2[] = "s";
-static char __pyx_k_s_s[] = "%s:%s";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_tag[] = "tag";
-static char __pyx_k_tid[] = "tid";
-static char __pyx_k_wb0[] = "wb0";
-static char __pyx_k_wbu[] = "wbu";
-static char __pyx_k_zip[] = "zip";
-static char __pyx_k_2scB[] = "2scB";
-static char __pyx_k_2scH[] = "2scH";
-static char __pyx_k_2scI[] = "2scI";
-static char __pyx_k_2scb[] = "2scb";
-static char __pyx_k_2scc[] = "2scc";
-static char __pyx_k_2scf[] = "2scf";
-static char __pyx_k_2sch[] = "2sch";
-static char __pyx_k_2sci[] = "2sci";
-static char __pyx_k_Zidf[] = "Zidf";
-static char __pyx_k_args[] = "args";
-static char __pyx_k_flag[] = "flag";
-static char __pyx_k_http[] = "http:";
-static char __pyx_k_init[] = "__init__";
-static char __pyx_k_join[] = "join";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_mode[] = "mode";
-static char __pyx_k_open[] = "_open";
-static char __pyx_k_path[] = "path";
-static char __pyx_k_port[] = "port";
-static char __pyx_k_seek[] = "seek";
-static char __pyx_k_send[] = "send";
-static char __pyx_k_tags[] = "tags";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_text[] = "text";
-static char __pyx_k_warn[] = "warn";
-static char __pyx_k_all_2[] = "__all__";
-static char __pyx_k_array[] = "array";
-static char __pyx_k_ascii[] = "ascii";
-static char __pyx_k_close[] = "close";
-static char __pyx_k_fetch[] = "fetch";
-static char __pyx_k_indel[] = "indel";
-static char __pyx_k_items[] = "items";
-static char __pyx_k_level[] = "level";
-static char __pyx_k_split[] = "split";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_strip[] = "strip";
-static char __pyx_k_throw[] = "throw";
-static char __pyx_k_types[] = "types";
-static char __pyx_k_value[] = "value";
-static char __pyx_k_where[] = "where";
-static char __pyx_k_write[] = "write";
-static char __pyx_k_2sc_is[] = "2sc%is";
-static char __pyx_k_always[] = "always";
-static char __pyx_k_append[] = "append";
-static char __pyx_k_ctypes[] = "ctypes";
-static char __pyx_k_decode[] = "decode";
-static char __pyx_k_encode[] = "encode";
-static char __pyx_k_exists[] = "exists";
-static char __pyx_k_extend[] = "extend";
-static char __pyx_k_fields[] = "fields";
-static char __pyx_k_gettid[] = "gettid";
-static char __pyx_k_header[] = "header";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_isOpen[] = "_isOpen";
-static char __pyx_k_is_del[] = "is_del";
-static char __pyx_k_offset[] = "offset";
-static char __pyx_k_record[] = "record";
-static char __pyx_k_region[] = "region";
-static char __pyx_k_setTag[] = "setTag";
-static char __pyx_k_sorted[] = "sorted";
-static char __pyx_k_struct[] = "struct";
-static char __pyx_k_IOError[] = "IOError";
-static char __pyx_k_OSError[] = "OSError";
-static char __pyx_k_compile[] = "compile";
-static char __pyx_k_findall[] = "findall";
-static char __pyx_k_is_head[] = "is_head";
-static char __pyx_k_is_tail[] = "is_tail";
-static char __pyx_k_islower[] = "islower";
-static char __pyx_k_isupper[] = "isupper";
-static char __pyx_k_lengths[] = "lengths";
-static char __pyx_k_pileups[] = "pileups";
-static char __pyx_k_replace[] = "replace";
-static char __pyx_k_samfile[] = "samfile";
-static char __pyx_k_stepper[] = "stepper";
-static char __pyx_k_KeyError[] = "KeyError";
-static char __pyx_k_calcsize[] = "calcsize";
-static char __pyx_k_callback[] = "callback";
-static char __pyx_k_check_sq[] = "check_sq";
-static char __pyx_k_coverage[] = "coverage";
-static char __pyx_k_exc_type[] = "exc_type";
-static char __pyx_k_filename[] = "filename";
-static char __pyx_k_genotype[] = "genotype";
-static char __pyx_k_hasIndex[] = "_hasIndex";
-static char __pyx_k_nextiter[] = "nextiter";
-static char __pyx_k_nofilter[] = "nofilter";
-static char __pyx_k_platform[] = "platform";
-static char __pyx_k_samtools[] = "samtools";
-static char __pyx_k_tempfile[] = "tempfile";
-static char __pyx_k_template[] = "template";
-static char __pyx_k_truncate[] = "truncate";
-static char __pyx_k_warnings[] = "warnings";
-static char __pyx_k_2sccI_i_s[] = "2sccI%i%s";
-static char __pyx_k_MIDNSHP_X[] = "MIDNSHP=X";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_alignment[] = "alignment";
-static char __pyx_k_buildLine[] = "_buildLine";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_exc_value[] = "exc_value";
-static char __pyx_k_fastafile[] = "fastafile";
-static char __pyx_k_itertools[] = "itertools";
-static char __pyx_k_max_depth[] = "max_depth";
-static char __pyx_k_nsegments[] = "nsegments";
-static char __pyx_k_pack_into[] = "pack_into";
-static char __pyx_k_positions[] = "positions";
-static char __pyx_k_qualities[] = "qualities";
-static char __pyx_k_reference[] = "reference";
-static char __pyx_k_traceback[] = "traceback";
-static char __pyx_k_until_eof[] = "until_eof";
-static char __pyx_k_CIGAR2CODE[] = "CIGAR2CODE";
-static char __pyx_k_IS_PYTHON3[] = "IS_PYTHON3";
-static char __pyx_k_PileupRead[] = "PileupRead";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_checkIndex[] = "_checkIndex";
-static char __pyx_k_get_blocks[] = "get_blocks";
-static char __pyx_k_is_refskip[] = "is_refskip";
-static char __pyx_k_nsegmentes[] = "nsegmentes";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_query_name[] = "query_name";
-static char __pyx_k_references[] = "references";
-static char __pyx_k_startswith[] = "startswith";
-static char __pyx_k_value_type[] = "value_type";
-static char __pyx_k_CIGAR_REGEX[] = "CIGAR_REGEX";
-static char __pyx_k_IteratorRow[] = "IteratorRow";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_add_sq_text[] = "add_sq_text";
-static char __pyx_k_cigarstring[] = "cigarstring";
-static char __pyx_k_cigartuples[] = "cigartuples";
-static char __pyx_k_collections[] = "collections";
-static char __pyx_k_d_MIDNSHP_X[] = "(\\d+)([MIDNSHP=X])";
-static char __pyx_k_defaultdict[] = "defaultdict";
-static char __pyx_k_full_length[] = "full_length";
-static char __pyx_k_get_overlap[] = "get_overlap";
-static char __pyx_k_nreferences[] = "nreferences";
-static char __pyx_k_parseRegion[] = "_parseRegion";
-static char __pyx_k_snp_quality[] = "snp_quality";
-static char __pyx_k_IndexedReads[] = "IndexedReads";
-static char __pyx_k_PileupColumn[] = "PileupColumn";
-static char __pyx_k_SQ_SN_s_LN_s[] = "@SQ\tSN:%s\tLN:%s\n";
-static char __pyx_k_check_header[] = "check_header";
-static char __pyx_k_is_refskip_2[] = "_is_refskip";
-static char __pyx_k_query_length[] = "query_length";
-static char __pyx_k_reference_id[] = "reference_id";
-static char __pyx_k_AlignmentFile[] = "AlignmentFile";
-static char __pyx_k_Invalid_tag_s[] = "Invalid tag: %s";
-static char __pyx_k_OverflowError[] = "OverflowError";
-static char __pyx_k_StopIteration[] = "StopIteration";
-static char __pyx_k_VALID_HEADERS[] = "VALID_HEADERS";
-static char __pyx_k_reference_end[] = "reference_end";
-static char __pyx_k_reference_pos[] = "reference_pos";
-static char __pyx_k_AlignedSegment[] = "AlignedSegment";
-static char __pyx_k_AttributeError[] = "AttributeError";
-static char __pyx_k_IteratorColumn[] = "IteratorColumn";
-static char __pyx_k_mate_not_found[] = "mate not found";
-static char __pyx_k_properties_bin[] = "properties bin";
-static char __pyx_k_quality_string[] = "quality_string";
-static char __pyx_k_query_position[] = "query_position";
-static char __pyx_k_query_sequence[] = "query_sequence";
-static char __pyx_k_reference_base[] = "reference_base";
-static char __pyx_k_referencenames[] = "referencenames";
-static char __pyx_k_truncated_file[] = "truncated file";
-static char __pyx_k_unknown_type_s[] = "unknown type '%s'";
-static char __pyx_k_mapping_quality[] = "mapping_quality";
-static char __pyx_k_properties_flag[] = "properties flag";
-static char __pyx_k_query_qualities[] = "query_qualities";
-static char __pyx_k_reference_start[] = "reference_start";
-static char __pyx_k_template_length[] = "template_length";
-static char __pyx_k_toQualityString[] = "toQualityString";
-static char __pyx_k_file_s_not_found[] = "file `%s` not found";
-static char __pyx_k_read_s_not_found[] = "read %s not found";
-static char __pyx_k_reference_length[] = "reference_length";
-static char __pyx_k_referencelengths[] = "referencelengths";
-static char __pyx_k_consensus_quality[] = "consensus_quality";
-static char __pyx_k_fromQualityString[] = "fromQualityString";
-static char __pyx_k_get_aligned_pairs[] = "get_aligned_pairs";
-static char __pyx_k_mapping_quality_2[] = "mapping quality";
-static char __pyx_k_next_reference_id[] = "next_reference_id";
-static char __pyx_k_tag_s_not_present[] = "tag '%s' not present";
-static char __pyx_k_VALID_HEADER_ORDER[] = "VALID_HEADER_ORDER";
-static char __pyx_k_VALID_HEADER_TYPES[] = "VALID_HEADER_TYPES";
-static char __pyx_k_end_out_of_range_i[] = "end out of range (%i)";
-static char __pyx_k_getdefaultencoding[] = "getdefaultencoding";
-static char __pyx_k_infer_query_length[] = "infer_query_length";
-static char __pyx_k_mate_s_is_unmapped[] = "mate %s: is unmapped";
-static char __pyx_k_multiple_iterators[] = "multiple_iterators";
-static char __pyx_k_read_s_is_unpaired[] = "read %s: is unpaired";
-static char __pyx_k_true_if_QC_failure[] = "true if QC failure";
-static char __pyx_k_NotImplementedError[] = "NotImplementedError";
-static char __pyx_k_VALID_HEADER_FIELDS[] = "VALID_HEADER_FIELDS";
-static char __pyx_k_invalid_reference_s[] = "invalid reference `%s`";
-static char __pyx_k_query_alignment_end[] = "query_alignment_end";
-static char __pyx_k_the_genotype_called[] = "the genotype called.";
-static char __pyx_k_create_string_buffer[] = "create_string_buffer";
-static char __pyx_k_next_reference_start[] = "next_reference_start";
-static char __pyx_k_pysam_calignmentfile[] = "pysam.calignmentfile";
-static char __pyx_k_start_out_of_range_i[] = "start out of range (%i)";
-static char __pyx_k_could_not_open_file_s[] = "could not open file `%s`";
-static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding";
-static char __pyx_k_header_line_without_s[] = "header line without '@': '%s'";
-static char __pyx_k_query_alignment_start[] = "query_alignment_start";
-static char __pyx_k_true_if_this_is_read1[] = "true if this is read1";
-static char __pyx_k_true_if_this_is_read2[] = "true if this is read2";
-static char __pyx_k_error_during_iteration[] = "error during iteration";
-static char __pyx_k_query_alignment_length[] = "query_alignment_length";
-static char __pyx_k_current_sequence_length[] = "current sequence length.";
-static char __pyx_k_get_reference_positions[] = "get_reference_positions";
-static char __pyx_k_query_alignment_sequence[] = "query_alignment_sequence";
-static char __pyx_k_query_alignment_qualities[] = "query_alignment_qualities";
-static char __pyx_k_unknown_auxilliary_type_s[] = "unknown auxilliary type '%s'";
-static char __pyx_k_nucleotide_position_of_SNP[] = "nucleotide position of SNP.";
-static char __pyx_k_tid_i_out_of_range_0_tid_i[] = "tid %i out of range 0<=tid<%i";
-static char __pyx_k_unable_to_open_index_for_s[] = "unable to open index for `%s` ";
-static char __pyx_k_0_based_leftmost_coordinate[] = "0-based leftmost coordinate";
-static char __pyx_k_error_while_opening_index_s[] = "error while opening index `%s` ";
-static char __pyx_k_invalid_file_opening_mode_s[] = "invalid file opening mode `%s`";
-static char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file";
-static char __pyx_k_callback_not_implemented_yet[] = "callback not implemented yet";
-static char __pyx_k_no_index_available_for_fetch[] = "no index available for fetch";
-static char __pyx_k_seek_no_available_in_streams[] = "seek no available in streams";
-static char __pyx_k_true_if_the_mate_is_unmapped[] = "true if the mate is unmapped";
-static char __pyx_k_no_index_available_for_pileup[] = "no index available for pileup";
-static char __pyx_k_true_if_not_primary_alignment[] = "true if not primary alignment";
-static char __pyx_k_home_andreas_devel_pysam_pysam[] = "/home/andreas/devel/pysam/pysam/calignmentfile.pyx";
-static char __pyx_k_at_least_one_signed_integer_out[] = "at least one signed integer out of range of BAM/SAM specification";
-static char __pyx_k_fetch_called_on_bamfile_without[] = "fetch called on bamfile without index";
-static char __pyx_k_file_does_not_have_valid_header[] = "file does not have valid header (mode='%s') - is it BAM format?";
-static char __pyx_k_header_line_with_invalid_type_s[] = "header line with invalid type '%s': '%s'";
-static char __pyx_k_incomplete_sequence_information[] = "incomplete sequence information in '%s'";
-static char __pyx_k_invalid_coordinates_start_i_end[] = "invalid coordinates: start (%i) > end (%i)";
-static char __pyx_k_malformatted_header_no_in_field[] = "malformatted header: no ':' in field";
-static char __pyx_k_number_of_reads_mapping_to_this[] = "number of reads mapping to this column.";
-static char __pyx_k_quality_and_sequence_mismatch_i[] = "quality and sequence mismatch: %i != %i";
-static char __pyx_k_term_reference_ID_note_This_fie[] = ":term:`reference` ID\n\n        .. note::\n\n            This field contains the index of the reference sequence in\n            the sequence dictionary. To obtain the name of the\n            reference sequence, use\n            :meth:`pysam.AlignmentFile.getrname()`\n\n        ";
-static char __pyx_k_the_chromosome_ID_as_is_defined[] = "the chromosome ID as is defined in the header";
-static char __pyx_k_the_query_template_name_None_if[] = "the query template name (None if not present)";
-static char __pyx_k_the_root_mean_square_rms_of_the[] = "the root mean square (rms) of the mapping quality of all reads\n       involved in the call.";
-static char __pyx_k_true_if_read_itself_is_unmapped[] = "true if read itself is unmapped";
-static char __pyx_k_1_iff_the_base_on_the_padded_rea[] = "1 iff the base on the padded read is a deletion";
-static char __pyx_k_AlignmentFile_mapped_only_availa[] = "AlignmentFile.mapped only available in bam files";
-static char __pyx_k_Argument_must_be_string_bytes_or[] = "Argument must be string, bytes or unicode.";
-static char __pyx_k_Argument_must_be_string_or_unico[] = "Argument must be string or unicode.";
-static char __pyx_k_Invalid_clipping_in_CIGAR_string[] = "Invalid clipping in CIGAR string";
-static char __pyx_k_PileupColumn_accessed_after_iter[] = "PileupColumn accessed after iterator finished";
-static char __pyx_k_Unsupported_value_type_in_set_op[] = "Unsupported value_type in set_option";
-static char __pyx_k_a_class_pysam_AlignedSegment_obj[] = "a :class:`pysam.AlignedSegment` object of the aligned read";
-static char __pyx_k_aligned_length_of_the_read_on_th[] = "aligned length of the read on the reference genome.\n\n        This is equal to `aend - pos`. Returns None if not available.";
-static char __pyx_k_aligned_portion_of_the_read_This[] = "aligned portion of the read.\n\n        This is a substring of :attr:`seq` that excludes flanking\n        bases that were :term:`soft clipped` (None if not present). It\n        is equal to ``seq[qstart:qend]``.\n\n        SAM/BAM files may include extra flanking bases that are not\n        part of the alignment.  These bases may be the result of the\n        Smith-Waterman or other algorithms, which may not require\n        alig [...]
-static char __pyx_k_aligned_query_sequence_quality_v[] = "aligned query sequence quality values (None if not present). These\n        are the quality values that correspond to :attr:`query`, that\n        is, they exclude qualities of :term:`soft clipped` bases. This\n        is equal to ``qual[qstart:qend]``.\n\n        Quality scores are returned as a python array of unsigned\n        chars. Note that this is not the ASCII-encoded value typically\n        seen in FASTQ or SAM formatted [...]
-static char __pyx_k_aligned_reference_position_of_th[] = "aligned reference position of the read on the reference genome.  \n        \n        aend points to one past the last aligned residue.\n        Returns None if not available.";
-static char __pyx_k_at_least_one_integer_out_of_rang[] = "at least one integer out of range of BAM/SAM specification";
-static char __pyx_k_can_not_iterate_over_samfile_wit[] = "can not iterate over samfile without header";
-static char __pyx_k_can_only_IndexReads_on_bam_files[] = "can only IndexReads on bam files";
-static char __pyx_k_can_t_guess_type_or_invalid_type[] = "can't guess type or invalid type code specified";
-static char __pyx_k_could_not_open_file_mode_s_is_it[] = "could not open file (mode='%s') - is it SAM/BAM format?";
-static char __pyx_k_coverage_or_read_depth_the_numbe[] = "coverage or read depth - the number of reads involved in the call.";
-static char __pyx_k_either_supply_options_template_h[] = "either supply options `template`, `header` or  both `referencenames` and `referencelengths` for writing";
-static char __pyx_k_end_index_of_the_aligned_query_p[] = "end index of the aligned query portion of the sequence (0-based,\n        exclusive)";
-static char __pyx_k_fetch_called_for_htsfile_without[] = "fetch called for htsfile without header";
-static char __pyx_k_fetching_by_region_is_not_availa[] = "fetching by region is not available for sam files";
-static char __pyx_k_file_header_is_empty_mode_s_is_i[] = "file header is empty (mode='%s') - is it SAM/BAM format?";
-static char __pyx_k_full_contents_of_the_term_sam_fi[] = "full contents of the :term:`sam file` header as a string\n    \n        See :attr:`pysam.AlignmentFile.header` to get a parsed\n        representation of the header.\n\n        ";
-static char __pyx_k_header_information_within_the_te[] = "header information within the :term:`sam file`. The records and\n        fields are returned as a two-level dictionary. \n\n        The first level contains the record (``HD``, ``SQ``, etc) and\n        the second level contains the fields (``VN``, ``LN``, etc).\n        \n        The parser is validating and will raise an AssertionError if\n        if encounters any record or field tags that are not part of\n        the SAM speci [...]
-static char __pyx_k_indel_length_0_for_no_indel_posi[] = "indel length; 0 for no indel, positive for ins and negative            for del";
-static char __pyx_k_integer_i_out_of_range_of_BAM_SA[] = "integer %i out of range of BAM/SAM specification";
-static char __pyx_k_invalid_type_for_record_s_s_expe[] = "invalid type for record %s: %s, expected %s";
-static char __pyx_k_length_of_the_aligned_query_sequ[] = "length of the aligned query sequence.\n\n        This is equal to :attr:`qend` - :attr:`qstart`";
-static char __pyx_k_length_of_the_query_template_Thi[] = "length of the query template. This includes soft-clipped bases\n        and is equal to ``len(seq)``.\n\n        This property is read-only.\n\n        Returns 0 if not available.";
-static char __pyx_k_list_of_reads_class_pysam_Pileup[] = "list of reads (:class:`pysam.PileupRead`) aligned to this column";
-static char __pyx_k_mapping_information_not_recorded[] = "mapping information not recorded in index or index not available";
-static char __pyx_k_multiple_s_lines_are_not_permitt[] = "multiple '%s' lines are not permitted";
-static char __pyx_k_no_index_available_for_iteration[] = "no index available for iteration";
-static char __pyx_k_number_of_term_filename_associat[] = "number of :term:`filename` associated with this object.";
-static char __pyx_k_number_of_term_reference_sequenc[] = "number of :term:`reference` sequences in the file.";
-static char __pyx_k_pileup_of_samfiles_not_implement[] = "pileup of samfiles not implemented yet";
-static char __pyx_k_position_of_the_read_base_at_the[] = "position of the read base at the pileup site, 0-based";
-static char __pyx_k_read_sequence_base_qualities_inc[] = "read sequence base qualities, including :term:`soft\n        clipped` bases (None if not present).\n\n        Quality scores are returned as a python array of unsigned\n        chars. Note that this is not the ASCII-encoded value typically\n        seen in FASTQ or SAM formatted files. Thus, no offset of 33\n        needs to be subtracted.\n\n        Note that to set quality scores the sequence has to be set\n        beforehand as [...]
-static char __pyx_k_read_sequence_bases_including_te[] = "read sequence bases, including :term:`soft clipped` bases \n        (None if not present).\n\n        Note that assigning to seq will invalidate any quality scores.\n        Thus, to in-place edit the sequence and quality scores, copies of\n        the quality scores need to be taken. Consider trimming for example::\n\n           q = read.qual\n           read.seq = read.seq[5:10]\n           read.qual = q[5:10]\n\n        The seq [...]
-static char __pyx_k_reference_base_at_pos_N_if_no_re[] = "reference base at pos. ``N`` if no reference sequence supplied.";
-static char __pyx_k_reference_id_i_out_of_range_0_ti[] = "reference_id %i out of range 0<=tid<%i";
-static char __pyx_k_reference_sequence_for_s_tid_i_n[] = "reference sequence for '%s' (tid=%i) not found";
-static char __pyx_k_seek_only_available_in_bam_files[] = "seek only available in bam files";
-static char __pyx_k_start_index_of_the_aligned_query[] = "start index of the aligned query portion of the sequence (0-based,\n        inclusive).\n\n        This the index of the first base in :attr:`seq` that is not\n        soft-clipped.\n\n        ";
-static char __pyx_k_the_genotype_quality_Phred_scale[] = "the genotype quality (Phred-scaled).";
-static char __pyx_k_the_length_of_the_query_read_Thi[] = "the length of the query/read.\n\n        This value corresponds to the length of the sequence supplied\n        in the BAM/SAM file. The length of a query is 0 if there is no\n        sequence in the BAM/SAM file. In those cases, the read length\n        can be inferred from the CIGAR alignment, see\n        :meth:`pysam.AlignmentFile.infer_query_length.`.\n\n        This property can be set by providing a sequence.\n        ";
-static char __pyx_k_the_level_of_the_read_in_the_vie[] = "the level of the read in the \"viewer\" mode";
-static char __pyx_k_the_observed_query_template_leng[] = "the observed query template length";
-static char __pyx_k_the_position_in_the_reference_se[] = "the position in the reference sequence (0-based).";
-static char __pyx_k_the_position_of_the_mate_next_re[] = "the position of the mate/next read.";
-static char __pyx_k_the_reference_sequence_number_as[] = "the reference sequence number as defined in the header";
-static char __pyx_k_the_snp_quality_Phred_scaled_pro[] = "the snp quality (Phred scaled) - probability of consensus being\n       identical to reference sequence.";
-static char __pyx_k_the_tags_in_the_AUX_field_This_p[] = "the tags in the AUX field.\n\n        This property permits convenience access to\n        the tags. Changes it the returned list will\n        not update the tags automatically. Instead,\n        the following is required for adding a\n        new tag::\n\n            read.tags = read.tags + [(\"RG\",0)]\n\n        This method will happily write the same tag\n        multiple times.\n        ";
-static char __pyx_k_the_term_cigar_alignment_The_ali[] = "the :term:`cigar` alignment. The alignment\n        is returned as a list of tuples of (operation, length). \n\n        If the alignment is not present, None is returned.\n\n        The operations are:\n\n        +-----+--------------+-----+\n        |M    |BAM_CMATCH    |0    |\n        +-----+--------------+-----+\n        |I    |BAM_CINS      |1    |\n        +-----+--------------+-----+\n        |D    |BAM_CDEL      |2    |\n  [...]
-static char __pyx_k_the_term_cigar_alignment_as_a_st[] = "the :term:`cigar` alignment as a string.\n        \n        The cigar string is a string of alternating integers\n        and characters denoting the length and the type of\n        an operation.\n\n        .. note::\n            The order length,operation is specified in the\n            SAM format. It is different from the order of\n            the :attr:`cigar` property.\n\n        Returns None if not present.\n\n        To uns [...]
-static char __pyx_k_the_term_reference_id_of_the_mat[] = "the :term:`reference` id of the mate/next read.";
-static char __pyx_k_this_class_cannot_be_instantiate[] = "this class cannot be instantiated from Python";
-static char __pyx_k_total_number_of_mapped_alignment[] = "total number of mapped alignments in file.\n        ";
-static char __pyx_k_total_number_of_reads_without_co[] = "total number of reads without coordinates\n        ";
-static char __pyx_k_total_number_of_unmapped_reads_i[] = "total number of unmapped reads in file.\n        ";
-static char __pyx_k_true_if_optical_or_PCR_duplicate[] = "true if optical or PCR duplicate";
-static char __pyx_k_true_if_read_is_mapped_in_a_prop[] = "true if read is mapped in a proper pair";
-static char __pyx_k_true_if_read_is_mapped_to_revers[] = "true if read is mapped to reverse strand";
-static char __pyx_k_true_if_read_is_paired_in_sequen[] = "true if read is paired in sequencing";
-static char __pyx_k_true_is_read_is_mapped_to_revers[] = "true is read is mapped to reverse strand";
-static char __pyx_k_tuple_of_the_lengths_of_the_term[] = "tuple of the lengths of the :term:`reference` sequences. The\n        lengths are in the same order as\n        :attr:`pysam.AlignmentFile.references`\n\n        ";
-static char __pyx_k_tuple_with_the_names_of_term_ref[] = "tuple with the names of :term:`reference` sequences.";
-static char __pyx_k_unequal_names_and_lengths_of_ref[] = "unequal names and lengths of reference sequences";
-static char __pyx_k_unknown_field_code_s_in_record_s[] = "unknown field code '%s' in record '%s'";
-static char __pyx_k_unknown_stepper_option_s_in_Iter[] = "unknown stepper option `%s` in IteratorColumn";
-static char __pyx_k_file_does_not_have_valid_header_2[] = "file does not have valid header (mode='%s') - is it SAM format?";
-static PyObject *__pyx_kp_s_2scB;
-static PyObject *__pyx_kp_s_2scH;
-static PyObject *__pyx_kp_s_2scI;
-static PyObject *__pyx_kp_s_2sc_is;
-static PyObject *__pyx_kp_s_2scb;
-static PyObject *__pyx_kp_s_2scc;
-static PyObject *__pyx_kp_s_2sccI_i_s;
-static PyObject *__pyx_kp_s_2scf;
-static PyObject *__pyx_kp_s_2sch;
-static PyObject *__pyx_kp_s_2sci;
-static PyObject *__pyx_n_s_A;
-static PyObject *__pyx_n_s_AS;
-static PyObject *__pyx_n_s_AlignedSegment;
-static PyObject *__pyx_n_s_AlignmentFile;
-static PyObject *__pyx_kp_s_AlignmentFile_mapped_only_availa;
-static PyObject *__pyx_kp_u_Argument_must_be_string_bytes_or;
-static PyObject *__pyx_kp_u_Argument_must_be_string_or_unico;
-static PyObject *__pyx_n_s_AttributeError;
-static PyObject *__pyx_n_s_B;
-static PyObject *__pyx_n_s_C;
-static PyObject *__pyx_n_s_CIGAR2CODE;
-static PyObject *__pyx_n_s_CIGAR_REGEX;
-static PyObject *__pyx_n_s_CL;
-static PyObject *__pyx_n_s_CN;
-static PyObject *__pyx_n_s_CO;
-static PyObject *__pyx_n_s_D;
-static PyObject *__pyx_n_s_DS;
-static PyObject *__pyx_n_s_DT;
-static PyObject *__pyx_n_s_F;
-static PyObject *__pyx_n_s_FO;
-static PyObject *__pyx_n_s_GO;
-static PyObject *__pyx_n_s_H;
-static PyObject *__pyx_n_s_HD;
-static PyObject *__pyx_n_s_I;
-static PyObject *__pyx_n_s_ID;
-static PyObject *__pyx_n_s_IOError;
-static PyObject *__pyx_n_s_IS_PYTHON3;
-static PyObject *__pyx_kp_s_I_O_operation_on_closed_file;
-static PyObject *__pyx_n_s_IndexedReads;
-static PyObject *__pyx_kp_s_Invalid_tag_s;
-static PyObject *__pyx_n_s_IteratorColumn;
-static PyObject *__pyx_n_s_IteratorRow;
-static PyObject *__pyx_n_s_KS;
-static PyObject *__pyx_n_s_KeyError;
-static PyObject *__pyx_n_s_LB;
-static PyObject *__pyx_n_s_LN;
-static PyObject *__pyx_n_s_M5;
-static PyObject *__pyx_n_s_MemoryError;
-static PyObject *__pyx_n_s_NotImplementedError;
-static PyObject *__pyx_n_s_OSError;
-static PyObject *__pyx_n_s_OverflowError;
-static PyObject *__pyx_n_s_PG;
-static PyObject *__pyx_n_s_PI;
-static PyObject *__pyx_n_s_PL;
-static PyObject *__pyx_n_s_PN;
-static PyObject *__pyx_n_s_PP;
-static PyObject *__pyx_n_s_PU;
-static PyObject *__pyx_n_s_PileupColumn;
-static PyObject *__pyx_kp_s_PileupColumn_accessed_after_iter;
-static PyObject *__pyx_n_s_PileupRead;
-static PyObject *__pyx_n_s_RG;
-static PyObject *__pyx_n_s_S;
-static PyObject *__pyx_n_s_SM;
-static PyObject *__pyx_n_s_SN;
-static PyObject *__pyx_n_s_SO;
-static PyObject *__pyx_n_s_SP;
-static PyObject *__pyx_n_s_SQ;
-static PyObject *__pyx_kp_s_SQ_SN_s_LN_s;
-static PyObject *__pyx_n_s_StopIteration;
-static PyObject *__pyx_n_s_TypeError;
-static PyObject *__pyx_n_s_UR;
-static PyObject *__pyx_kp_s_Unsupported_value_type_in_set_op;
-static PyObject *__pyx_n_s_VALID_HEADERS;
-static PyObject *__pyx_n_s_VALID_HEADER_FIELDS;
-static PyObject *__pyx_n_s_VALID_HEADER_ORDER;
-static PyObject *__pyx_n_s_VALID_HEADER_TYPES;
-static PyObject *__pyx_n_s_VN;
-static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_n_s_Z;
-static PyObject *__pyx_n_s_Zidf;
-static PyObject *__pyx_kp_s__12;
-static PyObject *__pyx_kp_s__38;
-static PyObject *__pyx_kp_b__4;
-static PyObject *__pyx_kp_s__40;
-static PyObject *__pyx_kp_s__43;
-static PyObject *__pyx_kp_s__47;
-static PyObject *__pyx_kp_s__7;
-static PyObject *__pyx_kp_s__74;
-static PyObject *__pyx_n_s_add_sq_text;
-static PyObject *__pyx_n_s_alignment;
-static PyObject *__pyx_n_s_all;
-static PyObject *__pyx_n_s_all_2;
-static PyObject *__pyx_n_s_always;
-static PyObject *__pyx_n_s_append;
-static PyObject *__pyx_n_s_args;
-static PyObject *__pyx_n_s_array;
-static PyObject *__pyx_n_s_ascii;
-static PyObject *__pyx_kp_s_at_least_one_integer_out_of_rang;
-static PyObject *__pyx_kp_s_at_least_one_signed_integer_out;
-static PyObject *__pyx_n_s_b;
-static PyObject *__pyx_kp_b_bai;
-static PyObject *__pyx_n_s_beg;
-static PyObject *__pyx_n_s_buildLine;
-static PyObject *__pyx_n_s_c;
-static PyObject *__pyx_kp_s_c_2;
-static PyObject *__pyx_n_s_calcsize;
-static PyObject *__pyx_n_s_callback;
-static PyObject *__pyx_kp_s_callback_not_implemented_yet;
-static PyObject *__pyx_kp_s_can_not_iterate_over_samfile_wit;
-static PyObject *__pyx_kp_s_can_only_IndexReads_on_bam_files;
-static PyObject *__pyx_kp_s_can_t_guess_type_or_invalid_type;
-static PyObject *__pyx_n_s_checkIndex;
-static PyObject *__pyx_n_s_check_header;
-static PyObject *__pyx_n_s_check_sq;
-static PyObject *__pyx_n_s_chr;
-static PyObject *__pyx_n_s_cigarstring;
-static PyObject *__pyx_n_s_cigartuples;
-static PyObject *__pyx_n_s_close;
-static PyObject *__pyx_n_s_collections;
-static PyObject *__pyx_n_s_compile;
-static PyObject *__pyx_n_s_consensus_quality;
-static PyObject *__pyx_kp_s_could_not_open_file_mode_s_is_it;
-static PyObject *__pyx_kp_s_could_not_open_file_s;
-static PyObject *__pyx_n_s_coverage;
-static PyObject *__pyx_n_s_create_string_buffer;
-static PyObject *__pyx_n_s_ctypes;
-static PyObject *__pyx_n_s_d;
-static PyObject *__pyx_kp_s_d_MIDNSHP_X;
-static PyObject *__pyx_n_s_decode;
-static PyObject *__pyx_n_s_defaultdict;
-static PyObject *__pyx_kp_s_either_supply_options_template_h;
-static PyObject *__pyx_n_s_encode;
-static PyObject *__pyx_n_s_end;
-static PyObject *__pyx_kp_s_end_out_of_range_i;
-static PyObject *__pyx_n_s_enumerate;
-static PyObject *__pyx_kp_s_error_during_iteration;
-static PyObject *__pyx_kp_s_error_while_opening_index_s;
-static PyObject *__pyx_n_s_exc_type;
-static PyObject *__pyx_n_s_exc_value;
-static PyObject *__pyx_n_s_exists;
-static PyObject *__pyx_n_s_extend;
-static PyObject *__pyx_n_s_f;
-static PyObject *__pyx_n_s_fastafile;
-static PyObject *__pyx_n_s_fetch;
-static PyObject *__pyx_kp_s_fetch_called_for_htsfile_without;
-static PyObject *__pyx_kp_s_fetch_called_on_bamfile_without;
-static PyObject *__pyx_kp_s_fetching_by_region_is_not_availa;
-static PyObject *__pyx_n_s_fields;
-static PyObject *__pyx_kp_s_file_does_not_have_valid_header;
-static PyObject *__pyx_kp_s_file_does_not_have_valid_header_2;
-static PyObject *__pyx_kp_s_file_header_is_empty_mode_s_is_i;
-static PyObject *__pyx_kp_s_file_s_not_found;
-static PyObject *__pyx_n_s_filename;
-static PyObject *__pyx_n_s_findall;
-static PyObject *__pyx_n_s_flag;
-static PyObject *__pyx_n_s_fromQualityString;
-static PyObject *__pyx_kp_b_ftp;
-static PyObject *__pyx_n_s_full_length;
-static PyObject *__pyx_n_s_genotype;
-static PyObject *__pyx_n_s_get;
-static PyObject *__pyx_n_s_get_aligned_pairs;
-static PyObject *__pyx_n_s_get_blocks;
-static PyObject *__pyx_n_s_get_overlap;
-static PyObject *__pyx_n_s_get_reference_positions;
-static PyObject *__pyx_n_s_getdefaultencoding;
-static PyObject *__pyx_n_s_getfilesystemencoding;
-static PyObject *__pyx_n_s_gettid;
-static PyObject *__pyx_n_s_h;
-static PyObject *__pyx_n_s_hasIndex;
-static PyObject *__pyx_n_s_header;
-static PyObject *__pyx_kp_s_header_line_with_invalid_type_s;
-static PyObject *__pyx_kp_s_header_line_without_s;
-static PyObject *__pyx_kp_s_home_andreas_devel_pysam_pysam;
-static PyObject *__pyx_kp_b_http;
-static PyObject *__pyx_n_s_i;
-static PyObject *__pyx_kp_s_i_c;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_kp_s_incomplete_sequence_information;
-static PyObject *__pyx_n_s_indel;
-static PyObject *__pyx_n_s_infer_query_length;
-static PyObject *__pyx_n_s_init;
-static PyObject *__pyx_kp_s_integer_i_out_of_range_of_BAM_SA;
-static PyObject *__pyx_kp_s_invalid_coordinates_start_i_end;
-static PyObject *__pyx_kp_s_invalid_file_opening_mode_s;
-static PyObject *__pyx_kp_s_invalid_reference_s;
-static PyObject *__pyx_kp_s_invalid_type_for_record_s_s_expe;
-static PyObject *__pyx_n_s_isOpen;
-static PyObject *__pyx_n_s_is_del;
-static PyObject *__pyx_n_s_is_head;
-static PyObject *__pyx_n_s_is_refskip;
-static PyObject *__pyx_n_s_is_refskip_2;
-static PyObject *__pyx_n_s_is_tail;
-static PyObject *__pyx_n_s_islower;
-static PyObject *__pyx_n_s_isupper;
-static PyObject *__pyx_n_s_items;
-static PyObject *__pyx_n_s_itertools;
-static PyObject *__pyx_n_s_join;
-static PyObject *__pyx_n_s_lengths;
-static PyObject *__pyx_n_s_level;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_kp_s_malformatted_header_no_in_field;
-static PyObject *__pyx_n_s_map;
-static PyObject *__pyx_kp_s_mapping_information_not_recorded;
-static PyObject *__pyx_n_s_mapping_quality;
-static PyObject *__pyx_kp_s_mate_not_found;
-static PyObject *__pyx_kp_s_mate_s_is_unmapped;
-static PyObject *__pyx_n_s_max;
-static PyObject *__pyx_n_s_max_depth;
-static PyObject *__pyx_n_s_min;
-static PyObject *__pyx_n_s_mode;
-static PyObject *__pyx_n_s_multiple_iterators;
-static PyObject *__pyx_kp_s_multiple_s_lines_are_not_permitt;
-static PyObject *__pyx_n_s_n;
-static PyObject *__pyx_n_s_next_reference_id;
-static PyObject *__pyx_n_s_next_reference_start;
-static PyObject *__pyx_n_s_nextiter;
-static PyObject *__pyx_kp_s_no_index_available_for_fetch;
-static PyObject *__pyx_kp_s_no_index_available_for_iteration;
-static PyObject *__pyx_kp_s_no_index_available_for_pileup;
-static PyObject *__pyx_n_s_nofilter;
-static PyObject *__pyx_n_s_nreferences;
-static PyObject *__pyx_n_s_nsegmentes;
-static PyObject *__pyx_n_s_nsegments;
-static PyObject *__pyx_n_s_offset;
-static PyObject *__pyx_n_s_open;
-static PyObject *__pyx_n_s_ord;
-static PyObject *__pyx_n_s_os;
-static PyObject *__pyx_n_s_pack_into;
-static PyObject *__pyx_n_s_parseRegion;
-static PyObject *__pyx_n_s_path;
-static PyObject *__pyx_kp_s_pileup_of_samfiles_not_implement;
-static PyObject *__pyx_n_s_pileups;
-static PyObject *__pyx_n_s_platform;
-static PyObject *__pyx_n_s_port;
-static PyObject *__pyx_n_s_pos;
-static PyObject *__pyx_n_s_positions;
-static PyObject *__pyx_n_s_pysam_calignmentfile;
-static PyObject *__pyx_n_s_pyx_vtable;
-static PyObject *__pyx_n_s_qualities;
-static PyObject *__pyx_kp_s_quality_and_sequence_mismatch_i;
-static PyObject *__pyx_n_s_quality_string;
-static PyObject *__pyx_n_s_query_alignment_end;
-static PyObject *__pyx_n_s_query_alignment_length;
-static PyObject *__pyx_n_s_query_alignment_qualities;
-static PyObject *__pyx_n_s_query_alignment_sequence;
-static PyObject *__pyx_n_s_query_alignment_start;
-static PyObject *__pyx_n_s_query_length;
-static PyObject *__pyx_n_s_query_name;
-static PyObject *__pyx_n_s_query_position;
-static PyObject *__pyx_n_s_query_qualities;
-static PyObject *__pyx_n_s_query_sequence;
-static PyObject *__pyx_n_s_r;
-static PyObject *__pyx_n_s_rU;
-static PyObject *__pyx_n_s_raw;
-static PyObject *__pyx_n_s_rb;
-static PyObject *__pyx_n_s_re;
-static PyObject *__pyx_kp_s_read_s_is_unpaired;
-static PyObject *__pyx_kp_s_read_s_not_found;
-static PyObject *__pyx_n_s_record;
-static PyObject *__pyx_n_s_reference;
-static PyObject *__pyx_n_s_reference_base;
-static PyObject *__pyx_n_s_reference_end;
-static PyObject *__pyx_n_s_reference_id;
-static PyObject *__pyx_kp_s_reference_id_i_out_of_range_0_ti;
-static PyObject *__pyx_n_s_reference_length;
-static PyObject *__pyx_n_s_reference_pos;
-static PyObject *__pyx_kp_s_reference_sequence_for_s_tid_i_n;
-static PyObject *__pyx_n_s_reference_start;
-static PyObject *__pyx_n_s_referencelengths;
-static PyObject *__pyx_n_s_referencenames;
-static PyObject *__pyx_n_s_references;
-static PyObject *__pyx_n_s_region;
-static PyObject *__pyx_n_s_replace;
-static PyObject *__pyx_kp_s_s;
-static PyObject *__pyx_n_s_s_2;
-static PyObject *__pyx_kp_s_s_s;
-static PyObject *__pyx_n_s_samfile;
-static PyObject *__pyx_n_s_samtools;
-static PyObject *__pyx_n_s_seek;
-static PyObject *__pyx_kp_s_seek_no_available_in_streams;
-static PyObject *__pyx_kp_s_seek_only_available_in_bam_files;
-static PyObject *__pyx_n_s_send;
-static PyObject *__pyx_n_s_setTag;
-static PyObject *__pyx_n_s_snp_quality;
-static PyObject *__pyx_n_s_sorted;
-static PyObject *__pyx_n_s_split;
-static PyObject *__pyx_n_s_start;
-static PyObject *__pyx_kp_s_start_out_of_range_i;
-static PyObject *__pyx_n_s_startswith;
-static PyObject *__pyx_n_s_stepper;
-static PyObject *__pyx_n_s_strip;
-static PyObject *__pyx_n_s_struct;
-static PyObject *__pyx_n_s_sys;
-static PyObject *__pyx_n_s_tag;
-static PyObject *__pyx_kp_s_tag_s_not_present;
-static PyObject *__pyx_n_s_tags;
-static PyObject *__pyx_n_s_tempfile;
-static PyObject *__pyx_n_s_template;
-static PyObject *__pyx_n_s_template_length;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_n_s_text;
-static PyObject *__pyx_kp_s_this_class_cannot_be_instantiate;
-static PyObject *__pyx_n_s_throw;
-static PyObject *__pyx_n_s_tid;
-static PyObject *__pyx_kp_s_tid_i_out_of_range_0_tid_i;
-static PyObject *__pyx_n_s_toQualityString;
-static PyObject *__pyx_n_s_traceback;
-static PyObject *__pyx_n_s_truncate;
-static PyObject *__pyx_kp_s_truncated_file;
-static PyObject *__pyx_n_s_types;
-static PyObject *__pyx_kp_s_unable_to_open_index_for_s;
-static PyObject *__pyx_kp_s_unequal_names_and_lengths_of_ref;
-static PyObject *__pyx_kp_s_unknown_auxilliary_type_s;
-static PyObject *__pyx_kp_s_unknown_field_code_s_in_record_s;
-static PyObject *__pyx_kp_s_unknown_stepper_option_s_in_Iter;
-static PyObject *__pyx_kp_s_unknown_type_s;
-static PyObject *__pyx_n_s_until_eof;
-static PyObject *__pyx_n_s_value;
-static PyObject *__pyx_n_s_value_type;
-static PyObject *__pyx_n_s_w;
-static PyObject *__pyx_n_s_warn;
-static PyObject *__pyx_n_s_warnings;
-static PyObject *__pyx_n_s_wb;
-static PyObject *__pyx_n_s_wb0;
-static PyObject *__pyx_n_s_wbu;
-static PyObject *__pyx_n_s_wh;
-static PyObject *__pyx_n_s_where;
-static PyObject *__pyx_n_s_write;
-static PyObject *__pyx_n_s_x;
-static PyObject *__pyx_n_s_zip;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_2;
-static PyObject *__pyx_int_33;
-static PyObject *__pyx_int_128;
-static PyObject *__pyx_int_255;
-static PyObject *__pyx_int_256;
-static PyObject *__pyx_int_8000;
-static PyObject *__pyx_int_32768;
-static PyObject *__pyx_int_65535;
-static PyObject *__pyx_int_65536;
-static PyObject *__pyx_int_536870912;
-static PyObject *__pyx_int_2147483648;
-static PyObject *__pyx_int_4294967295;
-static PyObject *__pyx_int_4294967296;
-static PyObject *__pyx_int_neg_4;
-static PyObject *__pyx_int_neg_127;
-static PyObject *__pyx_int_neg_128;
-static PyObject *__pyx_int_neg_32767;
-static PyObject *__pyx_int_neg_32768;
-static PyObject *__pyx_int_neg_2147483648;
-static int __pyx_k__62;
-static PyObject *__pyx_tuple_;
-static PyObject *__pyx_slice__8;
-static PyObject *__pyx_tuple__2;
-static PyObject *__pyx_tuple__3;
-static PyObject *__pyx_tuple__5;
-static PyObject *__pyx_tuple__6;
-static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__42;
-static PyObject *__pyx_slice__45;
-static PyObject *__pyx_slice__46;
-static PyObject *__pyx_slice__68;
-static PyObject *__pyx_slice__72;
-static PyObject *__pyx_tuple__10;
-static PyObject *__pyx_tuple__11;
-static PyObject *__pyx_tuple__13;
-static PyObject *__pyx_tuple__14;
-static PyObject *__pyx_tuple__15;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__17;
-static PyObject *__pyx_tuple__18;
-static PyObject *__pyx_tuple__19;
-static PyObject *__pyx_tuple__20;
-static PyObject *__pyx_tuple__21;
-static PyObject *__pyx_tuple__22;
-static PyObject *__pyx_tuple__23;
-static PyObject *__pyx_tuple__24;
-static PyObject *__pyx_tuple__25;
-static PyObject *__pyx_tuple__26;
-static PyObject *__pyx_tuple__27;
-static PyObject *__pyx_tuple__28;
-static PyObject *__pyx_tuple__29;
-static PyObject *__pyx_tuple__30;
-static PyObject *__pyx_tuple__31;
-static PyObject *__pyx_tuple__32;
-static PyObject *__pyx_tuple__33;
-static PyObject *__pyx_tuple__34;
-static PyObject *__pyx_tuple__35;
-static PyObject *__pyx_tuple__36;
-static PyObject *__pyx_tuple__37;
-static PyObject *__pyx_tuple__39;
-static PyObject *__pyx_tuple__41;
-static PyObject *__pyx_tuple__44;
-static PyObject *__pyx_tuple__48;
-static PyObject *__pyx_tuple__49;
-static PyObject *__pyx_tuple__50;
-static PyObject *__pyx_tuple__51;
-static PyObject *__pyx_tuple__52;
-static PyObject *__pyx_tuple__53;
-static PyObject *__pyx_tuple__54;
-static PyObject *__pyx_tuple__55;
-static PyObject *__pyx_tuple__56;
-static PyObject *__pyx_tuple__57;
-static PyObject *__pyx_tuple__58;
-static PyObject *__pyx_tuple__59;
-static PyObject *__pyx_tuple__60;
-static PyObject *__pyx_tuple__61;
-static PyObject *__pyx_tuple__63;
-static PyObject *__pyx_tuple__64;
-static PyObject *__pyx_tuple__65;
-static PyObject *__pyx_tuple__66;
-static PyObject *__pyx_tuple__67;
-static PyObject *__pyx_tuple__69;
-static PyObject *__pyx_tuple__70;
-static PyObject *__pyx_tuple__71;
-static PyObject *__pyx_tuple__73;
-static PyObject *__pyx_tuple__75;
-static PyObject *__pyx_tuple__76;
-static PyObject *__pyx_tuple__77;
-static PyObject *__pyx_tuple__78;
-static PyObject *__pyx_tuple__79;
-static PyObject *__pyx_tuple__80;
-static PyObject *__pyx_tuple__81;
-static PyObject *__pyx_tuple__82;
-static PyObject *__pyx_tuple__83;
-static PyObject *__pyx_tuple__84;
-static PyObject *__pyx_tuple__85;
-static PyObject *__pyx_tuple__86;
-static PyObject *__pyx_tuple__88;
-static PyObject *__pyx_codeobj__87;
-static PyObject *__pyx_codeobj__89;
-static PyObject *__pyx_gb_5pysam_14calignmentfile_6generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-
-/* "pysam/calignmentfile.pyx":110
- * cdef char* CODE2CIGAR= "MIDNSHP=X"
- * if IS_PYTHON3:
- *     CIGAR2CODE = dict( [y,x] for x,y in enumerate( CODE2CIGAR) )             # <<<<<<<<<<<<<<
- * else:
- *     CIGAR2CODE = dict( [ord(y),x] for x,y in enumerate( CODE2CIGAR) )
- */
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_4genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *__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("genexpr", 0);
-  __pyx_cur_scope = (struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *)__pyx_tp_new_5pysam_14calignmentfile___pyx_scope_struct__genexpr(__pyx_ptype_5pysam_14calignmentfile___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL);
-  if (unlikely(!__pyx_cur_scope)) {
-    __Pyx_RefNannyFinishContext();
-    return NULL;
-  }
-  __Pyx_GOTREF(__pyx_cur_scope);
-  __Pyx_TraceCall("genexpr", __pyx_f[0], 110);
-  {
-    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_5pysam_14calignmentfile_6generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_cur_scope);
-    __Pyx_RefNannyFinishContext();
-    return (PyObject *) gen;
-  }
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.genexpr", __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_5pysam_14calignmentfile_6generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
-{
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *)__pyx_generator->closure);
-  PyObject *__pyx_r = NULL;
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *(*__pyx_t_4)(PyObject *);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_INCREF(__pyx_int_0);
-  __pyx_t_1 = __pyx_int_0;
-  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_5pysam_14calignmentfile_CODE2CIGAR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  for (;;) {
-    {
-      __pyx_t_2 = __pyx_t_4(__pyx_t_3);
-      if (unlikely(!__pyx_t_2)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_2);
-    }
-    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_y);
-    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_y, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
-    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1);
-    __pyx_t_1 = __pyx_t_2;
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_y);
-    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_y);
-    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_y);
-    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_x);
-    PyList_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_x);
-    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_x);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
-    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
-    __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_1 = __pyx_cur_scope->__pyx_t_0;
-    __pyx_cur_scope->__pyx_t_0 = 0;
-    __Pyx_XGOTREF(__pyx_t_1);
-    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
-    __pyx_cur_scope->__pyx_t_1 = 0;
-    __Pyx_XGOTREF(__pyx_t_3);
-    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
-    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* function exit code */
-  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("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_generator->resume_label = -1;
-  __Pyx_Generator_clear((PyObject*)__pyx_generator);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-}
-static PyObject *__pyx_gb_5pysam_14calignmentfile_9generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-
-/* "pysam/calignmentfile.pyx":112
- *     CIGAR2CODE = dict( [y,x] for x,y in enumerate( CODE2CIGAR) )
- * else:
- *     CIGAR2CODE = dict( [ord(y),x] for x,y in enumerate( CODE2CIGAR) )             # <<<<<<<<<<<<<<
- * CIGAR_REGEX = re.compile( "(\d+)([MIDNSHP=X])" )
- * 
- */
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *__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("genexpr", 0);
-  __pyx_cur_scope = (struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr(__pyx_ptype_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
-  if (unlikely(!__pyx_cur_scope)) {
-    __Pyx_RefNannyFinishContext();
-    return NULL;
-  }
-  __Pyx_GOTREF(__pyx_cur_scope);
-  __Pyx_TraceCall("genexpr", __pyx_f[0], 112);
-  {
-    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_5pysam_14calignmentfile_9generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_cur_scope);
-    __Pyx_RefNannyFinishContext();
-    return (PyObject *) gen;
-  }
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.genexpr", __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_5pysam_14calignmentfile_9generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
-{
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
-  PyObject *__pyx_r = NULL;
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *(*__pyx_t_4)(PyObject *);
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_INCREF(__pyx_int_0);
-  __pyx_t_1 = __pyx_int_0;
-  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_5pysam_14calignmentfile_CODE2CIGAR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  for (;;) {
-    {
-      __pyx_t_2 = __pyx_t_4(__pyx_t_3);
-      if (unlikely(!__pyx_t_2)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_2);
-    }
-    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_y);
-    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_y, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
-    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1);
-    __pyx_t_1 = __pyx_t_2;
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_y);
-    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_y);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_x);
-    PyList_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_x);
-    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_x);
-    __pyx_t_5 = 0;
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
-    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
-    __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_1 = __pyx_cur_scope->__pyx_t_0;
-    __pyx_cur_scope->__pyx_t_0 = 0;
-    __Pyx_XGOTREF(__pyx_t_1);
-    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
-    __pyx_cur_scope->__pyx_t_1 = 0;
-    __Pyx_XGOTREF(__pyx_t_3);
-    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
-    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* function exit code */
-  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_5);
-  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_generator->resume_label = -1;
-  __Pyx_Generator_clear((PyObject*)__pyx_generator);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-}
-
-/* "pysam/calignmentfile.pyx":32
- * ########################################################################
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3
- * cdef from_string_and_size(char* s, size_t length):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_from_string_and_size(char *__pyx_v_s, size_t __pyx_v_length) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("from_string_and_size", 0);
-  __Pyx_TraceCall("from_string_and_size", __pyx_f[0], 32);
-
-  /* "pysam/calignmentfile.pyx":33
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3
- * cdef from_string_and_size(char* s, size_t length):
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s[:length]
- *     else:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":34
- * cdef from_string_and_size(char* s, size_t length):
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]             # <<<<<<<<<<<<<<
- *     else:
- *         return s[:length].decode("ascii")
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":36
- *         return s[:length]
- *     else:
- *         return s[:length].decode("ascii")             # <<<<<<<<<<<<<<
- * 
- * # filename encoding (copied from lxml.etree.pyx)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_s, 0, __pyx_v_length, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":32
- * ########################################################################
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3
- * cdef from_string_and_size(char* s, size_t length):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.from_string_and_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":49
- * #_C_FILENAME_ENCODING = <char*>_FILENAME_ENCODING
- * 
- * cdef bytes _encodeFilename(object filename):             # <<<<<<<<<<<<<<
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile__encodeFilename(PyObject *__pyx_v_filename) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_encodeFilename", 0);
-  __Pyx_TraceCall("_encodeFilename", __pyx_f[0], 49);
-
-  /* "pysam/calignmentfile.pyx":51
- * cdef bytes _encodeFilename(object filename):
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(filename):
- */
-  __pyx_t_1 = (__pyx_v_filename == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":52
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(filename):
- *         return filename
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":53
- *     if filename is None:
- *         return None
- *     elif PyBytes_Check(filename):             # <<<<<<<<<<<<<<
- *         return filename
- *     elif PyUnicode_Check(filename):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_filename) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":54
- *         return None
- *     elif PyBytes_Check(filename):
- *         return filename             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(filename):
- *         return filename.encode(_FILENAME_ENCODING)
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_filename))||((__pyx_v_filename) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_filename)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_filename);
-    __pyx_r = ((PyObject*)__pyx_v_filename);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":55
- *     elif PyBytes_Check(filename):
- *         return filename
- *     elif PyUnicode_Check(filename):             # <<<<<<<<<<<<<<
- *         return filename.encode(_FILENAME_ENCODING)
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_filename) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":56
- *         return filename
- *     elif PyUnicode_Check(filename):
- *         return filename.encode(_FILENAME_ENCODING)             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING);
-    __Pyx_GIVEREF(__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_5);
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":58
- *         return filename.encode(_FILENAME_ENCODING)
- *     else:
- *         raise TypeError, u"Argument must be string or unicode."             # <<<<<<<<<<<<<<
- * 
- * cdef bytes _forceBytes(object s):
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_or_unico, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":49
- * #_C_FILENAME_ENCODING = <char*>_FILENAME_ENCODING
- * 
- * cdef bytes _encodeFilename(object filename):             # <<<<<<<<<<<<<<
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.calignmentfile._encodeFilename", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":60
- *         raise TypeError, u"Argument must be string or unicode."
- * 
- * cdef bytes _forceBytes(object s):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming
- *     ascii encoding.
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile__forceBytes(PyObject *__pyx_v_s) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  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("_forceBytes", 0);
-  __Pyx_TraceCall("_forceBytes", __pyx_f[0], 60);
-
-  /* "pysam/calignmentfile.pyx":64
- *     ascii encoding.
- *     """
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif s is None:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":65
- *     """
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif s is None:
- *         return None
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":66
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":67
- *         return s
- *     elif s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":68
- *     elif s is None:
- *         return None
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyUnicode_Check(s):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":69
- *         return None
- *     elif PyBytes_Check(s):
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":70
- *     elif PyBytes_Check(s):
- *         return s
- *     elif PyUnicode_Check(s):             # <<<<<<<<<<<<<<
- *         return s.encode('ascii')
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":71
- *         return s
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_4);
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":73
- *         return s.encode('ascii')
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."             # <<<<<<<<<<<<<<
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_bytes_or, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":60
- *         raise TypeError, u"Argument must be string or unicode."
- * 
- * cdef bytes _forceBytes(object s):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming
- *     ascii encoding.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile._forceBytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":75
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):             # <<<<<<<<<<<<<<
- *     return _forceBytes(s)
- * 
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_14calignmentfile__forceCmdlineBytes(PyObject *__pyx_v_s) {
-  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("_forceCmdlineBytes", 0);
-  __Pyx_TraceCall("_forceCmdlineBytes", __pyx_f[0], 75);
-
-  /* "pysam/calignmentfile.pyx":76
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):
- *     return _forceBytes(s)             # <<<<<<<<<<<<<<
- * 
- * cdef _charptr_to_str(char* s):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":75
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):             # <<<<<<<<<<<<<<
- *     return _forceBytes(s)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile._forceCmdlineBytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":78
- *     return _forceBytes(s)
- * 
- * cdef _charptr_to_str(char* s):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile__charptr_to_str(char *__pyx_v_s) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_charptr_to_str", 0);
-  __Pyx_TraceCall("_charptr_to_str", __pyx_f[0], 78);
-
-  /* "pysam/calignmentfile.pyx":79
- * 
- * cdef _charptr_to_str(char* s):
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     else:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":80
- * cdef _charptr_to_str(char* s):
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     else:
- *         return s.decode("ascii")
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":82
- *         return s
- *     else:
- *         return s.decode("ascii")             # <<<<<<<<<<<<<<
- * 
- * cdef _forceStr(object s):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_s, 0, strlen(__pyx_v_s), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":78
- *     return _forceBytes(s)
- * 
- * cdef _charptr_to_str(char* s):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile._charptr_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":84
- *         return s.decode("ascii")
- * 
- * cdef _forceStr(object s):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile__forceStr(PyObject *__pyx_v_s) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  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("_forceStr", 0);
-  __Pyx_TraceCall("_forceStr", __pyx_f[0], 84);
-
-  /* "pysam/calignmentfile.pyx":87
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- *     if s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     if PY_MAJOR_VERSION < 3:
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":88
- *     (bytes in Py2, unicode in Py3)"""
- *     if s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":89
- *     if s is None:
- *         return None
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_2 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":90
- *         return None
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s.decode('ascii')
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = __pyx_v_s;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":91
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s.decode('ascii')
- *     else:
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":92
- *         return s
- *     elif PyBytes_Check(s):
- *         return s.decode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         # assume unicode
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":95
- *     else:
- *         # assume unicode
- *         return s             # <<<<<<<<<<<<<<
- * 
- * ########################################################################
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = __pyx_v_s;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":84
- *         return s.decode("ascii")
- * 
- * cdef _forceStr(object s):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile._forceStr", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":125
- * #####################################################################
- * cdef class AlignedSegment
- * cdef object makeAlignedSegment(bam1_t * src):             # <<<<<<<<<<<<<<
- *     '''enter src into AlignedSegment.'''
- *     # note that the following does not call __init__
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_makeAlignedSegment(bam1_t *__pyx_v_src) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_dest = 0;
-  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("makeAlignedSegment", 0);
-  __Pyx_TraceCall("makeAlignedSegment", __pyx_f[0], 125);
-
-  /* "pysam/calignmentfile.pyx":128
- *     '''enter src into AlignedSegment.'''
- *     # note that the following does not call __init__
- *     cdef AlignedSegment dest = AlignedSegment.__new__(AlignedSegment)             # <<<<<<<<<<<<<<
- *     dest._delegate = bam_dup1(src)
- *     return dest
- */
-  __pyx_t_1 = __pyx_tp_new_5pysam_14calignmentfile_AlignedSegment(((PyTypeObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_AlignedSegment)), __pyx_empty_tuple, NULL); 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);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysam_14calignmentfile_AlignedSegment)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_dest = ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":129
- *     # note that the following does not call __init__
- *     cdef AlignedSegment dest = AlignedSegment.__new__(AlignedSegment)
- *     dest._delegate = bam_dup1(src)             # <<<<<<<<<<<<<<
- *     return dest
- * 
- */
-  __pyx_v_dest->_delegate = bam_dup1(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":130
- *     cdef AlignedSegment dest = AlignedSegment.__new__(AlignedSegment)
- *     dest._delegate = bam_dup1(src)
- *     return dest             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_dest));
-  __pyx_r = ((PyObject *)__pyx_v_dest);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":125
- * #####################################################################
- * cdef class AlignedSegment
- * cdef object makeAlignedSegment(bam1_t * src):             # <<<<<<<<<<<<<<
- *     '''enter src into AlignedSegment.'''
- *     # note that the following does not call __init__
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.makeAlignedSegment", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_dest);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":134
- * 
- * cdef class PileupColumn
- * cdef makePileupColumn(bam_pileup1_t ** plp, int tid, int pos, int n_pu):             # <<<<<<<<<<<<<<
- *     # note that the following does not call __init__
- *      cdef PileupColumn dest = PileupColumn.__new__(PileupColumn)
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_makePileupColumn(bam_pileup1_t **__pyx_v_plp, int __pyx_v_tid, int __pyx_v_pos, int __pyx_v_n_pu) {
-  struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_dest = 0;
-  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("makePileupColumn", 0);
-  __Pyx_TraceCall("makePileupColumn", __pyx_f[0], 134);
-
-  /* "pysam/calignmentfile.pyx":136
- * cdef makePileupColumn(bam_pileup1_t ** plp, int tid, int pos, int n_pu):
- *     # note that the following does not call __init__
- *      cdef PileupColumn dest = PileupColumn.__new__(PileupColumn)             # <<<<<<<<<<<<<<
- *      dest.plp = plp
- *      dest.tid = tid
- */
-  __pyx_t_1 = __pyx_tp_new_5pysam_14calignmentfile_PileupColumn(((PyTypeObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_PileupColumn)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysam_14calignmentfile_PileupColumn)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_dest = ((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":137
- *     # note that the following does not call __init__
- *      cdef PileupColumn dest = PileupColumn.__new__(PileupColumn)
- *      dest.plp = plp             # <<<<<<<<<<<<<<
- *      dest.tid = tid
- *      dest.pos = pos
- */
-  __pyx_v_dest->plp = __pyx_v_plp;
-
-  /* "pysam/calignmentfile.pyx":138
- *      cdef PileupColumn dest = PileupColumn.__new__(PileupColumn)
- *      dest.plp = plp
- *      dest.tid = tid             # <<<<<<<<<<<<<<
- *      dest.pos = pos
- *      dest.n_pu = n_pu
- */
-  __pyx_v_dest->tid = __pyx_v_tid;
-
-  /* "pysam/calignmentfile.pyx":139
- *      dest.plp = plp
- *      dest.tid = tid
- *      dest.pos = pos             # <<<<<<<<<<<<<<
- *      dest.n_pu = n_pu
- *      return dest
- */
-  __pyx_v_dest->pos = __pyx_v_pos;
-
-  /* "pysam/calignmentfile.pyx":140
- *      dest.tid = tid
- *      dest.pos = pos
- *      dest.n_pu = n_pu             # <<<<<<<<<<<<<<
- *      return dest
- * 
- */
-  __pyx_v_dest->n_pu = __pyx_v_n_pu;
-
-  /* "pysam/calignmentfile.pyx":141
- *      dest.pos = pos
- *      dest.n_pu = n_pu
- *      return dest             # <<<<<<<<<<<<<<
- * 
- * cdef class PileupRead
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_dest));
-  __pyx_r = ((PyObject *)__pyx_v_dest);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":134
- * 
- * cdef class PileupColumn
- * cdef makePileupColumn(bam_pileup1_t ** plp, int tid, int pos, int n_pu):             # <<<<<<<<<<<<<<
- *     # note that the following does not call __init__
- *      cdef PileupColumn dest = PileupColumn.__new__(PileupColumn)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.makePileupColumn", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_dest);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":144
- * 
- * cdef class PileupRead
- * cdef makePileupRead(bam_pileup1_t * src):             # <<<<<<<<<<<<<<
- *     '''fill a  PileupRead object from a bam_pileup1_t * object.'''
- *     cdef PileupRead dest = PileupRead.__new__(PileupRead)
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_makePileupRead(bam_pileup1_t *__pyx_v_src) {
-  struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_dest = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int32_t __pyx_t_2;
-  int __pyx_t_3;
-  uint32_t __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("makePileupRead", 0);
-  __Pyx_TraceCall("makePileupRead", __pyx_f[0], 144);
-
-  /* "pysam/calignmentfile.pyx":146
- * cdef makePileupRead(bam_pileup1_t * src):
- *     '''fill a  PileupRead object from a bam_pileup1_t * object.'''
- *     cdef PileupRead dest = PileupRead.__new__(PileupRead)             # <<<<<<<<<<<<<<
- *     dest._alignment = makeAlignedSegment(src.b)
- *     dest._qpos = src.qpos
- */
-  __pyx_t_1 = __pyx_tp_new_5pysam_14calignmentfile_PileupRead(((PyTypeObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_PileupRead)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysam_14calignmentfile_PileupRead)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_dest = ((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":147
- *     '''fill a  PileupRead object from a bam_pileup1_t * object.'''
- *     cdef PileupRead dest = PileupRead.__new__(PileupRead)
- *     dest._alignment = makeAlignedSegment(src.b)             # <<<<<<<<<<<<<<
- *     dest._qpos = src.qpos
- *     dest._indel = src.indel
- */
-  __pyx_t_1 = __pyx_f_5pysam_14calignmentfile_makeAlignedSegment(__pyx_v_src->b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysam_14calignmentfile_AlignedSegment))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_GOTREF(__pyx_v_dest->_alignment);
-  __Pyx_DECREF(((PyObject *)__pyx_v_dest->_alignment));
-  __pyx_v_dest->_alignment = ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":148
- *     cdef PileupRead dest = PileupRead.__new__(PileupRead)
- *     dest._alignment = makeAlignedSegment(src.b)
- *     dest._qpos = src.qpos             # <<<<<<<<<<<<<<
- *     dest._indel = src.indel
- *     dest._level = src.level
- */
-  __pyx_t_2 = __pyx_v_src->qpos;
-  __pyx_v_dest->_qpos = __pyx_t_2;
-
-  /* "pysam/calignmentfile.pyx":149
- *     dest._alignment = makeAlignedSegment(src.b)
- *     dest._qpos = src.qpos
- *     dest._indel = src.indel             # <<<<<<<<<<<<<<
- *     dest._level = src.level
- *     dest._is_del = src.is_del
- */
-  __pyx_t_3 = __pyx_v_src->indel;
-  __pyx_v_dest->_indel = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":150
- *     dest._qpos = src.qpos
- *     dest._indel = src.indel
- *     dest._level = src.level             # <<<<<<<<<<<<<<
- *     dest._is_del = src.is_del
- *     dest._is_head = src.is_head
- */
-  __pyx_t_3 = __pyx_v_src->level;
-  __pyx_v_dest->_level = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":151
- *     dest._indel = src.indel
- *     dest._level = src.level
- *     dest._is_del = src.is_del             # <<<<<<<<<<<<<<
- *     dest._is_head = src.is_head
- *     dest._is_tail = src.is_tail
- */
-  __pyx_t_4 = __pyx_v_src->is_del;
-  __pyx_v_dest->_is_del = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":152
- *     dest._level = src.level
- *     dest._is_del = src.is_del
- *     dest._is_head = src.is_head             # <<<<<<<<<<<<<<
- *     dest._is_tail = src.is_tail
- *     return dest
- */
-  __pyx_t_4 = __pyx_v_src->is_head;
-  __pyx_v_dest->_is_head = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":153
- *     dest._is_del = src.is_del
- *     dest._is_head = src.is_head
- *     dest._is_tail = src.is_tail             # <<<<<<<<<<<<<<
- *     return dest
- * 
- */
-  __pyx_t_4 = __pyx_v_src->is_tail;
-  __pyx_v_dest->_is_tail = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":154
- *     dest._is_head = src.is_head
- *     dest._is_tail = src.is_tail
- *     return dest             # <<<<<<<<<<<<<<
- * 
- * cdef convertBinaryTagToList( uint8_t * s ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_dest));
-  __pyx_r = ((PyObject *)__pyx_v_dest);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":144
- * 
- * cdef class PileupRead
- * cdef makePileupRead(bam_pileup1_t * src):             # <<<<<<<<<<<<<<
- *     '''fill a  PileupRead object from a bam_pileup1_t * object.'''
- *     cdef PileupRead dest = PileupRead.__new__(PileupRead)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.makePileupRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_dest);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":156
- *     return dest
- * 
- * cdef convertBinaryTagToList( uint8_t * s ):             # <<<<<<<<<<<<<<
- *     """return bytesize, number of values list of values in s."""
- *     cdef char auxtype
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_convertBinaryTagToList(uint8_t *__pyx_v_s) {
-  char __pyx_v_auxtype;
-  uint8_t __pyx_v_byte_size;
-  int32_t __pyx_v_nvalues;
-  PyObject *__pyx_v_values = NULL;
-  CYTHON_UNUSED long __pyx_v_x;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int32_t __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("convertBinaryTagToList", 0);
-  __Pyx_TraceCall("convertBinaryTagToList", __pyx_f[0], 156);
-
-  /* "pysam/calignmentfile.pyx":163
- * 
- *     # get byte size
- *     auxtype = s[0]             # <<<<<<<<<<<<<<
- *     byte_size = aux_type2size( auxtype )
- *     s += 1
- */
-  __pyx_v_auxtype = (__pyx_v_s[0]);
-
-  /* "pysam/calignmentfile.pyx":164
- *     # get byte size
- *     auxtype = s[0]
- *     byte_size = aux_type2size( auxtype )             # <<<<<<<<<<<<<<
- *     s += 1
- *     # get number of values in array
- */
-  __pyx_v_byte_size = aux_type2size(__pyx_v_auxtype);
-
-  /* "pysam/calignmentfile.pyx":165
- *     auxtype = s[0]
- *     byte_size = aux_type2size( auxtype )
- *     s += 1             # <<<<<<<<<<<<<<
- *     # get number of values in array
- *     nvalues = (<int32_t*>s)[0]
- */
-  __pyx_v_s = (__pyx_v_s + 1);
-
-  /* "pysam/calignmentfile.pyx":167
- *     s += 1
- *     # get number of values in array
- *     nvalues = (<int32_t*>s)[0]             # <<<<<<<<<<<<<<
- *     s += 4
- *     # get values
- */
-  __pyx_v_nvalues = (((int32_t *)__pyx_v_s)[0]);
-
-  /* "pysam/calignmentfile.pyx":168
- *     # get number of values in array
- *     nvalues = (<int32_t*>s)[0]
- *     s += 4             # <<<<<<<<<<<<<<
- *     # get values
- *     values = []
- */
-  __pyx_v_s = (__pyx_v_s + 4);
-
-  /* "pysam/calignmentfile.pyx":170
- *     s += 4
- *     # get values
- *     values = []             # <<<<<<<<<<<<<<
- *     if auxtype == 'c':
- *         for x from 0 <= x < nvalues:
- */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_values = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":195
- *             values.append((<uint32_t*>s)[0])
- *             s += 4
- *     elif auxtype == 'f':             # <<<<<<<<<<<<<<
- *         for x from 0 <= x < nvalues:
- *             values.append((<float*>s)[0])
- */
-  switch (__pyx_v_auxtype) {
-
-    /* "pysam/calignmentfile.pyx":171
- *     # get values
- *     values = []
- *     if auxtype == 'c':             # <<<<<<<<<<<<<<
- *         for x from 0 <= x < nvalues:
- *             values.append((<int8_t*>s)[0])
- */
-    case 'c':
-
-    /* "pysam/calignmentfile.pyx":172
- *     values = []
- *     if auxtype == 'c':
- *         for x from 0 <= x < nvalues:             # <<<<<<<<<<<<<<
- *             values.append((<int8_t*>s)[0])
- *             s += 1
- */
-    __pyx_t_2 = __pyx_v_nvalues;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-      /* "pysam/calignmentfile.pyx":173
- *     if auxtype == 'c':
- *         for x from 0 <= x < nvalues:
- *             values.append((<int8_t*>s)[0])             # <<<<<<<<<<<<<<
- *             s += 1
- *     elif auxtype == 'C':
- */
-      __pyx_t_1 = __Pyx_PyInt_From_int8_t((((int8_t *)__pyx_v_s)[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":174
- *         for x from 0 <= x < nvalues:
- *             values.append((<int8_t*>s)[0])
- *             s += 1             # <<<<<<<<<<<<<<
- *     elif auxtype == 'C':
- *         for x from 0 <= x < nvalues:
- */
-      __pyx_v_s = (__pyx_v_s + 1);
-    }
-    break;
-
-    /* "pysam/calignmentfile.pyx":175
- *             values.append((<int8_t*>s)[0])
- *             s += 1
- *     elif auxtype == 'C':             # <<<<<<<<<<<<<<
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint8_t*>s)[0])
- */
-    case 'C':
-
-    /* "pysam/calignmentfile.pyx":176
- *             s += 1
- *     elif auxtype == 'C':
- *         for x from 0 <= x < nvalues:             # <<<<<<<<<<<<<<
- *             values.append((<uint8_t*>s)[0])
- *             s += 1
- */
-    __pyx_t_2 = __pyx_v_nvalues;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-      /* "pysam/calignmentfile.pyx":177
- *     elif auxtype == 'C':
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint8_t*>s)[0])             # <<<<<<<<<<<<<<
- *             s += 1
- *     elif auxtype == 's':
- */
-      __pyx_t_1 = __Pyx_PyInt_From_uint8_t((((uint8_t *)__pyx_v_s)[0])); 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_t_3 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":178
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint8_t*>s)[0])
- *             s += 1             # <<<<<<<<<<<<<<
- *     elif auxtype == 's':
- *         for x from 0 <= x < nvalues:
- */
-      __pyx_v_s = (__pyx_v_s + 1);
-    }
-    break;
-
-    /* "pysam/calignmentfile.pyx":179
- *             values.append((<uint8_t*>s)[0])
- *             s += 1
- *     elif auxtype == 's':             # <<<<<<<<<<<<<<
- *         for x from 0 <= x < nvalues:
- *             values.append((<int16_t*>s)[0])
- */
-    case 's':
-
-    /* "pysam/calignmentfile.pyx":180
- *             s += 1
- *     elif auxtype == 's':
- *         for x from 0 <= x < nvalues:             # <<<<<<<<<<<<<<
- *             values.append((<int16_t*>s)[0])
- *             s += 2
- */
-    __pyx_t_2 = __pyx_v_nvalues;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-      /* "pysam/calignmentfile.pyx":181
- *     elif auxtype == 's':
- *         for x from 0 <= x < nvalues:
- *             values.append((<int16_t*>s)[0])             # <<<<<<<<<<<<<<
- *             s += 2
- *     elif auxtype == 'S':
- */
-      __pyx_t_1 = __Pyx_PyInt_From_int16_t((((int16_t *)__pyx_v_s)[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":182
- *         for x from 0 <= x < nvalues:
- *             values.append((<int16_t*>s)[0])
- *             s += 2             # <<<<<<<<<<<<<<
- *     elif auxtype == 'S':
- *         for x from 0 <= x < nvalues:
- */
-      __pyx_v_s = (__pyx_v_s + 2);
-    }
-    break;
-
-    /* "pysam/calignmentfile.pyx":183
- *             values.append((<int16_t*>s)[0])
- *             s += 2
- *     elif auxtype == 'S':             # <<<<<<<<<<<<<<
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint16_t*>s)[0])
- */
-    case 'S':
-
-    /* "pysam/calignmentfile.pyx":184
- *             s += 2
- *     elif auxtype == 'S':
- *         for x from 0 <= x < nvalues:             # <<<<<<<<<<<<<<
- *             values.append((<uint16_t*>s)[0])
- *             s += 2
- */
-    __pyx_t_2 = __pyx_v_nvalues;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-      /* "pysam/calignmentfile.pyx":185
- *     elif auxtype == 'S':
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint16_t*>s)[0])             # <<<<<<<<<<<<<<
- *             s += 2
- *     elif auxtype == 'i':
- */
-      __pyx_t_1 = __Pyx_PyInt_From_uint16_t((((uint16_t *)__pyx_v_s)[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":186
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint16_t*>s)[0])
- *             s += 2             # <<<<<<<<<<<<<<
- *     elif auxtype == 'i':
- *         for x from 0 <= x < nvalues:
- */
-      __pyx_v_s = (__pyx_v_s + 2);
-    }
-    break;
-
-    /* "pysam/calignmentfile.pyx":187
- *             values.append((<uint16_t*>s)[0])
- *             s += 2
- *     elif auxtype == 'i':             # <<<<<<<<<<<<<<
- *         for x from 0 <= x < nvalues:
- *             values.append((<int32_t*>s)[0])
- */
-    case 'i':
-
-    /* "pysam/calignmentfile.pyx":188
- *             s += 2
- *     elif auxtype == 'i':
- *         for x from 0 <= x < nvalues:             # <<<<<<<<<<<<<<
- *             values.append((<int32_t*>s)[0])
- *             s += 4
- */
-    __pyx_t_2 = __pyx_v_nvalues;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-      /* "pysam/calignmentfile.pyx":189
- *     elif auxtype == 'i':
- *         for x from 0 <= x < nvalues:
- *             values.append((<int32_t*>s)[0])             # <<<<<<<<<<<<<<
- *             s += 4
- *     elif auxtype == 'I':
- */
-      __pyx_t_1 = __Pyx_PyInt_From_int32_t((((int32_t *)__pyx_v_s)[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":190
- *         for x from 0 <= x < nvalues:
- *             values.append((<int32_t*>s)[0])
- *             s += 4             # <<<<<<<<<<<<<<
- *     elif auxtype == 'I':
- *         for x from 0 <= x < nvalues:
- */
-      __pyx_v_s = (__pyx_v_s + 4);
-    }
-    break;
-
-    /* "pysam/calignmentfile.pyx":191
- *             values.append((<int32_t*>s)[0])
- *             s += 4
- *     elif auxtype == 'I':             # <<<<<<<<<<<<<<
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint32_t*>s)[0])
- */
-    case 'I':
-
-    /* "pysam/calignmentfile.pyx":192
- *             s += 4
- *     elif auxtype == 'I':
- *         for x from 0 <= x < nvalues:             # <<<<<<<<<<<<<<
- *             values.append((<uint32_t*>s)[0])
- *             s += 4
- */
-    __pyx_t_2 = __pyx_v_nvalues;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-      /* "pysam/calignmentfile.pyx":193
- *     elif auxtype == 'I':
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint32_t*>s)[0])             # <<<<<<<<<<<<<<
- *             s += 4
- *     elif auxtype == 'f':
- */
-      __pyx_t_1 = __Pyx_PyInt_From_uint32_t((((uint32_t *)__pyx_v_s)[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":194
- *         for x from 0 <= x < nvalues:
- *             values.append((<uint32_t*>s)[0])
- *             s += 4             # <<<<<<<<<<<<<<
- *     elif auxtype == 'f':
- *         for x from 0 <= x < nvalues:
- */
-      __pyx_v_s = (__pyx_v_s + 4);
-    }
-    break;
-
-    /* "pysam/calignmentfile.pyx":195
- *             values.append((<uint32_t*>s)[0])
- *             s += 4
- *     elif auxtype == 'f':             # <<<<<<<<<<<<<<
- *         for x from 0 <= x < nvalues:
- *             values.append((<float*>s)[0])
- */
-    case 'f':
-
-    /* "pysam/calignmentfile.pyx":196
- *             s += 4
- *     elif auxtype == 'f':
- *         for x from 0 <= x < nvalues:             # <<<<<<<<<<<<<<
- *             values.append((<float*>s)[0])
- *             s += 4
- */
-    __pyx_t_2 = __pyx_v_nvalues;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-      /* "pysam/calignmentfile.pyx":197
- *     elif auxtype == 'f':
- *         for x from 0 <= x < nvalues:
- *             values.append((<float*>s)[0])             # <<<<<<<<<<<<<<
- *             s += 4
- * 
- */
-      __pyx_t_1 = PyFloat_FromDouble((((float *)__pyx_v_s)[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":198
- *         for x from 0 <= x < nvalues:
- *             values.append((<float*>s)[0])
- *             s += 4             # <<<<<<<<<<<<<<
- * 
- *     return byte_size, nvalues, values
- */
-      __pyx_v_s = (__pyx_v_s + 4);
-    }
-    break;
-    default: break;
-  }
-
-  /* "pysam/calignmentfile.pyx":200
- *             s += 4
- * 
- *     return byte_size, nvalues, values             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_byte_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_nvalues); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_values);
-  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_values);
-  __Pyx_GIVEREF(__pyx_v_values);
-  __pyx_t_1 = 0;
-  __pyx_t_4 = 0;
-  __pyx_r = __pyx_t_5;
-  __pyx_t_5 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":156
- *     return dest
- * 
- * cdef convertBinaryTagToList( uint8_t * s ):             # <<<<<<<<<<<<<<
- *     """return bytesize, number of values list of values in s."""
- *     cdef char auxtype
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.calignmentfile.convertBinaryTagToList", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_values);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":297
- *     '''
- * 
- *     def __cinit__(self, *args, **kwargs ):             # <<<<<<<<<<<<<<
- *         self.htsfile = NULL
- *         self._filename = None
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_args = 0;
-  PyObject *__pyx_v_kwargs = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
-  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
-  if (unlikely(!__pyx_v_kwargs)) return -1;
-  __Pyx_GOTREF(__pyx_v_kwargs);
-  __Pyx_INCREF(__pyx_args);
-  __pyx_v_args = __pyx_args;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile___cinit__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
-  /* function exit code */
-  __Pyx_XDECREF(__pyx_v_args);
-  __Pyx_XDECREF(__pyx_v_kwargs);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_13AlignmentFile___cinit__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-  __Pyx_TraceCall("__cinit__", __pyx_f[0], 297);
-
-  /* "pysam/calignmentfile.pyx":298
- * 
- *     def __cinit__(self, *args, **kwargs ):
- *         self.htsfile = NULL             # <<<<<<<<<<<<<<
- *         self._filename = None
- *         self.isbam = False
- */
-  __pyx_v_self->htsfile = NULL;
-
-  /* "pysam/calignmentfile.pyx":299
- *     def __cinit__(self, *args, **kwargs ):
- *         self.htsfile = NULL
- *         self._filename = None             # <<<<<<<<<<<<<<
- *         self.isbam = False
- *         self.isstream = False
- */
-  __Pyx_INCREF(Py_None);
-  __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(__pyx_v_self->_filename);
-  __Pyx_DECREF(__pyx_v_self->_filename);
-  __pyx_v_self->_filename = Py_None;
-
-  /* "pysam/calignmentfile.pyx":300
- *         self.htsfile = NULL
- *         self._filename = None
- *         self.isbam = False             # <<<<<<<<<<<<<<
- *         self.isstream = False
- *         self._open(*args, **kwargs)
- */
-  __pyx_v_self->isbam = 0;
-
-  /* "pysam/calignmentfile.pyx":301
- *         self._filename = None
- *         self.isbam = False
- *         self.isstream = False             # <<<<<<<<<<<<<<
- *         self._open(*args, **kwargs)
- * 
- */
-  __pyx_v_self->isstream = 0;
-
-  /* "pysam/calignmentfile.pyx":302
- *         self.isbam = False
- *         self.isstream = False
- *         self._open(*args, **kwargs)             # <<<<<<<<<<<<<<
- * 
- *         # allocate memory for iterator
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __pyx_v_kwargs;
-  __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":305
- * 
- *         # allocate memory for iterator
- *         self.b = <bam1_t*>calloc(1, sizeof(bam1_t))             # <<<<<<<<<<<<<<
- * 
- *     def _isOpen( self ):
- */
-  __pyx_v_self->b = ((bam1_t *)calloc(1, (sizeof(bam1_t))));
-
-  /* "pysam/calignmentfile.pyx":297
- *     '''
- * 
- *     def __cinit__(self, *args, **kwargs ):             # <<<<<<<<<<<<<<
- *         self.htsfile = NULL
- *         self._filename = None
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":307
- *         self.b = <bam1_t*>calloc(1, sizeof(bam1_t))
- * 
- *     def _isOpen( self ):             # <<<<<<<<<<<<<<
- *         '''return true if htsfile has been opened.'''
- *         return self.htsfile != NULL
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_3_isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_2_isOpen[] = "AlignmentFile._isOpen(self)\nreturn true if htsfile has been opened.";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_3_isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_isOpen (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_2_isOpen(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_2_isOpen(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_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("_isOpen", 0);
-  __Pyx_TraceCall("_isOpen", __pyx_f[0], 307);
-
-  /* "pysam/calignmentfile.pyx":309
- *     def _isOpen( self ):
- *         '''return true if htsfile has been opened.'''
- *         return self.htsfile != NULL             # <<<<<<<<<<<<<<
- * 
- *     def _hasIndex( self ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->htsfile != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":307
- *         self.b = <bam1_t*>calloc(1, sizeof(bam1_t))
- * 
- *     def _isOpen( self ):             # <<<<<<<<<<<<<<
- *         '''return true if htsfile has been opened.'''
- *         return self.htsfile != NULL
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._isOpen", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":311
- *         return self.htsfile != NULL
- * 
- *     def _hasIndex( self ):             # <<<<<<<<<<<<<<
- *         '''return true if htsfile has an existing (and opened) index.'''
- *         return self.index != NULL
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_5_hasIndex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_4_hasIndex[] = "AlignmentFile._hasIndex(self)\nreturn true if htsfile has an existing (and opened) index.";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_5_hasIndex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_hasIndex (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_4_hasIndex(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_4_hasIndex(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_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("_hasIndex", 0);
-  __Pyx_TraceCall("_hasIndex", __pyx_f[0], 311);
-
-  /* "pysam/calignmentfile.pyx":313
- *     def _hasIndex( self ):
- *         '''return true if htsfile has an existing (and opened) index.'''
- *         return self.index != NULL             # <<<<<<<<<<<<<<
- * 
- *     def _open(self,
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->index != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":311
- *         return self.htsfile != NULL
- * 
- *     def _hasIndex( self ):             # <<<<<<<<<<<<<<
- *         '''return true if htsfile has an existing (and opened) index.'''
- *         return self.index != NULL
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._hasIndex", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":315
- *         return self.index != NULL
- * 
- *     def _open(self,             # <<<<<<<<<<<<<<
- *               filename,
- *               mode=None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_7_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_6_open[] = "AlignmentFile._open(self, filename, mode=None, AlignmentFile template=None, referencenames=None, referencelengths=None, text=None, header=None, port=None, add_sq_text=True, check_header=True, check_sq=True)\nopen a sam/bam file.\n\n        If _open is called on an existing bamfile, the current file will be\n        closed and a new file will be opened.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_7_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_filename = 0;
-  PyObject *__pyx_v_mode = 0;
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_template = 0;
-  PyObject *__pyx_v_referencenames = 0;
-  PyObject *__pyx_v_referencelengths = 0;
-  PyObject *__pyx_v_text = 0;
-  PyObject *__pyx_v_header = 0;
-  PyObject *__pyx_v_port = 0;
-  PyObject *__pyx_v_add_sq_text = 0;
-  PyObject *__pyx_v_check_header = 0;
-  PyObject *__pyx_v_check_sq = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_mode,&__pyx_n_s_template,&__pyx_n_s_referencenames,&__pyx_n_s_referencelengths,&__pyx_n_s_text,&__pyx_n_s_header,&__pyx_n_s_port,&__pyx_n_s_add_sq_text,&__pyx_n_s_check_header,&__pyx_n_s_check_sq,0};
-    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
-
-    /* "pysam/calignmentfile.pyx":317
- *     def _open(self,
- *               filename,
- *               mode=None,             # <<<<<<<<<<<<<<
- *               AlignmentFile template=None,
- *               referencenames=None,
- */
-    values[1] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":318
- *               filename,
- *               mode=None,
- *               AlignmentFile template=None,             # <<<<<<<<<<<<<<
- *               referencenames=None,
- *               referencelengths=None,
- */
-    values[2] = (PyObject *)((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":319
- *               mode=None,
- *               AlignmentFile template=None,
- *               referencenames=None,             # <<<<<<<<<<<<<<
- *               referencelengths=None,
- *               text=None,
- */
-    values[3] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":320
- *               AlignmentFile template=None,
- *               referencenames=None,
- *               referencelengths=None,             # <<<<<<<<<<<<<<
- *               text=None,
- *               header=None,
- */
-    values[4] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":321
- *               referencenames=None,
- *               referencelengths=None,
- *               text=None,             # <<<<<<<<<<<<<<
- *               header=None,
- *               port=None,
- */
-    values[5] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":322
- *               referencelengths=None,
- *               text=None,
- *               header=None,             # <<<<<<<<<<<<<<
- *               port=None,
- *               add_sq_text=True,
- */
-    values[6] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":323
- *               text=None,
- *               header=None,
- *               port=None,             # <<<<<<<<<<<<<<
- *               add_sq_text=True,
- *               check_header=True,
- */
-    values[7] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":324
- *               header=None,
- *               port=None,
- *               add_sq_text=True,             # <<<<<<<<<<<<<<
- *               check_header=True,
- *               check_sq=True):
- */
-    values[8] = ((PyObject *)Py_True);
-
-    /* "pysam/calignmentfile.pyx":325
- *               port=None,
- *               add_sq_text=True,
- *               check_header=True,             # <<<<<<<<<<<<<<
- *               check_sq=True):
- *         '''open a sam/bam file.
- */
-    values[9] = ((PyObject *)Py_True);
-
-    /* "pysam/calignmentfile.pyx":326
- *               add_sq_text=True,
- *               check_header=True,
- *               check_sq=True):             # <<<<<<<<<<<<<<
- *         '''open a sam/bam file.
- * 
- */
-    values[10] = ((PyObject *)Py_True);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
-        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
-        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
-        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
-        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_template);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_referencenames);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_referencelengths);
-          if (value) { values[4] = value; kw_args--; }
-        }
-        case  5:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text);
-          if (value) { values[5] = value; kw_args--; }
-        }
-        case  6:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_header);
-          if (value) { values[6] = value; kw_args--; }
-        }
-        case  7:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port);
-          if (value) { values[7] = value; kw_args--; }
-        }
-        case  8:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_add_sq_text);
-          if (value) { values[8] = value; kw_args--; }
-        }
-        case  9:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check_header);
-          if (value) { values[9] = value; kw_args--; }
-        }
-        case 10:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check_sq);
-          if (value) { values[10] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
-        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
-        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
-        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
-        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_filename = values[0];
-    __pyx_v_mode = values[1];
-    __pyx_v_template = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[2]);
-    __pyx_v_referencenames = values[3];
-    __pyx_v_referencelengths = values[4];
-    __pyx_v_text = values[5];
-    __pyx_v_header = values[6];
-    __pyx_v_port = values[7];
-    __pyx_v_add_sq_text = values[8];
-    __pyx_v_check_header = values[9];
-    __pyx_v_check_sq = values[10];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 11, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_template), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "template", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6_open(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_mode, __pyx_v_template, __pyx_v_referencenames, __pyx_v_referencelengths, __pyx_v_text, __pyx_v_header, __pyx_v_port, __pyx_v_add_sq_text, __pyx_v_check_header, __pyx_v_check_sq);
-
-  /* "pysam/calignmentfile.pyx":315
- *         return self.index != NULL
- * 
- *     def _open(self,             # <<<<<<<<<<<<<<
- *               filename,
- *               mode=None,
- */
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6_open(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_template, PyObject *__pyx_v_referencenames, PyObject *__pyx_v_referencelengths, PyObject *__pyx_v_text, PyObject *__pyx_v_header, PyObject *__pyx_v_port, PyObject *__pyx_v_add_sq_text, PyObject *__pyx_v_check_header, PyObject *__pyx_ [...]
-  CYTHON_UNUSED PyObject *__pyx_v_msg = NULL;
-  PyObject *__pyx_v_bmode = 0;
-  char *__pyx_v_ctext;
-  PyObject *__pyx_v_n = NULL;
-  PyObject *__pyx_v_x = NULL;
-  PyObject *__pyx_v_name = NULL;
-  PyObject *__pyx_v_ref = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  int __pyx_t_10;
-  int __pyx_t_11;
-  Py_ssize_t __pyx_t_12;
-  Py_ssize_t __pyx_t_13;
-  PyObject *(*__pyx_t_14)(PyObject *);
-  size_t __pyx_t_15;
-  int32_t __pyx_t_16;
-  long __pyx_t_17;
-  uint32_t __pyx_t_18;
-  char const *__pyx_t_19;
-  int __pyx_t_20;
-  char *__pyx_t_21;
-  char const *__pyx_t_22;
-  char const *__pyx_t_23;
-  int __pyx_t_24;
-  BGZF *__pyx_t_25;
-  char const *__pyx_t_26;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_open", 0);
-  __Pyx_TraceCall("_open", __pyx_f[0], 315);
-  __Pyx_INCREF(__pyx_v_filename);
-  __Pyx_INCREF(__pyx_v_mode);
-  __Pyx_INCREF(__pyx_v_referencenames);
-  __Pyx_INCREF(__pyx_v_text);
-
-  /* "pysam/calignmentfile.pyx":334
- * 
- *         # read mode autodetection
- *         if mode is None:             # <<<<<<<<<<<<<<
- *             try:
- *                 self._open(filename, 'rb',
- */
-  __pyx_t_1 = (__pyx_v_mode == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":335
- *         # read mode autodetection
- *         if mode is None:
- *             try:             # <<<<<<<<<<<<<<
- *                 self._open(filename, 'rb',
- *                            template=template,
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
-      __Pyx_XGOTREF(__pyx_t_3);
-      __Pyx_XGOTREF(__pyx_t_4);
-      __Pyx_XGOTREF(__pyx_t_5);
-      /*try:*/ {
-
-        /* "pysam/calignmentfile.pyx":336
- *         if mode is None:
- *             try:
- *                 self._open(filename, 'rb',             # <<<<<<<<<<<<<<
- *                            template=template,
- *                            referencenames=referencenames,
- */
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_INCREF(__pyx_v_filename);
-        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filename);
-        __Pyx_GIVEREF(__pyx_v_filename);
-        __Pyx_INCREF(__pyx_n_s_rb);
-        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_rb);
-        __Pyx_GIVEREF(__pyx_n_s_rb);
-        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-
-        /* "pysam/calignmentfile.pyx":337
- *             try:
- *                 self._open(filename, 'rb',
- *                            template=template,             # <<<<<<<<<<<<<<
- *                            referencenames=referencenames,
- *                            referencelengths=referencelengths,
- */
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_template, ((PyObject *)__pyx_v_template)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-
-        /* "pysam/calignmentfile.pyx":338
- *                 self._open(filename, 'rb',
- *                            template=template,
- *                            referencenames=referencenames,             # <<<<<<<<<<<<<<
- *                            referencelengths=referencelengths,
- *                            text=text,
- */
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_referencenames, __pyx_v_referencenames) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-
-        /* "pysam/calignmentfile.pyx":339
- *                            template=template,
- *                            referencenames=referencenames,
- *                            referencelengths=referencelengths,             # <<<<<<<<<<<<<<
- *                            text=text,
- *                            header=header,
- */
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_referencelengths, __pyx_v_referencelengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-
-        /* "pysam/calignmentfile.pyx":340
- *                            referencenames=referencenames,
- *                            referencelengths=referencelengths,
- *                            text=text,             # <<<<<<<<<<<<<<
- *                            header=header,
- *                            port=port,
- */
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_text, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-
-        /* "pysam/calignmentfile.pyx":341
- *                            referencelengths=referencelengths,
- *                            text=text,
- *                            header=header,             # <<<<<<<<<<<<<<
- *                            port=port,
- *                            check_header=check_header,
- */
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_header, __pyx_v_header) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-
-        /* "pysam/calignmentfile.pyx":342
- *                            text=text,
- *                            header=header,
- *                            port=port,             # <<<<<<<<<<<<<<
- *                            check_header=check_header,
- *                            check_sq=check_sq)
- */
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_port, __pyx_v_port) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-
-        /* "pysam/calignmentfile.pyx":343
- *                            header=header,
- *                            port=port,
- *                            check_header=check_header,             # <<<<<<<<<<<<<<
- *                            check_sq=check_sq)
- *                 return
- */
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_check_header, __pyx_v_check_header) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-
-        /* "pysam/calignmentfile.pyx":344
- *                            port=port,
- *                            check_header=check_header,
- *                            check_sq=check_sq)             # <<<<<<<<<<<<<<
- *                 return
- *             except ValueError, msg:
- */
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_check_sq, __pyx_v_check_sq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-
-        /* "pysam/calignmentfile.pyx":336
- *         if mode is None:
- *             try:
- *                 self._open(filename, 'rb',             # <<<<<<<<<<<<<<
- *                            template=template,
- *                            referencenames=referencenames,
- */
-        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-        /* "pysam/calignmentfile.pyx":345
- *                            check_header=check_header,
- *                            check_sq=check_sq)
- *                 return             # <<<<<<<<<<<<<<
- *             except ValueError, msg:
- *                 pass
- */
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-        goto __pyx_L8_try_return;
-      }
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L11_try_end;
-      __pyx_L4_error:;
-      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-      /* "pysam/calignmentfile.pyx":346
- *                            check_sq=check_sq)
- *                 return
- *             except ValueError, msg:             # <<<<<<<<<<<<<<
- *                 pass
- * 
- */
-      __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-      if (__pyx_t_10) {
-        __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_INCREF(__pyx_t_8);
-        __pyx_v_msg = __pyx_t_8;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L5_exception_handled;
-      }
-      goto __pyx_L6_except_error;
-      __pyx_L6_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-      goto __pyx_L1_error;
-      __pyx_L8_try_return:;
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-      goto __pyx_L0;
-      __pyx_L5_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-      __pyx_L11_try_end:;
-    }
-
-    /* "pysam/calignmentfile.pyx":349
- *                 pass
- * 
- *             self._open(filename, 'r',             # <<<<<<<<<<<<<<
- *                        template=template,
- *                        referencenames=referencenames,
- */
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = PyTuple_New(2); 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_INCREF(__pyx_v_filename);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_filename);
-    __Pyx_GIVEREF(__pyx_v_filename);
-    __Pyx_INCREF(__pyx_n_s_r);
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_r);
-    __Pyx_GIVEREF(__pyx_n_s_r);
-    __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-
-    /* "pysam/calignmentfile.pyx":350
- * 
- *             self._open(filename, 'r',
- *                        template=template,             # <<<<<<<<<<<<<<
- *                        referencenames=referencenames,
- *                        referencelengths=referencelengths,
- */
-    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_template, ((PyObject *)__pyx_v_template)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":351
- *             self._open(filename, 'r',
- *                        template=template,
- *                        referencenames=referencenames,             # <<<<<<<<<<<<<<
- *                        referencelengths=referencelengths,
- *                        text=text,
- */
-    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_referencenames, __pyx_v_referencenames) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":352
- *                        template=template,
- *                        referencenames=referencenames,
- *                        referencelengths=referencelengths,             # <<<<<<<<<<<<<<
- *                        text=text,
- *                        header=header,
- */
-    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_referencelengths, __pyx_v_referencelengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":353
- *                        referencenames=referencenames,
- *                        referencelengths=referencelengths,
- *                        text=text,             # <<<<<<<<<<<<<<
- *                        header=header,
- *                        port=port,
- */
-    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_text, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":354
- *                        referencelengths=referencelengths,
- *                        text=text,
- *                        header=header,             # <<<<<<<<<<<<<<
- *                        port=port,
- *                        check_header=check_header,
- */
-    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_header, __pyx_v_header) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":355
- *                        text=text,
- *                        header=header,
- *                        port=port,             # <<<<<<<<<<<<<<
- *                        check_header=check_header,
- *                        check_sq=check_sq)
- */
-    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_port, __pyx_v_port) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":356
- *                        header=header,
- *                        port=port,
- *                        check_header=check_header,             # <<<<<<<<<<<<<<
- *                        check_sq=check_sq)
- *             return
- */
-    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_check_header, __pyx_v_check_header) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":357
- *                        port=port,
- *                        check_header=check_header,
- *                        check_sq=check_sq)             # <<<<<<<<<<<<<<
- *             return
- * 
- */
-    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_check_sq, __pyx_v_check_sq) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":349
- *                 pass
- * 
- *             self._open(filename, 'r',             # <<<<<<<<<<<<<<
- *                        template=template,
- *                        referencenames=referencenames,
- */
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-    /* "pysam/calignmentfile.pyx":358
- *                        check_header=check_header,
- *                        check_sq=check_sq)
- *             return             # <<<<<<<<<<<<<<
- * 
- *         assert mode in ("r","w","rb","wb", "wh", "wbu", "rU", "wb0"), \
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":360
- *             return
- * 
- *         assert mode in ("r","w","rb","wb", "wh", "wbu", "rU", "wb0"), \             # <<<<<<<<<<<<<<
- *             "invalid file opening mode `%s`" % mode
- * 
- */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    __Pyx_INCREF(__pyx_v_mode);
-    __pyx_t_6 = __pyx_v_mode;
-    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!__pyx_t_2) {
-      __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_11 = __pyx_t_1;
-    } else {
-      __pyx_t_11 = __pyx_t_2;
-    }
-    if (!__pyx_t_11) {
-      __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_rb, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = __pyx_t_2;
-    } else {
-      __pyx_t_1 = __pyx_t_11;
-    }
-    if (!__pyx_t_1) {
-      __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_wb, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __pyx_t_11;
-    } else {
-      __pyx_t_2 = __pyx_t_1;
-    }
-    if (!__pyx_t_2) {
-      __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_wh, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_11 = __pyx_t_1;
-    } else {
-      __pyx_t_11 = __pyx_t_2;
-    }
-    if (!__pyx_t_11) {
-      __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_wbu, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = __pyx_t_2;
-    } else {
-      __pyx_t_1 = __pyx_t_11;
-    }
-    if (!__pyx_t_1) {
-      __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_rU, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __pyx_t_11;
-    } else {
-      __pyx_t_2 = __pyx_t_1;
-    }
-    if (!__pyx_t_2) {
-      __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_wb0, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_11 = __pyx_t_1;
-    } else {
-      __pyx_t_11 = __pyx_t_2;
-    }
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!(__pyx_t_11 != 0))) {
-
-      /* "pysam/calignmentfile.pyx":361
- * 
- *         assert mode in ("r","w","rb","wb", "wh", "wbu", "rU", "wb0"), \
- *             "invalid file opening mode `%s`" % mode             # <<<<<<<<<<<<<<
- * 
- *         # close a previously opened file
- */
-      __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_invalid_file_opening_mode_s, __pyx_v_mode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyErr_SetObject(PyExc_AssertionError, __pyx_t_6);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-
-  /* "pysam/calignmentfile.pyx":364
- * 
- *         # close a previously opened file
- *         if self.htsfile != NULL:             # <<<<<<<<<<<<<<
- *             self.close()
- * 
- */
-  __pyx_t_11 = ((__pyx_v_self->htsfile != NULL) != 0);
-  if (__pyx_t_11) {
-
-    /* "pysam/calignmentfile.pyx":365
- *         # close a previously opened file
- *         if self.htsfile != NULL:
- *             self.close()             # <<<<<<<<<<<<<<
- * 
- *         # for htslib, wbu seems to not work
- */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    goto __pyx_L14;
-  }
-  __pyx_L14:;
-
-  /* "pysam/calignmentfile.pyx":368
- * 
- *         # for htslib, wbu seems to not work
- *         if mode == "wbu":             # <<<<<<<<<<<<<<
- *             mode = "wb0"
- * 
- */
-  __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_wbu, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_11) {
-
-    /* "pysam/calignmentfile.pyx":369
- *         # for htslib, wbu seems to not work
- *         if mode == "wbu":
- *             mode = "wb0"             # <<<<<<<<<<<<<<
- * 
- *         cdef bytes bmode = mode.encode('ascii')
- */
-    __Pyx_INCREF(__pyx_n_s_wb0);
-    __Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_wb0);
-    goto __pyx_L15;
-  }
-  __pyx_L15:;
-
-  /* "pysam/calignmentfile.pyx":371
- *             mode = "wb0"
- * 
- *         cdef bytes bmode = mode.encode('ascii')             # <<<<<<<<<<<<<<
- *         self._filename = filename = _encodeFilename(filename)
- *         self.isstream = filename == b"-"
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_mode, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_bmode = ((PyObject*)__pyx_t_6);
-  __pyx_t_6 = 0;
-
-  /* "pysam/calignmentfile.pyx":372
- * 
- *         cdef bytes bmode = mode.encode('ascii')
- *         self._filename = filename = _encodeFilename(filename)             # <<<<<<<<<<<<<<
- *         self.isstream = filename == b"-"
- * 
- */
-  __pyx_t_6 = __pyx_f_5pysam_14calignmentfile__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_INCREF(__pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  __Pyx_GOTREF(__pyx_v_self->_filename);
-  __Pyx_DECREF(__pyx_v_self->_filename);
-  __pyx_v_self->_filename = __pyx_t_6;
-  __Pyx_INCREF(__pyx_t_6);
-  __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_6);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "pysam/calignmentfile.pyx":373
- *         cdef bytes bmode = mode.encode('ascii')
- *         self._filename = filename = _encodeFilename(filename)
- *         self.isstream = filename == b"-"             # <<<<<<<<<<<<<<
- * 
- *         self.isbam = len(mode) > 1 and mode[1] == 'b'
- */
-  __pyx_t_6 = PyObject_RichCompare(__pyx_v_filename, __pyx_kp_b__4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_v_self->isstream = __pyx_t_10;
-
-  /* "pysam/calignmentfile.pyx":375
- *         self.isstream = filename == b"-"
- * 
- *         self.isbam = len(mode) > 1 and mode[1] == 'b'             # <<<<<<<<<<<<<<
- * 
- *         self.isremote = filename.startswith(b"http:") or \
- */
-  __pyx_t_12 = PyObject_Length(__pyx_v_mode); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_6 = __Pyx_PyBool_FromLong((__pyx_t_12 > 1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_11) {
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_mode, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_n_s_b, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = __pyx_t_8;
-    __pyx_t_8 = 0;
-  } else {
-    __pyx_t_9 = __pyx_t_6;
-    __pyx_t_6 = 0;
-  }
-  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_v_self->isbam = __pyx_t_10;
-
-  /* "pysam/calignmentfile.pyx":377
- *         self.isbam = len(mode) > 1 and mode[1] == 'b'
- * 
- *         self.isremote = filename.startswith(b"http:") or \             # <<<<<<<<<<<<<<
- *                         filename.startswith(b"ftp:")
- * 
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_startswith); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_11) {
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-    /* "pysam/calignmentfile.pyx":378
- * 
- *         self.isremote = filename.startswith(b"http:") or \
- *                         filename.startswith(b"ftp:")             # <<<<<<<<<<<<<<
- * 
- *         cdef char * ctext
- */
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_startswith); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = __pyx_t_8;
-    __pyx_t_8 = 0;
-  } else {
-    __pyx_t_9 = __pyx_t_6;
-    __pyx_t_6 = 0;
-  }
-
-  /* "pysam/calignmentfile.pyx":377
- *         self.isbam = len(mode) > 1 and mode[1] == 'b'
- * 
- *         self.isremote = filename.startswith(b"http:") or \             # <<<<<<<<<<<<<<
- *                         filename.startswith(b"ftp:")
- * 
- */
-  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_v_self->isremote = __pyx_t_10;
-
-  /* "pysam/calignmentfile.pyx":381
- * 
- *         cdef char * ctext
- *         ctext = NULL             # <<<<<<<<<<<<<<
- * 
- *         if mode[0] == 'w':
- */
-  __pyx_v_ctext = NULL;
-
-  /* "pysam/calignmentfile.pyx":383
- *         ctext = NULL
- * 
- *         if mode[0] == 'w':             # <<<<<<<<<<<<<<
- *             # open file for writing
- * 
- */
-  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_mode, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_11) {
-
-    /* "pysam/calignmentfile.pyx":387
- * 
- *             # header structure (used for writing)
- *             if template:             # <<<<<<<<<<<<<<
- *                 self.header = bam_hdr_dup(template.header)
- *             elif header:
- */
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_template)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_11) {
-
-      /* "pysam/calignmentfile.pyx":388
- *             # header structure (used for writing)
- *             if template:
- *                 self.header = bam_hdr_dup(template.header)             # <<<<<<<<<<<<<<
- *             elif header:
- *                 self.header = self._buildHeader(header)
- */
-      __pyx_v_self->header = bam_hdr_dup(__pyx_v_template->header);
-      goto __pyx_L17;
-    }
-
-    /* "pysam/calignmentfile.pyx":389
- *             if template:
- *                 self.header = bam_hdr_dup(template.header)
- *             elif header:             # <<<<<<<<<<<<<<
- *                 self.header = self._buildHeader(header)
- *             else:
- */
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_header); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_11) {
-
-      /* "pysam/calignmentfile.pyx":390
- *                 self.header = bam_hdr_dup(template.header)
- *             elif header:
- *                 self.header = self._buildHeader(header)             # <<<<<<<<<<<<<<
- *             else:
- *                 # build header from a target names and lengths
- */
-      __pyx_v_self->header = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self->__pyx_vtab)->_buildHeader(__pyx_v_self, __pyx_v_header);
-      goto __pyx_L17;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":393
- *             else:
- *                 # build header from a target names and lengths
- *                 assert referencenames and referencelengths, \             # <<<<<<<<<<<<<<
- *                     ("either supply options `template`, `header` "
- *                      "or  both `referencenames` and `referencelengths` "
- */
-      #ifndef CYTHON_WITHOUT_ASSERTIONS
-      if (unlikely(!Py_OptimizeFlag)) {
-        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_referencenames); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        if (__pyx_t_11) {
-          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_referencelengths); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_1 = __pyx_t_2;
-        } else {
-          __pyx_t_1 = __pyx_t_11;
-        }
-        if (unlikely(!__pyx_t_1)) {
-          PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_either_supply_options_template_h);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-      }
-      #endif
-
-      /* "pysam/calignmentfile.pyx":397
- *                      "or  both `referencenames` and `referencelengths` "
- *                      "for writing")
- *                 assert len(referencenames) == len(referencelengths), \             # <<<<<<<<<<<<<<
- *                     "unequal names and lengths of reference sequences"
- * 
- */
-      #ifndef CYTHON_WITHOUT_ASSERTIONS
-      if (unlikely(!Py_OptimizeFlag)) {
-        __pyx_t_12 = PyObject_Length(__pyx_v_referencenames); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_13 = PyObject_Length(__pyx_v_referencelengths); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        if (unlikely(!((__pyx_t_12 == __pyx_t_13) != 0))) {
-          PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_unequal_names_and_lengths_of_ref);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-      }
-      #endif
-
-      /* "pysam/calignmentfile.pyx":401
- * 
- *                 # allocate and fill header
- *                 referencenames = [_forceBytes(ref) for ref in referencenames]             # <<<<<<<<<<<<<<
- *                 self.header = bam_hdr_init()
- *                 self.header.n_targets = len(referencenames)
- */
-      __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      if (PyList_CheckExact(__pyx_v_referencenames) || PyTuple_CheckExact(__pyx_v_referencenames)) {
-        __pyx_t_6 = __pyx_v_referencenames; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0;
-        __pyx_t_14 = NULL;
-      } else {
-        __pyx_t_13 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_referencenames); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext;
-      }
-      for (;;) {
-        if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_6)) {
-          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_6)) {
-          if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else {
-          __pyx_t_8 = __pyx_t_14(__pyx_t_6);
-          if (unlikely(!__pyx_t_8)) {
-            PyObject* exc_type = PyErr_Occurred();
-            if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            }
-            break;
-          }
-          __Pyx_GOTREF(__pyx_t_8);
-        }
-        __Pyx_XDECREF_SET(__pyx_v_ref, __pyx_t_8);
-        __pyx_t_8 = 0;
-        __pyx_t_8 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_ref); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      }
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF_SET(__pyx_v_referencenames, __pyx_t_9);
-      __pyx_t_9 = 0;
-
-      /* "pysam/calignmentfile.pyx":402
- *                 # allocate and fill header
- *                 referencenames = [_forceBytes(ref) for ref in referencenames]
- *                 self.header = bam_hdr_init()             # <<<<<<<<<<<<<<
- *                 self.header.n_targets = len(referencenames)
- *                 n = 0
- */
-      __pyx_v_self->header = bam_hdr_init();
-
-      /* "pysam/calignmentfile.pyx":403
- *                 referencenames = [_forceBytes(ref) for ref in referencenames]
- *                 self.header = bam_hdr_init()
- *                 self.header.n_targets = len(referencenames)             # <<<<<<<<<<<<<<
- *                 n = 0
- *                 for x in referencenames:
- */
-      __pyx_t_13 = PyObject_Length(__pyx_v_referencenames); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_self->header->n_targets = __pyx_t_13;
-
-      /* "pysam/calignmentfile.pyx":404
- *                 self.header = bam_hdr_init()
- *                 self.header.n_targets = len(referencenames)
- *                 n = 0             # <<<<<<<<<<<<<<
- *                 for x in referencenames:
- *                     n += len(x) + 1
- */
-      __Pyx_INCREF(__pyx_int_0);
-      __pyx_v_n = __pyx_int_0;
-
-      /* "pysam/calignmentfile.pyx":405
- *                 self.header.n_targets = len(referencenames)
- *                 n = 0
- *                 for x in referencenames:             # <<<<<<<<<<<<<<
- *                     n += len(x) + 1
- *                 self.header.target_name = <char**>calloc(
- */
-      if (PyList_CheckExact(__pyx_v_referencenames) || PyTuple_CheckExact(__pyx_v_referencenames)) {
-        __pyx_t_9 = __pyx_v_referencenames; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0;
-        __pyx_t_14 = NULL;
-      } else {
-        __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_referencenames); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext;
-      }
-      for (;;) {
-        if (!__pyx_t_14 && PyList_CheckExact(__pyx_t_9)) {
-          if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else if (!__pyx_t_14 && PyTuple_CheckExact(__pyx_t_9)) {
-          if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else {
-          __pyx_t_6 = __pyx_t_14(__pyx_t_9);
-          if (unlikely(!__pyx_t_6)) {
-            PyObject* exc_type = PyErr_Occurred();
-            if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            }
-            break;
-          }
-          __Pyx_GOTREF(__pyx_t_6);
-        }
-        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_6);
-        __pyx_t_6 = 0;
-
-        /* "pysam/calignmentfile.pyx":406
- *                 n = 0
- *                 for x in referencenames:
- *                     n += len(x) + 1             # <<<<<<<<<<<<<<
- *                 self.header.target_name = <char**>calloc(
- *                     n, sizeof(char*))
- */
-        __pyx_t_12 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_12 + 1)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8);
-        __pyx_t_8 = 0;
-      }
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-      /* "pysam/calignmentfile.pyx":408
- *                     n += len(x) + 1
- *                 self.header.target_name = <char**>calloc(
- *                     n, sizeof(char*))             # <<<<<<<<<<<<<<
- *                 self.header.target_len = <uint32_t*>calloc(
- *                     n, sizeof(uint32_t))
- */
-      __pyx_t_15 = __Pyx_PyInt_As_size_t(__pyx_v_n); if (unlikely((__pyx_t_15 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-      /* "pysam/calignmentfile.pyx":407
- *                 for x in referencenames:
- *                     n += len(x) + 1
- *                 self.header.target_name = <char**>calloc(             # <<<<<<<<<<<<<<
- *                     n, sizeof(char*))
- *                 self.header.target_len = <uint32_t*>calloc(
- */
-      __pyx_v_self->header->target_name = ((char **)calloc(__pyx_t_15, (sizeof(char *))));
-
-      /* "pysam/calignmentfile.pyx":410
- *                     n, sizeof(char*))
- *                 self.header.target_len = <uint32_t*>calloc(
- *                     n, sizeof(uint32_t))             # <<<<<<<<<<<<<<
- *                 for x from 0 <= x < self.header.n_targets:
- *                     self.header.target_len[x] = referencelengths[x]
- */
-      __pyx_t_15 = __Pyx_PyInt_As_size_t(__pyx_v_n); if (unlikely((__pyx_t_15 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-      /* "pysam/calignmentfile.pyx":409
- *                 self.header.target_name = <char**>calloc(
- *                     n, sizeof(char*))
- *                 self.header.target_len = <uint32_t*>calloc(             # <<<<<<<<<<<<<<
- *                     n, sizeof(uint32_t))
- *                 for x from 0 <= x < self.header.n_targets:
- */
-      __pyx_v_self->header->target_len = ((uint32_t *)calloc(__pyx_t_15, (sizeof(uint32_t))));
-
-      /* "pysam/calignmentfile.pyx":411
- *                 self.header.target_len = <uint32_t*>calloc(
- *                     n, sizeof(uint32_t))
- *                 for x from 0 <= x < self.header.n_targets:             # <<<<<<<<<<<<<<
- *                     self.header.target_len[x] = referencelengths[x]
- *                     name = referencenames[x]
- */
-      __pyx_t_16 = __pyx_v_self->header->n_targets;
-      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17++) {
-        __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_17); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
-        __pyx_t_9 = 0;
-
-        /* "pysam/calignmentfile.pyx":412
- *                     n, sizeof(uint32_t))
- *                 for x from 0 <= x < self.header.n_targets:
- *                     self.header.target_len[x] = referencelengths[x]             # <<<<<<<<<<<<<<
- *                     name = referencenames[x]
- *                     self.header.target_name[x] = <char*>calloc(
- */
-        __pyx_t_9 = PyObject_GetItem(__pyx_v_referencelengths, __pyx_v_x); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_18 = __Pyx_PyInt_As_uint32_t(__pyx_t_9); if (unlikely((__pyx_t_18 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        (__pyx_v_self->header->target_len[__pyx_t_13]) = __pyx_t_18;
-
-        /* "pysam/calignmentfile.pyx":413
- *                 for x from 0 <= x < self.header.n_targets:
- *                     self.header.target_len[x] = referencelengths[x]
- *                     name = referencenames[x]             # <<<<<<<<<<<<<<
- *                     self.header.target_name[x] = <char*>calloc(
- *                         len(name) + 1, sizeof(char))
- */
-        __pyx_t_9 = PyObject_GetItem(__pyx_v_referencenames, __pyx_v_x); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9);
-        __pyx_t_9 = 0;
-
-        /* "pysam/calignmentfile.pyx":415
- *                     name = referencenames[x]
- *                     self.header.target_name[x] = <char*>calloc(
- *                         len(name) + 1, sizeof(char))             # <<<<<<<<<<<<<<
- *                     strncpy(self.header.target_name[x], name, len(name))
- * 
- */
-        __pyx_t_13 = PyObject_Length(__pyx_v_name); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-        /* "pysam/calignmentfile.pyx":414
- *                     self.header.target_len[x] = referencelengths[x]
- *                     name = referencenames[x]
- *                     self.header.target_name[x] = <char*>calloc(             # <<<<<<<<<<<<<<
- *                         len(name) + 1, sizeof(char))
- *                     strncpy(self.header.target_name[x], name, len(name))
- */
-        __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        (__pyx_v_self->header->target_name[__pyx_t_12]) = ((char *)calloc((__pyx_t_13 + 1), (sizeof(char))));
-
-        /* "pysam/calignmentfile.pyx":416
- *                     self.header.target_name[x] = <char*>calloc(
- *                         len(name) + 1, sizeof(char))
- *                     strncpy(self.header.target_name[x], name, len(name))             # <<<<<<<<<<<<<<
- * 
- *                 # Optionally, if there is no text, add a SAM
- */
-        __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 = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_12 = PyObject_Length(__pyx_v_name); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        strncpy((__pyx_v_self->header->target_name[__pyx_t_13]), __pyx_t_19, __pyx_t_12);
-        __pyx_t_17 = __Pyx_PyInt_As_long(__pyx_v_x); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-
-      /* "pysam/calignmentfile.pyx":411
- *                 self.header.target_len = <uint32_t*>calloc(
- *                     n, sizeof(uint32_t))
- *                 for x from 0 <= x < self.header.n_targets:             # <<<<<<<<<<<<<<
- *                     self.header.target_len[x] = referencelengths[x]
- *                     name = referencenames[x]
- */
-      __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_17); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
-      __pyx_t_9 = 0;
-
-      /* "pysam/calignmentfile.pyx":420
- *                 # Optionally, if there is no text, add a SAM
- *                 # compatible header to output file.
- *                 if text is None and add_sq_text:             # <<<<<<<<<<<<<<
- *                     text = []
- *                     for x from 0 <= x < self.header.n_targets:
- */
-      __pyx_t_1 = (__pyx_v_text == Py_None);
-      if (__pyx_t_1) {
-        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_add_sq_text); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_2 = __pyx_t_11;
-      } else {
-        __pyx_t_2 = __pyx_t_1;
-      }
-      if (__pyx_t_2) {
-
-        /* "pysam/calignmentfile.pyx":421
- *                 # compatible header to output file.
- *                 if text is None and add_sq_text:
- *                     text = []             # <<<<<<<<<<<<<<
- *                     for x from 0 <= x < self.header.n_targets:
- *                         text.append("@SQ\tSN:%s\tLN:%s\n" % \
- */
-        __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_9);
-        __pyx_t_9 = 0;
-
-        /* "pysam/calignmentfile.pyx":422
- *                 if text is None and add_sq_text:
- *                     text = []
- *                     for x from 0 <= x < self.header.n_targets:             # <<<<<<<<<<<<<<
- *                         text.append("@SQ\tSN:%s\tLN:%s\n" % \
- *                                     (_forceStr(referencenames[x]),
- */
-        __pyx_t_16 = __pyx_v_self->header->n_targets;
-        for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17++) {
-          __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_17); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
-          __pyx_t_9 = 0;
-
-          /* "pysam/calignmentfile.pyx":424
- *                     for x from 0 <= x < self.header.n_targets:
- *                         text.append("@SQ\tSN:%s\tLN:%s\n" % \
- *                                     (_forceStr(referencenames[x]),             # <<<<<<<<<<<<<<
- *                                      referencelengths[x]))
- *                     text = ''.join(text)
- */
-          __pyx_t_9 = PyObject_GetItem(__pyx_v_referencenames, __pyx_v_x); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_9);
-          __pyx_t_8 = __pyx_f_5pysam_14calignmentfile__forceStr(__pyx_t_9); 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(__pyx_t_9); __pyx_t_9 = 0;
-
-          /* "pysam/calignmentfile.pyx":425
- *                         text.append("@SQ\tSN:%s\tLN:%s\n" % \
- *                                     (_forceStr(referencenames[x]),
- *                                      referencelengths[x]))             # <<<<<<<<<<<<<<
- *                     text = ''.join(text)
- * 
- */
-          __pyx_t_9 = PyObject_GetItem(__pyx_v_referencelengths, __pyx_v_x); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_9);
-
-          /* "pysam/calignmentfile.pyx":424
- *                     for x from 0 <= x < self.header.n_targets:
- *                         text.append("@SQ\tSN:%s\tLN:%s\n" % \
- *                                     (_forceStr(referencenames[x]),             # <<<<<<<<<<<<<<
- *                                      referencelengths[x]))
- *                     text = ''.join(text)
- */
-          __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
-          __Pyx_GIVEREF(__pyx_t_8);
-          PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9);
-          __Pyx_GIVEREF(__pyx_t_9);
-          __pyx_t_8 = 0;
-          __pyx_t_9 = 0;
-
-          /* "pysam/calignmentfile.pyx":423
- *                     text = []
- *                     for x from 0 <= x < self.header.n_targets:
- *                         text.append("@SQ\tSN:%s\tLN:%s\n" % \             # <<<<<<<<<<<<<<
- *                                     (_forceStr(referencenames[x]),
- *                                      referencelengths[x]))
- */
-          __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_SQ_SN_s_LN_s, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_20 = __Pyx_PyObject_Append(__pyx_v_text, __pyx_t_9); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __pyx_t_17 = __Pyx_PyInt_As_long(__pyx_v_x); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-
-        /* "pysam/calignmentfile.pyx":422
- *                 if text is None and add_sq_text:
- *                     text = []
- *                     for x from 0 <= x < self.header.n_targets:             # <<<<<<<<<<<<<<
- *                         text.append("@SQ\tSN:%s\tLN:%s\n" % \
- *                                     (_forceStr(referencenames[x]),
- */
-        __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_17); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
-        __pyx_t_9 = 0;
-
-        /* "pysam/calignmentfile.pyx":426
- *                                     (_forceStr(referencenames[x]),
- *                                      referencelengths[x]))
- *                     text = ''.join(text)             # <<<<<<<<<<<<<<
- * 
- *                 if text is not None:
- */
-        __pyx_t_9 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_text); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_9);
-        __pyx_t_9 = 0;
-        goto __pyx_L24;
-      }
-      __pyx_L24:;
-
-      /* "pysam/calignmentfile.pyx":428
- *                     text = ''.join(text)
- * 
- *                 if text is not None:             # <<<<<<<<<<<<<<
- *                     # copy without \0
- *                     text = _forceBytes(text)
- */
-      __pyx_t_2 = (__pyx_v_text != Py_None);
-      __pyx_t_1 = (__pyx_t_2 != 0);
-      if (__pyx_t_1) {
-
-        /* "pysam/calignmentfile.pyx":430
- *                 if text is not None:
- *                     # copy without \0
- *                     text = _forceBytes(text)             # <<<<<<<<<<<<<<
- *                     ctext = text
- *                     self.header.l_text = strlen(ctext)
- */
-        __pyx_t_9 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_text); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_9);
-        __pyx_t_9 = 0;
-
-        /* "pysam/calignmentfile.pyx":431
- *                     # copy without \0
- *                     text = _forceBytes(text)
- *                     ctext = text             # <<<<<<<<<<<<<<
- *                     self.header.l_text = strlen(ctext)
- *                     self.header.text = <char*>calloc(
- */
-        __pyx_t_21 = __Pyx_PyObject_AsString(__pyx_v_text); if (unlikely((!__pyx_t_21) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_v_ctext = __pyx_t_21;
-
-        /* "pysam/calignmentfile.pyx":432
- *                     text = _forceBytes(text)
- *                     ctext = text
- *                     self.header.l_text = strlen(ctext)             # <<<<<<<<<<<<<<
- *                     self.header.text = <char*>calloc(
- *                         strlen(ctext), sizeof(char))
- */
-        __pyx_v_self->header->l_text = strlen(__pyx_v_ctext);
-
-        /* "pysam/calignmentfile.pyx":433
- *                     ctext = text
- *                     self.header.l_text = strlen(ctext)
- *                     self.header.text = <char*>calloc(             # <<<<<<<<<<<<<<
- *                         strlen(ctext), sizeof(char))
- *                     memcpy(self.header.text, ctext, strlen(ctext))
- */
-        __pyx_v_self->header->text = ((char *)calloc(strlen(__pyx_v_ctext), (sizeof(char))));
-
-        /* "pysam/calignmentfile.pyx":435
- *                     self.header.text = <char*>calloc(
- *                         strlen(ctext), sizeof(char))
- *                     memcpy(self.header.text, ctext, strlen(ctext))             # <<<<<<<<<<<<<<
- * 
- *             # open file. Header gets written to file at the same time for bam files
- */
-        memcpy(__pyx_v_self->header->text, __pyx_v_ctext, strlen(__pyx_v_ctext));
-        goto __pyx_L27;
-      }
-      __pyx_L27:;
-    }
-    __pyx_L17:;
-
-    /* "pysam/calignmentfile.pyx":439
- *             # open file. Header gets written to file at the same time for bam files
- *             # and sam files (in the latter case, the mode needs to be wh)
- *             self.htsfile = hts_open(filename, bmode)             # <<<<<<<<<<<<<<
- * 
- *             # for compatibility - "w" writes sam file without header
- */
-    __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_23 = __Pyx_PyObject_AsString(__pyx_v_bmode); if (unlikely((!__pyx_t_23) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_self->htsfile = hts_open(__pyx_t_22, __pyx_t_23);
-
-    /* "pysam/calignmentfile.pyx":442
- * 
- *             # for compatibility - "w" writes sam file without header
- *             if self.isbam or "h" in mode:             # <<<<<<<<<<<<<<
- *                 # write header to htsfile
- *                 sam_hdr_write(self.htsfile, self.header)
- */
-    if (!(__pyx_v_self->isbam != 0)) {
-      __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_n_s_h, __pyx_v_mode, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __pyx_t_1;
-    } else {
-      __pyx_t_2 = (__pyx_v_self->isbam != 0);
-    }
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":444
- *             if self.isbam or "h" in mode:
- *                 # write header to htsfile
- *                 sam_hdr_write(self.htsfile, self.header)             # <<<<<<<<<<<<<<
- * 
- *         elif mode[0] == "r":
- */
-      sam_hdr_write(__pyx_v_self->htsfile, __pyx_v_self->header);
-      goto __pyx_L28;
-    }
-    __pyx_L28:;
-    goto __pyx_L16;
-  }
-
-  /* "pysam/calignmentfile.pyx":446
- *                 sam_hdr_write(self.htsfile, self.header)
- * 
- *         elif mode[0] == "r":             # <<<<<<<<<<<<<<
- *             # open file for reading
- *             if (filename != b"-"
- */
-  __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_mode, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":448
- *         elif mode[0] == "r":
- *             # open file for reading
- *             if (filename != b"-"             # <<<<<<<<<<<<<<
- *                 and not self.isremote
- *                 and not os.path.exists(filename)):
- */
-    __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_filename, __pyx_kp_b__4, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":449
- *             # open file for reading
- *             if (filename != b"-"
- *                 and not self.isremote             # <<<<<<<<<<<<<<
- *                 and not os.path.exists(filename)):
- *                 raise IOError("file `%s` not found" % filename)
- */
-      __pyx_t_1 = (!(__pyx_v_self->isremote != 0));
-      if (__pyx_t_1) {
-
-        /* "pysam/calignmentfile.pyx":450
- *             if (filename != b"-"
- *                 and not self.isremote
- *                 and not os.path.exists(filename)):             # <<<<<<<<<<<<<<
- *                 raise IOError("file `%s` not found" % filename)
- * 
- */
-        __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exists); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_v_filename);
-        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_filename);
-        __Pyx_GIVEREF(__pyx_v_filename);
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_24 = (!__pyx_t_11);
-        __pyx_t_11 = __pyx_t_24;
-      } else {
-        __pyx_t_11 = __pyx_t_1;
-      }
-      __pyx_t_1 = __pyx_t_11;
-    } else {
-      __pyx_t_1 = __pyx_t_2;
-    }
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":451
- *                 and not self.isremote
- *                 and not os.path.exists(filename)):
- *                 raise IOError("file `%s` not found" % filename)             # <<<<<<<<<<<<<<
- * 
- *             # try to detect errors
- */
-      __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_file_s_not_found, __pyx_v_filename); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":454
- * 
- *             # try to detect errors
- *             self.htsfile = hts_open(filename, bmode)             # <<<<<<<<<<<<<<
- *             if self.htsfile == NULL:
- *                 raise ValueError(
- */
-    __pyx_t_22 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_22) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_23 = __Pyx_PyObject_AsString(__pyx_v_bmode); if (unlikely((!__pyx_t_23) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_self->htsfile = hts_open(__pyx_t_22, __pyx_t_23);
-
-    /* "pysam/calignmentfile.pyx":455
- *             # try to detect errors
- *             self.htsfile = hts_open(filename, bmode)
- *             if self.htsfile == NULL:             # <<<<<<<<<<<<<<
- *                 raise ValueError(
- *                     "could not open file (mode='%s') - "
- */
-    __pyx_t_1 = ((__pyx_v_self->htsfile == NULL) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":458
- *                 raise ValueError(
- *                     "could not open file (mode='%s') - "
- *                     "is it SAM/BAM format?" % mode)             # <<<<<<<<<<<<<<
- * 
- *             # get file pointer
- */
-      __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_could_not_open_file_mode_s_is_it, __pyx_v_mode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-
-      /* "pysam/calignmentfile.pyx":456
- *             self.htsfile = hts_open(filename, bmode)
- *             if self.htsfile == NULL:
- *                 raise ValueError(             # <<<<<<<<<<<<<<
- *                     "could not open file (mode='%s') - "
- *                     "is it SAM/BAM format?" % mode)
- */
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":463
- *             # TODO: this is specific to BAM files
- *             #       refactor to make generalizable
- *             self.fp = self.htsfile.fp.bgzf             # <<<<<<<<<<<<<<
- * 
- *             # bam files require a valid header
- */
-    __pyx_t_25 = __pyx_v_self->htsfile->fp.bgzf;
-    __pyx_v_self->fp = __pyx_t_25;
-
-    /* "pysam/calignmentfile.pyx":466
- * 
- *             # bam files require a valid header
- *             if self.isbam:             # <<<<<<<<<<<<<<
- *                 self.header = sam_hdr_read(self.htsfile)
- *                 if self.header == NULL:
- */
-    __pyx_t_1 = (__pyx_v_self->isbam != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":467
- *             # bam files require a valid header
- *             if self.isbam:
- *                 self.header = sam_hdr_read(self.htsfile)             # <<<<<<<<<<<<<<
- *                 if self.header == NULL:
- *                     raise ValueError(
- */
-      __pyx_v_self->header = sam_hdr_read(__pyx_v_self->htsfile);
-
-      /* "pysam/calignmentfile.pyx":468
- *             if self.isbam:
- *                 self.header = sam_hdr_read(self.htsfile)
- *                 if self.header == NULL:             # <<<<<<<<<<<<<<
- *                     raise ValueError(
- *                         "file does not have valid header (mode='%s') "
- */
-      __pyx_t_1 = ((__pyx_v_self->header == NULL) != 0);
-      if (__pyx_t_1) {
-
-        /* "pysam/calignmentfile.pyx":471
- *                     raise ValueError(
- *                         "file does not have valid header (mode='%s') "
- *                         "- is it BAM format?" % mode )             # <<<<<<<<<<<<<<
- *             else:
- *                 # in sam files it is optional (htsfile full of unmapped reads)
- */
-        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_file_does_not_have_valid_header, __pyx_v_mode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-
-        /* "pysam/calignmentfile.pyx":469
- *                 self.header = sam_hdr_read(self.htsfile)
- *                 if self.header == NULL:
- *                     raise ValueError(             # <<<<<<<<<<<<<<
- *                         "file does not have valid header (mode='%s') "
- *                         "- is it BAM format?" % mode )
- */
-        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
-        __Pyx_GIVEREF(__pyx_t_8);
-        __pyx_t_8 = 0;
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      goto __pyx_L31;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":474
- *             else:
- *                 # in sam files it is optional (htsfile full of unmapped reads)
- *                 if check_header:             # <<<<<<<<<<<<<<
- *                     self.header = sam_hdr_read(self.htsfile)
- *                     if self.header == NULL:
- */
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_check_header); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (__pyx_t_1) {
-
-        /* "pysam/calignmentfile.pyx":475
- *                 # in sam files it is optional (htsfile full of unmapped reads)
- *                 if check_header:
- *                     self.header = sam_hdr_read(self.htsfile)             # <<<<<<<<<<<<<<
- *                     if self.header == NULL:
- *                         raise ValueError(
- */
-        __pyx_v_self->header = sam_hdr_read(__pyx_v_self->htsfile);
-
-        /* "pysam/calignmentfile.pyx":476
- *                 if check_header:
- *                     self.header = sam_hdr_read(self.htsfile)
- *                     if self.header == NULL:             # <<<<<<<<<<<<<<
- *                         raise ValueError(
- *                             "file does not have valid header (mode='%s') "
- */
-        __pyx_t_1 = ((__pyx_v_self->header == NULL) != 0);
-        if (__pyx_t_1) {
-
-          /* "pysam/calignmentfile.pyx":479
- *                         raise ValueError(
- *                             "file does not have valid header (mode='%s') "
- *                             "- is it SAM format?" % mode )             # <<<<<<<<<<<<<<
- *                     # self.header.ignore_sam_err = True
- * 
- */
-          __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_file_does_not_have_valid_header_2, __pyx_v_mode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-
-          /* "pysam/calignmentfile.pyx":477
- *                     self.header = sam_hdr_read(self.htsfile)
- *                     if self.header == NULL:
- *                         raise ValueError(             # <<<<<<<<<<<<<<
- *                             "file does not have valid header (mode='%s') "
- *                             "- is it SAM format?" % mode )
- */
-          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
-          __Pyx_GIVEREF(__pyx_t_8);
-          __pyx_t_8 = 0;
-          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        goto __pyx_L33;
-      }
-      __pyx_L33:;
-    }
-    __pyx_L31:;
-
-    /* "pysam/calignmentfile.pyx":484
- *             # disabled for autodetection to work needs to be disabled
- *             # so that reading from sam-files without headers works
- *             if check_sq and self.header.n_targets == 0:             # <<<<<<<<<<<<<<
- *                 raise ValueError(
- *                     ("file header is empty (mode='%s') - "
- */
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_check_sq); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_1) {
-      __pyx_t_2 = (__pyx_v_self->header->n_targets == 0);
-      __pyx_t_11 = __pyx_t_2;
-    } else {
-      __pyx_t_11 = __pyx_t_1;
-    }
-    if (__pyx_t_11) {
-
-      /* "pysam/calignmentfile.pyx":487
- *                 raise ValueError(
- *                     ("file header is empty (mode='%s') - "
- *                      "is it SAM/BAM format?") % mode)             # <<<<<<<<<<<<<<
- * 
- *         if self.htsfile == NULL:
- */
-      __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_file_header_is_empty_mode_s_is_i, __pyx_v_mode); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-
-      /* "pysam/calignmentfile.pyx":485
- *             # so that reading from sam-files without headers works
- *             if check_sq and self.header.n_targets == 0:
- *                 raise ValueError(             # <<<<<<<<<<<<<<
- *                     ("file header is empty (mode='%s') - "
- *                      "is it SAM/BAM format?") % mode)
- */
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    goto __pyx_L16;
-  }
-  __pyx_L16:;
-
-  /* "pysam/calignmentfile.pyx":489
- *                      "is it SAM/BAM format?") % mode)
- * 
- *         if self.htsfile == NULL:             # <<<<<<<<<<<<<<
- *             raise IOError("could not open file `%s`" % filename )
- * 
- */
-  __pyx_t_11 = ((__pyx_v_self->htsfile == NULL) != 0);
-  if (__pyx_t_11) {
-
-    /* "pysam/calignmentfile.pyx":490
- * 
- *         if self.htsfile == NULL:
- *             raise IOError("could not open file `%s`" % filename )             # <<<<<<<<<<<<<<
- * 
- *         # check for index and open if present
- */
-    __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_could_not_open_file_s, __pyx_v_filename); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    __pyx_t_8 = 0;
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":493
- * 
- *         # check for index and open if present
- *         if mode[0] == "r" and self.isbam:             # <<<<<<<<<<<<<<
- * 
- *             if not self.isremote:
- */
-  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_mode, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (__pyx_t_11) {
-    __pyx_t_1 = (__pyx_v_self->isbam != 0);
-  } else {
-    __pyx_t_1 = __pyx_t_11;
-  }
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":495
- *         if mode[0] == "r" and self.isbam:
- * 
- *             if not self.isremote:             # <<<<<<<<<<<<<<
- *                 if not os.path.exists(filename + b".bai") \
- *                         and not os.path.exists( filename[:-4] + b".bai"):
- */
-    __pyx_t_1 = ((!(__pyx_v_self->isremote != 0)) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":496
- * 
- *             if not self.isremote:
- *                 if not os.path.exists(filename + b".bai") \             # <<<<<<<<<<<<<<
- *                         and not os.path.exists( filename[:-4] + b".bai"):
- *                     self.index = NULL
- */
-      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exists); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_6 = PyNumber_Add(__pyx_v_filename, __pyx_kp_b_bai); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_11 = ((!__pyx_t_1) != 0);
-      if (__pyx_t_11) {
-
-        /* "pysam/calignmentfile.pyx":497
- *             if not self.isremote:
- *                 if not os.path.exists(filename + b".bai") \
- *                         and not os.path.exists( filename[:-4] + b".bai"):             # <<<<<<<<<<<<<<
- *                     self.index = NULL
- *                 else:
- */
-        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exists); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_filename, 0, -4, NULL, NULL, &__pyx_slice__8, 0, 1, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_kp_b_bai); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
-        __Pyx_GIVEREF(__pyx_t_8);
-        __pyx_t_8 = 0;
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_2 = ((!__pyx_t_1) != 0);
-        __pyx_t_1 = __pyx_t_2;
-      } else {
-        __pyx_t_1 = __pyx_t_11;
-      }
-      if (__pyx_t_1) {
-
-        /* "pysam/calignmentfile.pyx":498
- *                 if not os.path.exists(filename + b".bai") \
- *                         and not os.path.exists( filename[:-4] + b".bai"):
- *                     self.index = NULL             # <<<<<<<<<<<<<<
- *                 else:
- *                     # returns NULL if there is no index or index could not be opened
- */
-        __pyx_v_self->index = NULL;
-        goto __pyx_L39;
-      }
-      /*else*/ {
-
-        /* "pysam/calignmentfile.pyx":501
- *                 else:
- *                     # returns NULL if there is no index or index could not be opened
- *                     self.index = hts_idx_load(filename, HTS_FMT_BAI)             # <<<<<<<<<<<<<<
- *                     if self.index == NULL:
- *                         raise IOError("error while opening index `%s` " % filename )
- */
-        __pyx_t_26 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_v_self->index = hts_idx_load(__pyx_t_26, HTS_FMT_BAI);
-
-        /* "pysam/calignmentfile.pyx":502
- *                     # returns NULL if there is no index or index could not be opened
- *                     self.index = hts_idx_load(filename, HTS_FMT_BAI)
- *                     if self.index == NULL:             # <<<<<<<<<<<<<<
- *                         raise IOError("error while opening index `%s` " % filename )
- *             else:
- */
-        __pyx_t_1 = ((__pyx_v_self->index == NULL) != 0);
-        if (__pyx_t_1) {
-
-          /* "pysam/calignmentfile.pyx":503
- *                     self.index = hts_idx_load(filename, HTS_FMT_BAI)
- *                     if self.index == NULL:
- *                         raise IOError("error while opening index `%s` " % filename )             # <<<<<<<<<<<<<<
- *             else:
- *                 self.index = hts_idx_load(filename, HTS_FMT_BAI)
- */
-          __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_error_while_opening_index_s, __pyx_v_filename); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
-          __Pyx_GIVEREF(__pyx_t_8);
-          __pyx_t_8 = 0;
-          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-      }
-      __pyx_L39:;
-      goto __pyx_L38;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":505
- *                         raise IOError("error while opening index `%s` " % filename )
- *             else:
- *                 self.index = hts_idx_load(filename, HTS_FMT_BAI)             # <<<<<<<<<<<<<<
- *                 if self.index == NULL:
- *                     warnings.warn("unable to open index for `%s` " % filename)
- */
-      __pyx_t_26 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_26) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_self->index = hts_idx_load(__pyx_t_26, HTS_FMT_BAI);
-
-      /* "pysam/calignmentfile.pyx":506
- *             else:
- *                 self.index = hts_idx_load(filename, HTS_FMT_BAI)
- *                 if self.index == NULL:             # <<<<<<<<<<<<<<
- *                     warnings.warn("unable to open index for `%s` " % filename)
- * 
- */
-      __pyx_t_1 = ((__pyx_v_self->index == NULL) != 0);
-      if (__pyx_t_1) {
-
-        /* "pysam/calignmentfile.pyx":507
- *                 self.index = hts_idx_load(filename, HTS_FMT_BAI)
- *                 if self.index == NULL:
- *                     warnings.warn("unable to open index for `%s` " % filename)             # <<<<<<<<<<<<<<
- * 
- *             if not self.isstream:
- */
-        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_warn); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_unable_to_open_index_for_s, __pyx_v_filename); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8);
-        __Pyx_GIVEREF(__pyx_t_8);
-        __pyx_t_8 = 0;
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        goto __pyx_L41;
-      }
-      __pyx_L41:;
-    }
-    __pyx_L38:;
-
-    /* "pysam/calignmentfile.pyx":509
- *                     warnings.warn("unable to open index for `%s` " % filename)
- * 
- *             if not self.isstream:             # <<<<<<<<<<<<<<
- *                 self.start_offset = bgzf_tell(self.fp)
- * 
- */
-    __pyx_t_1 = ((!(__pyx_v_self->isstream != 0)) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":510
- * 
- *             if not self.isstream:
- *                 self.start_offset = bgzf_tell(self.fp)             # <<<<<<<<<<<<<<
- * 
- *     def gettid(self, reference):
- */
-      __pyx_v_self->start_offset = bgzf_tell(__pyx_v_self->fp);
-      goto __pyx_L42;
-    }
-    __pyx_L42:;
-    goto __pyx_L37;
-  }
-  __pyx_L37:;
-
-  /* "pysam/calignmentfile.pyx":315
- *         return self.index != NULL
- * 
- *     def _open(self,             # <<<<<<<<<<<<<<
- *               filename,
- *               mode=None,
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_msg);
-  __Pyx_XDECREF(__pyx_v_bmode);
-  __Pyx_XDECREF(__pyx_v_n);
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XDECREF(__pyx_v_name);
-  __Pyx_XDECREF(__pyx_v_ref);
-  __Pyx_XDECREF(__pyx_v_filename);
-  __Pyx_XDECREF(__pyx_v_mode);
-  __Pyx_XDECREF(__pyx_v_referencenames);
-  __Pyx_XDECREF(__pyx_v_text);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":512
- *                 self.start_offset = bgzf_tell(self.fp)
- * 
- *     def gettid(self, reference):             # <<<<<<<<<<<<<<
- *         '''
- *         convert :term:`reference` name into numerical :term:`tid`
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_9gettid(PyObject *__pyx_v_self, PyObject *__pyx_v_reference); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_8gettid[] = "AlignmentFile.gettid(self, reference)\n\n        convert :term:`reference` name into numerical :term:`tid`\n\n        returns -1 if reference is not known.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_9gettid(PyObject *__pyx_v_self, PyObject *__pyx_v_reference) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("gettid (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8gettid(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), ((PyObject *)__pyx_v_reference));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8gettid(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  char const *__pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("gettid", 0);
-  __Pyx_TraceCall("gettid", __pyx_f[0], 512);
-  __Pyx_INCREF(__pyx_v_reference);
-
-  /* "pysam/calignmentfile.pyx":518
- *         returns -1 if reference is not known.
- *         '''
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file")
- *         reference = _forceBytes(reference)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":519
- *         '''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *         reference = _forceBytes(reference)
- *         return bam_name2id(self.header, reference)
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":520
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")
- *         reference = _forceBytes(reference)             # <<<<<<<<<<<<<<
- *         return bam_name2id(self.header, reference)
- * 
- */
-  __pyx_t_2 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_reference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF_SET(__pyx_v_reference, __pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":521
- *             raise ValueError("I/O operation on closed file")
- *         reference = _forceBytes(reference)
- *         return bam_name2id(self.header, reference)             # <<<<<<<<<<<<<<
- * 
- *     def getrname(self, tid):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_reference); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyInt_From_int(bam_name2id(__pyx_v_self->header, __pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":512
- *                 self.start_offset = bgzf_tell(self.fp)
- * 
- *     def gettid(self, reference):             # <<<<<<<<<<<<<<
- *         '''
- *         convert :term:`reference` name into numerical :term:`tid`
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.gettid", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_reference);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":523
- *         return bam_name2id(self.header, reference)
- * 
- *     def getrname(self, tid):             # <<<<<<<<<<<<<<
- *         '''
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_11getrname(PyObject *__pyx_v_self, PyObject *__pyx_v_tid); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_10getrname[] = "AlignmentFile.getrname(self, tid)\n\n        convert numerical :term:`tid` into :term:`reference` name.";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_11getrname(PyObject *__pyx_v_self, PyObject *__pyx_v_tid) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getrname (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_10getrname(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), ((PyObject *)__pyx_v_tid));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_10getrname(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_tid) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  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("getrname", 0);
-  __Pyx_TraceCall("getrname", __pyx_f[0], 523);
-
-  /* "pysam/calignmentfile.pyx":526
- *         '''
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file")
- *         if not 0 <= tid < self.header.n_targets:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":527
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *         if not 0 <= tid < self.header.n_targets:
- *             raise ValueError("reference_id %i out of range 0<=tid<%i" %
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":528
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")
- *         if not 0 <= tid < self.header.n_targets:             # <<<<<<<<<<<<<<
- *             raise ValueError("reference_id %i out of range 0<=tid<%i" %
- *                              (tid, self.header.n_targets))
- */
-  __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_v_tid, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
-    __Pyx_DECREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->header->n_targets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_tid, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = ((!__pyx_t_4) != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":530
- *         if not 0 <= tid < self.header.n_targets:
- *             raise ValueError("reference_id %i out of range 0<=tid<%i" %
- *                              (tid, self.header.n_targets))             # <<<<<<<<<<<<<<
- *         return _charptr_to_str(self.header.target_name[tid])
- * 
- */
-    __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_self->header->n_targets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_v_tid);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tid);
-    __Pyx_GIVEREF(__pyx_v_tid);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/calignmentfile.pyx":529
- *             raise ValueError("I/O operation on closed file")
- *         if not 0 <= tid < self.header.n_targets:
- *             raise ValueError("reference_id %i out of range 0<=tid<%i" %             # <<<<<<<<<<<<<<
- *                              (tid, self.header.n_targets))
- *         return _charptr_to_str(self.header.target_name[tid])
- */
-    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_reference_id_i_out_of_range_0_ti, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __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 = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":531
- *             raise ValueError("reference_id %i out of range 0<=tid<%i" %
- *                              (tid, self.header.n_targets))
- *         return _charptr_to_str(self.header.target_name[tid])             # <<<<<<<<<<<<<<
- * 
- *     cdef char * _getrname(self, int tid):   # TODO unused
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_tid); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __pyx_f_5pysam_14calignmentfile__charptr_to_str((__pyx_v_self->header->target_name[__pyx_t_5])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":523
- *         return bam_name2id(self.header, reference)
- * 
- *     def getrname(self, tid):             # <<<<<<<<<<<<<<
- *         '''
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.getrname", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":533
- *         return _charptr_to_str(self.header.target_name[tid])
- * 
- *     cdef char * _getrname(self, int tid):   # TODO unused             # <<<<<<<<<<<<<<
- *         '''
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- */
-
-static char *__pyx_f_5pysam_14calignmentfile_13AlignmentFile__getrname(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, int __pyx_v_tid) {
-  char *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __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("_getrname", 0);
-  __Pyx_TraceCall("_getrname", __pyx_f[0], 533);
-
-  /* "pysam/calignmentfile.pyx":536
- *         '''
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file")
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":537
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- * 
- *         if not 0 <= tid < self.header.n_targets:
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":539
- *             raise ValueError("I/O operation on closed file")
- * 
- *         if not 0 <= tid < self.header.n_targets:             # <<<<<<<<<<<<<<
- *             raise ValueError("tid %i out of range 0<=tid<%i" %
- *                              (tid, self.header.n_targets ))
- */
-  __pyx_t_4 = (0 <= __pyx_v_tid);
-  if (__pyx_t_4) {
-    __pyx_t_4 = (__pyx_v_tid < __pyx_v_self->header->n_targets);
-  }
-  __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":541
- *         if not 0 <= tid < self.header.n_targets:
- *             raise ValueError("tid %i out of range 0<=tid<%i" %
- *                              (tid, self.header.n_targets ))             # <<<<<<<<<<<<<<
- *         return self.header.target_name[tid]
- * 
- */
-    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_tid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->header->n_targets); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_2 = 0;
-    __pyx_t_1 = 0;
-
-    /* "pysam/calignmentfile.pyx":540
- * 
- *         if not 0 <= tid < self.header.n_targets:
- *             raise ValueError("tid %i out of range 0<=tid<%i" %             # <<<<<<<<<<<<<<
- *                              (tid, self.header.n_targets ))
- *         return self.header.target_name[tid]
- */
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_tid_i_out_of_range_0_tid_i, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":542
- *             raise ValueError("tid %i out of range 0<=tid<%i" %
- *                              (tid, self.header.n_targets ))
- *         return self.header.target_name[tid]             # <<<<<<<<<<<<<<
- * 
- *     def _parseRegion(self,
- */
-  __pyx_r = (__pyx_v_self->header->target_name[__pyx_v_tid]);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":533
- *         return _charptr_to_str(self.header.target_name[tid])
- * 
- *     cdef char * _getrname(self, int tid):   # TODO unused             # <<<<<<<<<<<<<<
- *         '''
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_WriteUnraisable("pysam.calignmentfile.AlignmentFile._getrname", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":544
- *         return self.header.target_name[tid]
- * 
- *     def _parseRegion(self,             # <<<<<<<<<<<<<<
- *                      reference=None,
- *                      start=None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_13_parseRegion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_12_parseRegion[] = "AlignmentFile._parseRegion(self, reference=None, start=None, end=None, region=None, tid=None)\nparse region information.\n\n        Raises ValueError for invalid regions.\n\n        Returns a tuple of a flag, :term:`tid`, start and end. The\n        flag indicates whether some coordinates were supplied.\n\n        Note that region strings are 1-based, while *start* and *end* denote\n        an interval in p [...]
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_13_parseRegion(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_reference = 0;
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_end = 0;
-  PyObject *__pyx_v_region = 0;
-  PyObject *__pyx_v_tid = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_parseRegion (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,&__pyx_n_s_tid,0};
-    PyObject* values[5] = {0,0,0,0,0};
-
-    /* "pysam/calignmentfile.pyx":545
- * 
- *     def _parseRegion(self,
- *                      reference=None,             # <<<<<<<<<<<<<<
- *                      start=None,
- *                      end=None,
- */
-    values[0] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":546
- *     def _parseRegion(self,
- *                      reference=None,
- *                      start=None,             # <<<<<<<<<<<<<<
- *                      end=None,
- *                      region=None,
- */
-    values[1] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":547
- *                      reference=None,
- *                      start=None,
- *                      end=None,             # <<<<<<<<<<<<<<
- *                      region=None,
- *                      tid=None):
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":548
- *                      start=None,
- *                      end=None,
- *                      region=None,             # <<<<<<<<<<<<<<
- *                      tid=None):
- *         '''parse region information.
- */
-    values[3] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":549
- *                      end=None,
- *                      region=None,
- *                      tid=None):             # <<<<<<<<<<<<<<
- *         '''parse region information.
- * 
- */
-    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:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reference);
-          if (value) { values[0] = value; kw_args--; }
-        }
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tid);
-          if (value) { values[4] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_parseRegion") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __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);
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_reference = values[0];
-    __pyx_v_start = values[1];
-    __pyx_v_end = values[2];
-    __pyx_v_region = values[3];
-    __pyx_v_tid = values[4];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_parseRegion", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._parseRegion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_12_parseRegion(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region, __pyx_v_tid);
-
-  /* "pysam/calignmentfile.pyx":544
- *         return self.header.target_name[tid]
- * 
- *     def _parseRegion(self,             # <<<<<<<<<<<<<<
- *                      reference=None,
- *                      start=None,
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_12_parseRegion(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_tid) {
-  int __pyx_v_rtid;
-  PY_LONG_LONG __pyx_v_rstart;
-  PY_LONG_LONG __pyx_v_rend;
-  PyObject *__pyx_v_parts = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PY_LONG_LONG __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  Py_ssize_t __pyx_t_12;
-  int __pyx_t_13;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_parseRegion", 0);
-  __Pyx_TraceCall("_parseRegion", __pyx_f[0], 544);
-  __Pyx_INCREF(__pyx_v_reference);
-  __Pyx_INCREF(__pyx_v_region);
-
-  /* "pysam/calignmentfile.pyx":565
- *         cdef long long rend
- * 
- *         rtid = -1             # <<<<<<<<<<<<<<
- *         rstart = 0
- *         rend = max_pos
- */
-  __pyx_v_rtid = -1;
-
-  /* "pysam/calignmentfile.pyx":566
- * 
- *         rtid = -1
- *         rstart = 0             # <<<<<<<<<<<<<<
- *         rend = max_pos
- *         if start != None:
- */
-  __pyx_v_rstart = 0;
-
-  /* "pysam/calignmentfile.pyx":567
- *         rtid = -1
- *         rstart = 0
- *         rend = max_pos             # <<<<<<<<<<<<<<
- *         if start != None:
- *             try:
- */
-  __pyx_v_rend = __pyx_v_5pysam_14calignmentfile_max_pos;
-
-  /* "pysam/calignmentfile.pyx":568
- *         rstart = 0
- *         rend = max_pos
- *         if start != None:             # <<<<<<<<<<<<<<
- *             try:
- *                 rstart = start
- */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":569
- *         rend = max_pos
- *         if start != None:
- *             try:             # <<<<<<<<<<<<<<
- *                 rstart = start
- *             except OverflowError:
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
-      __Pyx_XGOTREF(__pyx_t_3);
-      __Pyx_XGOTREF(__pyx_t_4);
-      __Pyx_XGOTREF(__pyx_t_5);
-      /*try:*/ {
-
-        /* "pysam/calignmentfile.pyx":570
- *         if start != None:
- *             try:
- *                 rstart = start             # <<<<<<<<<<<<<<
- *             except OverflowError:
- *                 raise ValueError('start out of range (%i)' % start)
- */
-        __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_start); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __pyx_v_rstart = __pyx_t_6;
-      }
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L11_try_end;
-      __pyx_L4_error:;
-      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":571
- *             try:
- *                 rstart = start
- *             except OverflowError:             # <<<<<<<<<<<<<<
- *                 raise ValueError('start out of range (%i)' % start)
- * 
- */
-      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
-      if (__pyx_t_7) {
-        __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._parseRegion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_GOTREF(__pyx_t_9);
-
-        /* "pysam/calignmentfile.pyx":572
- *                 rstart = start
- *             except OverflowError:
- *                 raise ValueError('start out of range (%i)' % start)             # <<<<<<<<<<<<<<
- * 
- *         if end != None:
- */
-        __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_start_out_of_range_i, __pyx_v_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
-        __Pyx_GIVEREF(__pyx_t_10);
-        __pyx_t_10 = 0;
-        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_Raise(__pyx_t_10, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        goto __pyx_L5_exception_handled;
-      }
-      goto __pyx_L6_except_error;
-      __pyx_L6_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-      goto __pyx_L1_error;
-      __pyx_L5_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-      __pyx_L11_try_end:;
-    }
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":574
- *                 raise ValueError('start out of range (%i)' % start)
- * 
- *         if end != None:             # <<<<<<<<<<<<<<
- *             try:
- *                 rend = end
- */
-  __pyx_t_9 = PyObject_RichCompare(__pyx_v_end, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":575
- * 
- *         if end != None:
- *             try:             # <<<<<<<<<<<<<<
- *                 rend = end
- *             except OverflowError:
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
-      __Pyx_XGOTREF(__pyx_t_5);
-      __Pyx_XGOTREF(__pyx_t_4);
-      __Pyx_XGOTREF(__pyx_t_3);
-      /*try:*/ {
-
-        /* "pysam/calignmentfile.pyx":576
- *         if end != None:
- *             try:
- *                 rend = end             # <<<<<<<<<<<<<<
- *             except OverflowError:
- *                 raise ValueError('end out of range (%i)' % end)
- */
-        __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_end); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
-        __pyx_v_rend = __pyx_t_6;
-      }
-      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      goto __pyx_L22_try_end;
-      __pyx_L15_error:;
-      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-      /* "pysam/calignmentfile.pyx":577
- *             try:
- *                 rend = end
- *             except OverflowError:             # <<<<<<<<<<<<<<
- *                 raise ValueError('end out of range (%i)' % end)
- * 
- */
-      __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
-      if (__pyx_t_7) {
-        __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._parseRegion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_GOTREF(__pyx_t_1);
-
-        /* "pysam/calignmentfile.pyx":578
- *                 rend = end
- *             except OverflowError:
- *                 raise ValueError('end out of range (%i)' % end)             # <<<<<<<<<<<<<<
- * 
- *         if region:
- */
-        __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_end_out_of_range_i, __pyx_v_end); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
-        __Pyx_GIVEREF(__pyx_t_10);
-        __pyx_t_10 = 0;
-        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_Raise(__pyx_t_10, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L16_exception_handled;
-      }
-      goto __pyx_L17_except_error;
-      __pyx_L17_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
-      goto __pyx_L1_error;
-      __pyx_L16_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
-      __pyx_L22_try_end:;
-    }
-    goto __pyx_L14;
-  }
-  __pyx_L14:;
-
-  /* "pysam/calignmentfile.pyx":580
- *                 raise ValueError('end out of range (%i)' % end)
- * 
- *         if region:             # <<<<<<<<<<<<<<
- *             region = _forceStr(region)
- *             parts = re.split("[:-]", region)
- */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":581
- * 
- *         if region:
- *             region = _forceStr(region)             # <<<<<<<<<<<<<<
- *             parts = re.split("[:-]", region)
- *             reference = parts[0]
- */
-    __pyx_t_1 = __pyx_f_5pysam_14calignmentfile__forceStr(__pyx_v_region); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_region, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/calignmentfile.pyx":582
- *         if region:
- *             region = _forceStr(region)
- *             parts = re.split("[:-]", region)             # <<<<<<<<<<<<<<
- *             reference = parts[0]
- *             if len(parts) >= 2:
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_kp_s__12);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s__12);
-    __Pyx_GIVEREF(__pyx_kp_s__12);
-    __Pyx_INCREF(__pyx_v_region);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_region);
-    __Pyx_GIVEREF(__pyx_v_region);
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_parts = __pyx_t_9;
-    __pyx_t_9 = 0;
-
-    /* "pysam/calignmentfile.pyx":583
- *             region = _forceStr(region)
- *             parts = re.split("[:-]", region)
- *             reference = parts[0]             # <<<<<<<<<<<<<<
- *             if len(parts) >= 2:
- *                 rstart = int(parts[1]) - 1
- */
-    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_parts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF_SET(__pyx_v_reference, __pyx_t_9);
-    __pyx_t_9 = 0;
-
-    /* "pysam/calignmentfile.pyx":584
- *             parts = re.split("[:-]", region)
- *             reference = parts[0]
- *             if len(parts) >= 2:             # <<<<<<<<<<<<<<
- *                 rstart = int(parts[1]) - 1
- *             if len(parts) >= 3:
- */
-    __pyx_t_12 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_2 = ((__pyx_t_12 >= 2) != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":585
- *             reference = parts[0]
- *             if len(parts) >= 2:
- *                 rstart = int(parts[1]) - 1             # <<<<<<<<<<<<<<
- *             if len(parts) >= 3:
- *                 rend = int(parts[2])
- */
-      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_parts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_1 = PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_9 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_9); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_v_rstart = __pyx_t_6;
-      goto __pyx_L26;
-    }
-    __pyx_L26:;
-
-    /* "pysam/calignmentfile.pyx":586
- *             if len(parts) >= 2:
- *                 rstart = int(parts[1]) - 1
- *             if len(parts) >= 3:             # <<<<<<<<<<<<<<
- *                 rend = int(parts[2])
- * 
- */
-    __pyx_t_12 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_2 = ((__pyx_t_12 >= 3) != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":587
- *                 rstart = int(parts[1]) - 1
- *             if len(parts) >= 3:
- *                 rend = int(parts[2])             # <<<<<<<<<<<<<<
- * 
- *         if not reference:
- */
-      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_parts, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_1 = PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_1); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_v_rend = __pyx_t_6;
-      goto __pyx_L27;
-    }
-    __pyx_L27:;
-    goto __pyx_L25;
-  }
-  __pyx_L25:;
-
-  /* "pysam/calignmentfile.pyx":589
- *                 rend = int(parts[2])
- * 
- *         if not reference:             # <<<<<<<<<<<<<<
- *             return 0, 0, 0, 0
- * 
- */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_13 = ((!__pyx_t_2) != 0);
-  if (__pyx_t_13) {
-
-    /* "pysam/calignmentfile.pyx":590
- * 
- *         if not reference:
- *             return 0, 0, 0, 0             # <<<<<<<<<<<<<<
- * 
- *         if tid is not None:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_tuple__13);
-    __pyx_r = __pyx_tuple__13;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":592
- *             return 0, 0, 0, 0
- * 
- *         if tid is not None:             # <<<<<<<<<<<<<<
- *             rtid = tid
- *         else:
- */
-  __pyx_t_13 = (__pyx_v_tid != Py_None);
-  __pyx_t_2 = (__pyx_t_13 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":593
- * 
- *         if tid is not None:
- *             rtid = tid             # <<<<<<<<<<<<<<
- *         else:
- *             rtid = self.gettid(reference)
- */
-    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_tid); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_rtid = __pyx_t_7;
-    goto __pyx_L29;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":595
- *             rtid = tid
- *         else:
- *             rtid = self.gettid(reference)             # <<<<<<<<<<<<<<
- * 
- *         if rtid < 0:
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_gettid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_INCREF(__pyx_v_reference);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_reference);
-    __Pyx_GIVEREF(__pyx_v_reference);
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_v_rtid = __pyx_t_7;
-  }
-  __pyx_L29:;
-
-  /* "pysam/calignmentfile.pyx":597
- *             rtid = self.gettid(reference)
- * 
- *         if rtid < 0:             # <<<<<<<<<<<<<<
- *             raise ValueError(
- *                 "invalid reference `%s`" % reference)
- */
-  __pyx_t_2 = ((__pyx_v_rtid < 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":599
- *         if rtid < 0:
- *             raise ValueError(
- *                 "invalid reference `%s`" % reference)             # <<<<<<<<<<<<<<
- *         if rstart > rend:
- *             raise ValueError(
- */
-    __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_invalid_reference_s, __pyx_v_reference); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-
-    /* "pysam/calignmentfile.pyx":598
- * 
- *         if rtid < 0:
- *             raise ValueError(             # <<<<<<<<<<<<<<
- *                 "invalid reference `%s`" % reference)
- *         if rstart > rend:
- */
-    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    __pyx_t_8 = 0;
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":600
- *             raise ValueError(
- *                 "invalid reference `%s`" % reference)
- *         if rstart > rend:             # <<<<<<<<<<<<<<
- *             raise ValueError(
- *                 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend))
- */
-  __pyx_t_2 = ((__pyx_v_rstart > __pyx_v_rend) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":602
- *         if rstart > rend:
- *             raise ValueError(
- *                 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend))             # <<<<<<<<<<<<<<
- *         if not 0 <= rstart < max_pos:
- *             raise ValueError('start out of range (%i)' % rstart)
- */
-    __pyx_t_8 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rstart); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_9 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rend); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __pyx_t_8 = 0;
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_invalid_coordinates_start_i_end, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/calignmentfile.pyx":601
- *                 "invalid reference `%s`" % reference)
- *         if rstart > rend:
- *             raise ValueError(             # <<<<<<<<<<<<<<
- *                 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend))
- *         if not 0 <= rstart < max_pos:
- */
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":603
- *             raise ValueError(
- *                 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend))
- *         if not 0 <= rstart < max_pos:             # <<<<<<<<<<<<<<
- *             raise ValueError('start out of range (%i)' % rstart)
- *         if not 0 <= rend <= max_pos:
- */
-  __pyx_t_2 = (0 <= __pyx_v_rstart);
-  if (__pyx_t_2) {
-    __pyx_t_2 = (__pyx_v_rstart < __pyx_v_5pysam_14calignmentfile_max_pos);
-  }
-  __pyx_t_13 = ((!(__pyx_t_2 != 0)) != 0);
-  if (__pyx_t_13) {
-
-    /* "pysam/calignmentfile.pyx":604
- *                 'invalid coordinates: start (%i) > end (%i)' % (rstart, rend))
- *         if not 0 <= rstart < max_pos:
- *             raise ValueError('start out of range (%i)' % rstart)             # <<<<<<<<<<<<<<
- *         if not 0 <= rend <= max_pos:
- *             raise ValueError('end out of range (%i)' % rend)
- */
-    __pyx_t_9 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rstart); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_start_out_of_range_i, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":605
- *         if not 0 <= rstart < max_pos:
- *             raise ValueError('start out of range (%i)' % rstart)
- *         if not 0 <= rend <= max_pos:             # <<<<<<<<<<<<<<
- *             raise ValueError('end out of range (%i)' % rend)
- * 
- */
-  __pyx_t_13 = (0 <= __pyx_v_rend);
-  if (__pyx_t_13) {
-    __pyx_t_13 = (__pyx_v_rend <= __pyx_v_5pysam_14calignmentfile_max_pos);
-  }
-  __pyx_t_2 = ((!(__pyx_t_13 != 0)) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":606
- *             raise ValueError('start out of range (%i)' % rstart)
- *         if not 0 <= rend <= max_pos:
- *             raise ValueError('end out of range (%i)' % rend)             # <<<<<<<<<<<<<<
- * 
- *         return 1, rtid, rstart, rend
- */
-    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_end_out_of_range_i, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __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 = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":608
- *             raise ValueError('end out of range (%i)' % rend)
- * 
- *         return 1, rtid, rstart, rend             # <<<<<<<<<<<<<<
- * 
- *     def reset(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_rtid); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rstart); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_rend); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_9);
-  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  __pyx_t_9 = 0;
-  __pyx_t_1 = 0;
-  __pyx_t_8 = 0;
-  __pyx_r = __pyx_t_10;
-  __pyx_t_10 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":544
- *         return self.header.target_name[tid]
- * 
- *     def _parseRegion(self,             # <<<<<<<<<<<<<<
- *                      reference=None,
- *                      start=None,
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._parseRegion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_parts);
-  __Pyx_XDECREF(__pyx_v_reference);
-  __Pyx_XDECREF(__pyx_v_region);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":610
- *         return 1, rtid, rstart, rend
- * 
- *     def reset(self):             # <<<<<<<<<<<<<<
- *         '''reset file position to beginning of file just after
- *         the header.'''
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_14reset[] = "AlignmentFile.reset(self)\nreset file position to beginning of file just after\n        the header.";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_15reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_14reset(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_14reset(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  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("reset", 0);
-  __Pyx_TraceCall("reset", __pyx_f[0], 610);
-
-  /* "pysam/calignmentfile.pyx":613
- *         '''reset file position to beginning of file just after
- *         the header.'''
- *         return self.seek(self.start_offset, 0)             # <<<<<<<<<<<<<<
- * 
- *     def seek(self, uint64_t offset, int where = 0):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_self->start_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":610
- *         return 1, rtid, rstart, rend
- * 
- *     def reset(self):             # <<<<<<<<<<<<<<
- *         '''reset file position to beginning of file just after
- *         the header.'''
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":615
- *         return self.seek(self.start_offset, 0)
- * 
- *     def seek(self, uint64_t offset, int where = 0):             # <<<<<<<<<<<<<<
- *         '''
- *         move file pointer to position *offset*, see :meth:`pysam.AlignmentFile.tell`.
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_17seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_16seek[] = "AlignmentFile.seek(self, uint64_t offset, int where=0)\n\n        move file pointer to position *offset*, see :meth:`pysam.AlignmentFile.tell`.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_17seek(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  uint64_t __pyx_v_offset;
-  int __pyx_v_where;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("seek (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_offset,&__pyx_n_s_where,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_where);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "seek") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __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_offset = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_offset == (uint64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    if (values[1]) {
-      __pyx_v_where = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_where == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_where = ((int)0);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("seek", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_16seek(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_offset, __pyx_v_where);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_16seek(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, uint64_t __pyx_v_offset, int __pyx_v_where) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("seek", 0);
-  __Pyx_TraceCall("seek", __pyx_f[0], 615);
-
-  /* "pysam/calignmentfile.pyx":620
- *         '''
- * 
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError( "I/O operation on closed file" )
- *         if not self.isbam:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":621
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":622
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )
- *         if not self.isbam:             # <<<<<<<<<<<<<<
- *             raise NotImplementedError("seek only available in bam files")
- *         if self.isstream:
- */
-  __pyx_t_4 = ((!(__pyx_v_self->isbam != 0)) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":623
- *             raise ValueError( "I/O operation on closed file" )
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")             # <<<<<<<<<<<<<<
- *         if self.isstream:
- *             raise OSError("seek no available in streams")
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":624
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")
- *         if self.isstream:             # <<<<<<<<<<<<<<
- *             raise OSError("seek no available in streams")
- * 
- */
-  __pyx_t_4 = (__pyx_v_self->isstream != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":625
- *             raise NotImplementedError("seek only available in bam files")
- *         if self.isstream:
- *             raise OSError("seek no available in streams")             # <<<<<<<<<<<<<<
- * 
- *         return bgzf_seek(self.fp, offset, where)
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":627
- *             raise OSError("seek no available in streams")
- * 
- *         return bgzf_seek(self.fp, offset, where)             # <<<<<<<<<<<<<<
- * 
- *     def tell(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyInt_From_int64_t(bgzf_seek(__pyx_v_self->fp, __pyx_v_offset, __pyx_v_where)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":615
- *         return self.seek(self.start_offset, 0)
- * 
- *     def seek(self, uint64_t offset, int where = 0):             # <<<<<<<<<<<<<<
- *         '''
- *         move file pointer to position *offset*, see :meth:`pysam.AlignmentFile.tell`.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":629
- *         return bgzf_seek(self.fp, offset, where)
- * 
- *     def tell(self):             # <<<<<<<<<<<<<<
- *         '''
- *         return current file position.
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_19tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_18tell[] = "AlignmentFile.tell(self)\n\n        return current file position.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_19tell(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("tell (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_18tell(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_18tell(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("tell", 0);
-  __Pyx_TraceCall("tell", __pyx_f[0], 629);
-
-  /* "pysam/calignmentfile.pyx":633
- *         return current file position.
- *         '''
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file")
- *         if not self.isbam:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":634
- *         '''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":635
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")
- *         if not self.isbam:             # <<<<<<<<<<<<<<
- *             raise NotImplementedError("seek only available in bam files")
- * 
- */
-  __pyx_t_4 = ((!(__pyx_v_self->isbam != 0)) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":636
- *             raise ValueError("I/O operation on closed file")
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")             # <<<<<<<<<<<<<<
- * 
- *         return bgzf_tell(self.fp)
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":638
- *             raise NotImplementedError("seek only available in bam files")
- * 
- *         return bgzf_tell(self.fp)             # <<<<<<<<<<<<<<
- * 
- *     def fetch(self,
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyInt_From_int64_t(bgzf_tell(__pyx_v_self->fp)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":629
- *         return bgzf_seek(self.fp, offset, where)
- * 
- *     def tell(self):             # <<<<<<<<<<<<<<
- *         '''
- *         return current file position.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.tell", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":640
- *         return bgzf_tell(self.fp)
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_21fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_20fetch[] = "AlignmentFile.fetch(self, reference=None, start=None, end=None, region=None, tid=None, callback=None, until_eof=False, multiple_iterators=False)\nfetch aligned reads in a :term:`region` using 0-based indexing. The\n        region is specified by :term:`reference`, *start* and\n        *end*. Alternatively, a samtools :term:`region` string can be\n        supplied.\n\n        Without *reference* or *region* all map [...]
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_21fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_reference = 0;
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_end = 0;
-  PyObject *__pyx_v_region = 0;
-  PyObject *__pyx_v_tid = 0;
-  PyObject *__pyx_v_callback = 0;
-  PyObject *__pyx_v_until_eof = 0;
-  PyObject *__pyx_v_multiple_iterators = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("fetch (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,&__pyx_n_s_tid,&__pyx_n_s_callback,&__pyx_n_s_until_eof,&__pyx_n_s_multiple_iterators,0};
-    PyObject* values[8] = {0,0,0,0,0,0,0,0};
-
-    /* "pysam/calignmentfile.pyx":641
- * 
- *     def fetch(self,
- *               reference=None,             # <<<<<<<<<<<<<<
- *               start=None,
- *               end=None,
- */
-    values[0] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":642
- *     def fetch(self,
- *               reference=None,
- *               start=None,             # <<<<<<<<<<<<<<
- *               end=None,
- *               region=None,
- */
-    values[1] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":643
- *               reference=None,
- *               start=None,
- *               end=None,             # <<<<<<<<<<<<<<
- *               region=None,
- *               tid=None,
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":644
- *               start=None,
- *               end=None,
- *               region=None,             # <<<<<<<<<<<<<<
- *               tid=None,
- *               callback=None,
- */
-    values[3] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":645
- *               end=None,
- *               region=None,
- *               tid=None,             # <<<<<<<<<<<<<<
- *               callback=None,
- *               until_eof=False,
- */
-    values[4] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":646
- *               region=None,
- *               tid=None,
- *               callback=None,             # <<<<<<<<<<<<<<
- *               until_eof=False,
- *               multiple_iterators=False):
- */
-    values[5] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":647
- *               tid=None,
- *               callback=None,
- *               until_eof=False,             # <<<<<<<<<<<<<<
- *               multiple_iterators=False):
- *         '''fetch aligned reads in a :term:`region` using 0-based indexing. The
- */
-    values[6] = ((PyObject *)Py_False);
-
-    /* "pysam/calignmentfile.pyx":648
- *               callback=None,
- *               until_eof=False,
- *               multiple_iterators=False):             # <<<<<<<<<<<<<<
- *         '''fetch aligned reads in a :term:`region` using 0-based indexing. The
- *         region is specified by :term:`reference`, *start* and
- */
-    values[7] = ((PyObject *)Py_False);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
-        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reference);
-          if (value) { values[0] = value; kw_args--; }
-        }
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tid);
-          if (value) { values[4] = value; kw_args--; }
-        }
-        case  5:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback);
-          if (value) { values[5] = value; kw_args--; }
-        }
-        case  6:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_until_eof);
-          if (value) { values[6] = value; kw_args--; }
-        }
-        case  7:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[7] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
-        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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;
-      }
-    }
-    __pyx_v_reference = values[0];
-    __pyx_v_start = values[1];
-    __pyx_v_end = values[2];
-    __pyx_v_region = values[3];
-    __pyx_v_tid = values[4];
-    __pyx_v_callback = values[5];
-    __pyx_v_until_eof = values[6];
-    __pyx_v_multiple_iterators = values[7];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("fetch", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_20fetch(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region, __pyx_v_tid, __pyx_v_callback, __pyx_v_until_eof, __pyx_v_multiple_iterators);
-
-  /* "pysam/calignmentfile.pyx":640
- *         return bgzf_tell(self.fp)
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_20fetch(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_tid, PyObject *__pyx_v_callback, PyObject *__pyx_v_until_eof, PyObject *__pyx_v_multiple_iterators) {
-  int __pyx_v_rtid;
-  int __pyx_v_rstart;
-  int __pyx_v_rend;
-  int __pyx_v_has_coord;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *(*__pyx_t_9)(PyObject *);
-  int __pyx_t_10;
-  int __pyx_t_11;
-  int __pyx_t_12;
-  int __pyx_t_13;
-  int __pyx_t_14;
-  int __pyx_t_15;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("fetch", 0);
-  __Pyx_TraceCall("fetch", __pyx_f[0], 640);
-  __Pyx_INCREF(__pyx_v_multiple_iterators);
-
-  /* "pysam/calignmentfile.pyx":678
- *         cdef int rtid, rstart, rend, has_coord
- * 
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError( "I/O operation on closed file" )
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":679
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(reference,
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":681
- *             raise ValueError( "I/O operation on closed file" )
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(reference,             # <<<<<<<<<<<<<<
- *                                                           start,
- *                                                           end,
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parseRegion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-
-  /* "pysam/calignmentfile.pyx":685
- *                                                           end,
- *                                                           region,
- *                                                           tid)             # <<<<<<<<<<<<<<
- * 
- *         # Turn of re-opening if htsfile is a stream
- */
-  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_reference);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reference);
-  __Pyx_GIVEREF(__pyx_v_reference);
-  __Pyx_INCREF(__pyx_v_start);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start);
-  __Pyx_GIVEREF(__pyx_v_start);
-  __Pyx_INCREF(__pyx_v_end);
-  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
-  __Pyx_GIVEREF(__pyx_v_end);
-  __Pyx_INCREF(__pyx_v_region);
-  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_region);
-  __Pyx_GIVEREF(__pyx_v_region);
-  __Pyx_INCREF(__pyx_v_tid);
-  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_tid);
-  __Pyx_GIVEREF(__pyx_v_tid);
-
-  /* "pysam/calignmentfile.pyx":681
- *             raise ValueError( "I/O operation on closed file" )
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(reference,             # <<<<<<<<<<<<<<
- *                                                           start,
- *                                                           end,
- */
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
-    PyObject* sequence = __pyx_t_5;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 4)) {
-      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
-      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
-      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
-    } else {
-      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
-      __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
-      __pyx_t_7 = PyList_GET_ITEM(sequence, 3); 
-    }
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_t_6);
-    __Pyx_INCREF(__pyx_t_7);
-    #else
-    {
-      Py_ssize_t i;
-      PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_6,&__pyx_t_7};
-      for (i=0; i < 4; i++) {
-        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(item);
-        *(temps[i]) = item;
-      }
-    }
-    #endif
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_6,&__pyx_t_7};
-    __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-    for (index=0; index < 4; index++) {
-      PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
-      __Pyx_GOTREF(item);
-      *(temps[index]) = item;
-    }
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_9 = NULL;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    goto __pyx_L5_unpacking_done;
-    __pyx_L4_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_9 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L5_unpacking_done:;
-  }
-  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_v_has_coord = __pyx_t_10;
-  __pyx_v_rtid = __pyx_t_11;
-  __pyx_v_rstart = __pyx_t_12;
-  __pyx_v_rend = __pyx_t_13;
-
-  /* "pysam/calignmentfile.pyx":688
- * 
- *         # Turn of re-opening if htsfile is a stream
- *         if self.isstream:             # <<<<<<<<<<<<<<
- *             multiple_iterators = False
- * 
- */
-  __pyx_t_4 = (__pyx_v_self->isstream != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":689
- *         # Turn of re-opening if htsfile is a stream
- *         if self.isstream:
- *             multiple_iterators = False             # <<<<<<<<<<<<<<
- * 
- *         if self.isbam:
- */
-    __Pyx_INCREF(Py_False);
-    __Pyx_DECREF_SET(__pyx_v_multiple_iterators, Py_False);
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
-
-  /* "pysam/calignmentfile.pyx":691
- *             multiple_iterators = False
- * 
- *         if self.isbam:             # <<<<<<<<<<<<<<
- *             if not until_eof and not self._hasIndex() and not self.isremote:
- *                 raise ValueError("fetch called on bamfile without index")
- */
-  __pyx_t_4 = (__pyx_v_self->isbam != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":692
- * 
- *         if self.isbam:
- *             if not until_eof and not self._hasIndex() and not self.isremote:             # <<<<<<<<<<<<<<
- *                 raise ValueError("fetch called on bamfile without index")
- * 
- */
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_until_eof); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = ((!__pyx_t_4) != 0);
-    if (__pyx_t_3) {
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hasIndex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_14 = ((!__pyx_t_4) != 0);
-      if (__pyx_t_14) {
-        __pyx_t_4 = ((!(__pyx_v_self->isremote != 0)) != 0);
-        __pyx_t_15 = __pyx_t_4;
-      } else {
-        __pyx_t_15 = __pyx_t_14;
-      }
-      __pyx_t_14 = __pyx_t_15;
-    } else {
-      __pyx_t_14 = __pyx_t_3;
-    }
-    if (__pyx_t_14) {
-
-      /* "pysam/calignmentfile.pyx":693
- *         if self.isbam:
- *             if not until_eof and not self._hasIndex() and not self.isremote:
- *                 raise ValueError("fetch called on bamfile without index")             # <<<<<<<<<<<<<<
- * 
- *             if has_coord:
- */
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":695
- *                 raise ValueError("fetch called on bamfile without index")
- * 
- *             if has_coord:             # <<<<<<<<<<<<<<
- *                 return IteratorRowRegion(
- *                     self, rtid, rstart, rend,
- */
-    __pyx_t_14 = (__pyx_v_has_coord != 0);
-    if (__pyx_t_14) {
-
-      /* "pysam/calignmentfile.pyx":696
- * 
- *             if has_coord:
- *                 return IteratorRowRegion(             # <<<<<<<<<<<<<<
- *                     self, rtid, rstart, rend,
- *                     multiple_iterators=multiple_iterators)
- */
-      __Pyx_XDECREF(__pyx_r);
-
-      /* "pysam/calignmentfile.pyx":697
- *             if has_coord:
- *                 return IteratorRowRegion(
- *                     self, rtid, rstart, rend,             # <<<<<<<<<<<<<<
- *                     multiple_iterators=multiple_iterators)
- *             else:
- */
-      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_rtid); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rstart); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-
-      /* "pysam/calignmentfile.pyx":696
- * 
- *             if has_coord:
- *                 return IteratorRowRegion(             # <<<<<<<<<<<<<<
- *                     self, rtid, rstart, rend,
- *                     multiple_iterators=multiple_iterators)
- */
-      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(((PyObject *)__pyx_v_self));
-      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
-      __Pyx_GIVEREF(__pyx_t_5);
-      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_7 = 0;
-      __pyx_t_5 = 0;
-      __pyx_t_6 = 0;
-      __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-
-      /* "pysam/calignmentfile.pyx":698
- *                 return IteratorRowRegion(
- *                     self, rtid, rstart, rend,
- *                     multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- *             else:
- *                 if until_eof:
- */
-      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_multiple_iterators, __pyx_v_multiple_iterators) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-      /* "pysam/calignmentfile.pyx":696
- * 
- *             if has_coord:
- *                 return IteratorRowRegion(             # <<<<<<<<<<<<<<
- *                     self, rtid, rstart, rend,
- *                     multiple_iterators=multiple_iterators)
- */
-      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion)), __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_r = __pyx_t_5;
-      __pyx_t_5 = 0;
-      goto __pyx_L0;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":700
- *                     multiple_iterators=multiple_iterators)
- *             else:
- *                 if until_eof:             # <<<<<<<<<<<<<<
- *                     return IteratorRowAll(self,
- *                                           multiple_iterators=multiple_iterators)
- */
-      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_until_eof); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (__pyx_t_14) {
-
-        /* "pysam/calignmentfile.pyx":701
- *             else:
- *                 if until_eof:
- *                     return IteratorRowAll(self,             # <<<<<<<<<<<<<<
- *                                           multiple_iterators=multiple_iterators)
- *                 else:
- */
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_INCREF(((PyObject *)__pyx_v_self));
-        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
-        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-
-        /* "pysam/calignmentfile.pyx":702
- *                 if until_eof:
- *                     return IteratorRowAll(self,
- *                                           multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- *                 else:
- *                     # AH: check - reason why no multiple_iterators for AllRefs?
- */
-        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_multiple_iterators, __pyx_v_multiple_iterators) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-        /* "pysam/calignmentfile.pyx":701
- *             else:
- *                 if until_eof:
- *                     return IteratorRowAll(self,             # <<<<<<<<<<<<<<
- *                                           multiple_iterators=multiple_iterators)
- *                 else:
- */
-        __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll)), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_r = __pyx_t_2;
-        __pyx_t_2 = 0;
-        goto __pyx_L0;
-      }
-      /*else*/ {
-
-        /* "pysam/calignmentfile.pyx":705
- *                 else:
- *                     # AH: check - reason why no multiple_iterators for AllRefs?
- *                     return IteratorRowAllRefs(self,             # <<<<<<<<<<<<<<
- *                                               multiple_iterators=multiple_iterators)
- *         else:
- */
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(((PyObject *)__pyx_v_self));
-        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-
-        /* "pysam/calignmentfile.pyx":706
- *                     # AH: check - reason why no multiple_iterators for AllRefs?
- *                     return IteratorRowAllRefs(self,
- *                                               multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- *         else:
- *             if has_coord:
- */
-        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_multiple_iterators, __pyx_v_multiple_iterators) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-        /* "pysam/calignmentfile.pyx":705
- *                 else:
- *                     # AH: check - reason why no multiple_iterators for AllRefs?
- *                     return IteratorRowAllRefs(self,             # <<<<<<<<<<<<<<
- *                                               multiple_iterators=multiple_iterators)
- *         else:
- */
-        __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs)), __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_r = __pyx_t_5;
-        __pyx_t_5 = 0;
-        goto __pyx_L0;
-      }
-    }
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":708
- *                                               multiple_iterators=multiple_iterators)
- *         else:
- *             if has_coord:             # <<<<<<<<<<<<<<
- *                 raise ValueError(
- *                     "fetching by region is not available for sam files")
- */
-    __pyx_t_14 = (__pyx_v_has_coord != 0);
-    if (__pyx_t_14) {
-
-      /* "pysam/calignmentfile.pyx":709
- *         else:
- *             if has_coord:
- *                 raise ValueError(             # <<<<<<<<<<<<<<
- *                     "fetching by region is not available for sam files")
- * 
- */
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":712
- *                     "fetching by region is not available for sam files")
- * 
- *             if callback:             # <<<<<<<<<<<<<<
- *                 raise NotImplementedError("callback not implemented yet")
- * 
- */
-    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_callback); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_14) {
-
-      /* "pysam/calignmentfile.pyx":713
- * 
- *             if callback:
- *                 raise NotImplementedError("callback not implemented yet")             # <<<<<<<<<<<<<<
- * 
- *             if self.header == NULL:
- */
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":715
- *                 raise NotImplementedError("callback not implemented yet")
- * 
- *             if self.header == NULL:             # <<<<<<<<<<<<<<
- *                 raise ValueError("fetch called for htsfile without header")
- * 
- */
-    __pyx_t_14 = ((__pyx_v_self->header == NULL) != 0);
-    if (__pyx_t_14) {
-
-      /* "pysam/calignmentfile.pyx":716
- * 
- *             if self.header == NULL:
- *                 raise ValueError("fetch called for htsfile without header")             # <<<<<<<<<<<<<<
- * 
- *             # check if targets are defined
- */
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":720
- *             # check if targets are defined
- *             # give warning, sam_read1 segfaults
- *             if self.header.n_targets == 0:             # <<<<<<<<<<<<<<
- *                 warnings.warn("fetch called for htsfile without header")
- * 
- */
-    __pyx_t_14 = ((__pyx_v_self->header->n_targets == 0) != 0);
-    if (__pyx_t_14) {
-
-      /* "pysam/calignmentfile.pyx":721
- *             # give warning, sam_read1 segfaults
- *             if self.header.n_targets == 0:
- *                 warnings.warn("fetch called for htsfile without header")             # <<<<<<<<<<<<<<
- * 
- *             return IteratorRowAll(self,
- */
-      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L14;
-    }
-    __pyx_L14:;
-
-    /* "pysam/calignmentfile.pyx":723
- *                 warnings.warn("fetch called for htsfile without header")
- * 
- *             return IteratorRowAll(self,             # <<<<<<<<<<<<<<
- *                                   multiple_iterators=multiple_iterators)
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_INCREF(((PyObject *)__pyx_v_self));
-    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-
-    /* "pysam/calignmentfile.pyx":724
- * 
- *             return IteratorRowAll(self,
- *                                   multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- * 
- *     def head(self, n, multiple_iterators=True):
- */
-    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_multiple_iterators, __pyx_v_multiple_iterators) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":723
- *                 warnings.warn("fetch called for htsfile without header")
- * 
- *             return IteratorRowAll(self,             # <<<<<<<<<<<<<<
- *                                   multiple_iterators=multiple_iterators)
- * 
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll)), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":640
- *         return bgzf_tell(self.fp)
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __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_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_multiple_iterators);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":726
- *                                   multiple_iterators=multiple_iterators)
- * 
- *     def head(self, n, multiple_iterators=True):             # <<<<<<<<<<<<<<
- *         '''return iterator over the first n alignments.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_23head(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_22head[] = "AlignmentFile.head(self, n, multiple_iterators=True)\nreturn iterator over the first n alignments. \n\n        This is useful for inspecting the bam-file.\n\n        *multiple_iterators* is set to True by default in order to\n        avoid changing the current file position.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_23head(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_n = 0;
-  PyObject *__pyx_v_multiple_iterators = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("head (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_multiple_iterators,0};
-    PyObject* values[2] = {0,0};
-    values[1] = ((PyObject *)Py_True);
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "head") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __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_n = values[0];
-    __pyx_v_multiple_iterators = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("head", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.head", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_22head(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_n, __pyx_v_multiple_iterators);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_22head(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_multiple_iterators) {
-  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("head", 0);
-  __Pyx_TraceCall("head", __pyx_f[0], 726);
-
-  /* "pysam/calignmentfile.pyx":734
- *         avoid changing the current file position.
- *         '''
- *         return IteratorRowHead(self, n,             # <<<<<<<<<<<<<<
- *                                multiple_iterators=multiple_iterators)
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __Pyx_INCREF(__pyx_v_n);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_n);
-  __Pyx_GIVEREF(__pyx_v_n);
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-
-  /* "pysam/calignmentfile.pyx":735
- *         '''
- *         return IteratorRowHead(self, n,
- *                                multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- * 
- *     def mate(self,
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_multiple_iterators, __pyx_v_multiple_iterators) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":734
- *         avoid changing the current file position.
- *         '''
- *         return IteratorRowHead(self, n,             # <<<<<<<<<<<<<<
- *                                multiple_iterators=multiple_iterators)
- * 
- */
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowHead)), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":726
- *                                   multiple_iterators=multiple_iterators)
- * 
- *     def head(self, n, multiple_iterators=True):             # <<<<<<<<<<<<<<
- *         '''return iterator over the first n alignments.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.head", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":737
- *                                multiple_iterators=multiple_iterators)
- * 
- *     def mate(self,             # <<<<<<<<<<<<<<
- *              AlignedSegment read):
- *         '''return the mate of :class:`AlignedSegment` *read*.
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_25mate(PyObject *__pyx_v_self, PyObject *__pyx_v_read); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_24mate[] = "AlignmentFile.mate(self, AlignedSegment read)\nreturn the mate of :class:`AlignedSegment` *read*.\n\n        Throws a ValueError if read is unpaired or the mate\n        is unmapped.\n\n        .. note::\n\n            Calling this method will change the file position.\n            This might interfere with any iterators that have\n            not re-opened the file.\n\n        .. note::\n  \n           This method [...]
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_25mate(PyObject *__pyx_v_self, PyObject *__pyx_v_read) {
-  CYTHON_UNUSED int __pyx_lineno = 0;
-  CYTHON_UNUSED const char *__pyx_filename = NULL;
-  CYTHON_UNUSED int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("mate (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read), __pyx_ptype_5pysam_14calignmentfile_AlignedSegment, 1, "read", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_24mate(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_read));
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_24mate(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_read) {
-  uint32_t __pyx_v_flag;
-  int __pyx_v_x;
-  PyObject *__pyx_v_mate = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  Py_ssize_t __pyx_t_7;
-  PyObject *(*__pyx_t_8)(PyObject *);
-  int __pyx_t_9;
-  int __pyx_t_10;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("mate", 0);
-  __Pyx_TraceCall("mate", __pyx_f[0], 737);
-
-  /* "pysam/calignmentfile.pyx":757
- * 
- *         '''
- *         cdef uint32_t flag = read._delegate.core.flag             # <<<<<<<<<<<<<<
- * 
- *         if flag & BAM_FPAIRED == 0:
- */
-  __pyx_t_1 = __pyx_v_read->_delegate->core.flag;
-  __pyx_v_flag = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":759
- *         cdef uint32_t flag = read._delegate.core.flag
- * 
- *         if flag & BAM_FPAIRED == 0:             # <<<<<<<<<<<<<<
- *             raise ValueError("read %s: is unpaired" %
- *                              (read.query_name))
- */
-  __pyx_t_2 = (((__pyx_v_flag & BAM_FPAIRED) == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":761
- *         if flag & BAM_FPAIRED == 0:
- *             raise ValueError("read %s: is unpaired" %
- *                              (read.query_name))             # <<<<<<<<<<<<<<
- *         if flag & BAM_FMUNMAP != 0:
- *             raise ValueError("mate %s: is unmapped" %
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_read), __pyx_n_s_query_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-
-    /* "pysam/calignmentfile.pyx":760
- * 
- *         if flag & BAM_FPAIRED == 0:
- *             raise ValueError("read %s: is unpaired" %             # <<<<<<<<<<<<<<
- *                              (read.query_name))
- *         if flag & BAM_FMUNMAP != 0:
- */
-    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_read_s_is_unpaired, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":762
- *             raise ValueError("read %s: is unpaired" %
- *                              (read.query_name))
- *         if flag & BAM_FMUNMAP != 0:             # <<<<<<<<<<<<<<
- *             raise ValueError("mate %s: is unmapped" %
- *                              (read.query_name))
- */
-  __pyx_t_2 = (((__pyx_v_flag & BAM_FMUNMAP) != 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":764
- *         if flag & BAM_FMUNMAP != 0:
- *             raise ValueError("mate %s: is unmapped" %
- *                              (read.query_name))             # <<<<<<<<<<<<<<
- * 
- *         # xor flags to get the other mate
- */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_read), __pyx_n_s_query_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-
-    /* "pysam/calignmentfile.pyx":763
- *                              (read.query_name))
- *         if flag & BAM_FMUNMAP != 0:
- *             raise ValueError("mate %s: is unmapped" %             # <<<<<<<<<<<<<<
- *                              (read.query_name))
- * 
- */
-    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_mate_s_is_unmapped, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __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 = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":767
- * 
- *         # xor flags to get the other mate
- *         cdef int x = BAM_FREAD1 + BAM_FREAD2             # <<<<<<<<<<<<<<
- *         flag = (flag ^ x) & x
- * 
- */
-  __pyx_v_x = (BAM_FREAD1 + BAM_FREAD2);
-
-  /* "pysam/calignmentfile.pyx":768
- *         # xor flags to get the other mate
- *         cdef int x = BAM_FREAD1 + BAM_FREAD2
- *         flag = (flag ^ x) & x             # <<<<<<<<<<<<<<
- * 
- *         # Make sure to use a separate file to jump around
- */
-  __pyx_v_flag = ((__pyx_v_flag ^ __pyx_v_x) & __pyx_v_x);
-
-  /* "pysam/calignmentfile.pyx":776
- *         # could thus be made much quicker, for example
- *         # by using tell and seek.
- *         for mate in self.fetch(             # <<<<<<<<<<<<<<
- *                 read._delegate.core.mpos,
- *                 read._delegate.core.mpos + 1,
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-
-  /* "pysam/calignmentfile.pyx":777
- *         # by using tell and seek.
- *         for mate in self.fetch(
- *                 read._delegate.core.mpos,             # <<<<<<<<<<<<<<
- *                 read._delegate.core.mpos + 1,
- *                 tid=read._delegate.core.mtid,
- */
-  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_read->_delegate->core.mpos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-
-  /* "pysam/calignmentfile.pyx":778
- *         for mate in self.fetch(
- *                 read._delegate.core.mpos,
- *                 read._delegate.core.mpos + 1,             # <<<<<<<<<<<<<<
- *                 tid=read._delegate.core.mtid,
- *                 multiple_iterators=True):
- */
-  __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_read->_delegate->core.mpos + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-
-  /* "pysam/calignmentfile.pyx":776
- *         # could thus be made much quicker, for example
- *         # by using tell and seek.
- *         for mate in self.fetch(             # <<<<<<<<<<<<<<
- *                 read._delegate.core.mpos,
- *                 read._delegate.core.mpos + 1,
- */
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  __pyx_t_4 = 0;
-  __pyx_t_5 = 0;
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-
-  /* "pysam/calignmentfile.pyx":779
- *                 read._delegate.core.mpos,
- *                 read._delegate.core.mpos + 1,
- *                 tid=read._delegate.core.mtid,             # <<<<<<<<<<<<<<
- *                 multiple_iterators=True):
- *             if mate.flag & flag != 0 and \
- */
-  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_read->_delegate->core.mtid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_tid, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":780
- *                 read._delegate.core.mpos + 1,
- *                 tid=read._delegate.core.mtid,
- *                 multiple_iterators=True):             # <<<<<<<<<<<<<<
- *             if mate.flag & flag != 0 and \
- *                mate.query_name == read.query_name:
- */
-  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_multiple_iterators, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":776
- *         # could thus be made much quicker, for example
- *         # by using tell and seek.
- *         for mate in self.fetch(             # <<<<<<<<<<<<<<
- *                 read._delegate.core.mpos,
- *                 read._delegate.core.mpos + 1,
- */
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
-    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
-    __pyx_t_8 = NULL;
-  } else {
-    __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  for (;;) {
-    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_5)) {
-      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_5)) {
-      if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_4 = __pyx_t_8(__pyx_t_5);
-      if (unlikely(!__pyx_t_4)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_4);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_mate, __pyx_t_4);
-    __pyx_t_4 = 0;
-
-    /* "pysam/calignmentfile.pyx":781
- *                 tid=read._delegate.core.mtid,
- *                 multiple_iterators=True):
- *             if mate.flag & flag != 0 and \             # <<<<<<<<<<<<<<
- *                mate.query_name == read.query_name:
- *                 break
- */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_mate, __pyx_n_s_flag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_3 = PyNumber_And(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":782
- *                 multiple_iterators=True):
- *             if mate.flag & flag != 0 and \
- *                mate.query_name == read.query_name:             # <<<<<<<<<<<<<<
- *                 break
- *         else:
- */
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mate, __pyx_n_s_query_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_read), __pyx_n_s_query_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __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_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_10 = __pyx_t_9;
-    } else {
-      __pyx_t_10 = __pyx_t_2;
-    }
-    if (__pyx_t_10) {
-
-      /* "pysam/calignmentfile.pyx":783
- *             if mate.flag & flag != 0 and \
- *                mate.query_name == read.query_name:
- *                 break             # <<<<<<<<<<<<<<
- *         else:
- *             raise ValueError("mate not found")
- */
-      goto __pyx_L6_break;
-    }
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":785
- *                 break
- *         else:
- *             raise ValueError("mate not found")             # <<<<<<<<<<<<<<
- * 
- *         return mate
- */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_L6_break:;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/calignmentfile.pyx":787
- *             raise ValueError("mate not found")
- * 
- *         return mate             # <<<<<<<<<<<<<<
- * 
- *     def count(self,
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_mate);
-  __pyx_r = __pyx_v_mate;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":737
- *                                multiple_iterators=multiple_iterators)
- * 
- *     def mate(self,             # <<<<<<<<<<<<<<
- *              AlignedSegment read):
- *         '''return the mate of :class:`AlignedSegment` *read*.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.mate", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_mate);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":789
- *         return mate
- * 
- *     def count(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_27count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_26count[] = "AlignmentFile.count(self, reference=None, start=None, end=None, region=None, until_eof=False)\n*(reference = None, start = None, end = None,\n        region = None, callback = None, until_eof = False)*\n\n        count reads :term:`region` using 0-based indexing. The region\n        is specified by :term:`reference`, *start* and\n        *end*. Alternatively, a samtools :term:`region` string can be\n        suppli [...]
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_27count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_reference = 0;
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_end = 0;
-  PyObject *__pyx_v_region = 0;
-  PyObject *__pyx_v_until_eof = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("count (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,&__pyx_n_s_until_eof,0};
-    PyObject* values[5] = {0,0,0,0,0};
-
-    /* "pysam/calignmentfile.pyx":790
- * 
- *     def count(self,
- *               reference=None,             # <<<<<<<<<<<<<<
- *               start=None,
- *               end=None,
- */
-    values[0] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":791
- *     def count(self,
- *               reference=None,
- *               start=None,             # <<<<<<<<<<<<<<
- *               end=None,
- *               region=None,
- */
-    values[1] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":792
- *               reference=None,
- *               start=None,
- *               end=None,             # <<<<<<<<<<<<<<
- *               region=None,
- *               until_eof=False):
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":793
- *               start=None,
- *               end=None,
- *               region=None,             # <<<<<<<<<<<<<<
- *               until_eof=False):
- *         '''*(reference = None, start = None, end = None,
- */
-    values[3] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":794
- *               end=None,
- *               region=None,
- *               until_eof=False):             # <<<<<<<<<<<<<<
- *         '''*(reference = None, start = None, end = None,
- *         region = None, callback = None, until_eof = False)*
- */
-    values[4] = ((PyObject *)Py_False);
-    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:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reference);
-          if (value) { values[0] = value; kw_args--; }
-        }
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_until_eof);
-          if (value) { values[4] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "count") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __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);
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_reference = values[0];
-    __pyx_v_start = values[1];
-    __pyx_v_end = values[2];
-    __pyx_v_region = values[3];
-    __pyx_v_until_eof = values[4];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("count", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_26count(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region, __pyx_v_until_eof);
-
-  /* "pysam/calignmentfile.pyx":789
- *         return mate
- * 
- *     def count(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_26count(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_until_eof) {
-  CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_read = 0;
-  long __pyx_v_counter;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  Py_ssize_t __pyx_t_6;
-  PyObject *(*__pyx_t_7)(PyObject *);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("count", 0);
-  __Pyx_TraceCall("count", __pyx_f[0], 789);
-
-  /* "pysam/calignmentfile.pyx":807
- *         '''
- *         cdef AlignedSegment read
- *         cdef long counter = 0             # <<<<<<<<<<<<<<
- * 
- *         if not self._isOpen():
- */
-  __pyx_v_counter = 0;
-
-  /* "pysam/calignmentfile.pyx":809
- *         cdef long counter = 0
- * 
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError( "I/O operation on closed file" )
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":810
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         for read in self.fetch(reference=reference,
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":812
- *             raise ValueError( "I/O operation on closed file" )
- * 
- *         for read in self.fetch(reference=reference,             # <<<<<<<<<<<<<<
- *                                start=start,
- *                                end=end,
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reference, __pyx_v_reference) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":813
- * 
- *         for read in self.fetch(reference=reference,
- *                                start=start,             # <<<<<<<<<<<<<<
- *                                end=end,
- *                                region=region,
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_start, __pyx_v_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":814
- *         for read in self.fetch(reference=reference,
- *                                start=start,
- *                                end=end,             # <<<<<<<<<<<<<<
- *                                region=region,
- *                                until_eof=until_eof):
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_end, __pyx_v_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":815
- *                                start=start,
- *                                end=end,
- *                                region=region,             # <<<<<<<<<<<<<<
- *                                until_eof=until_eof):
- *             counter += 1
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region, __pyx_v_region) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":816
- *                                end=end,
- *                                region=region,
- *                                until_eof=until_eof):             # <<<<<<<<<<<<<<
- *             counter += 1
- * 
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_until_eof, __pyx_v_until_eof) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":812
- *             raise ValueError( "I/O operation on closed file" )
- * 
- *         for read in self.fetch(reference=reference,             # <<<<<<<<<<<<<<
- *                                start=start,
- *                                end=end,
- */
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
-    __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
-    __pyx_t_7 = NULL;
-  } else {
-    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  for (;;) {
-    if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_5 = __pyx_t_7(__pyx_t_1);
-      if (unlikely(!__pyx_t_5)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_5);
-    }
-    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5pysam_14calignmentfile_AlignedSegment))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XDECREF_SET(__pyx_v_read, ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_t_5));
-    __pyx_t_5 = 0;
-
-    /* "pysam/calignmentfile.pyx":817
- *                                region=region,
- *                                until_eof=until_eof):
- *             counter += 1             # <<<<<<<<<<<<<<
- * 
- *         return counter
- */
-    __pyx_v_counter = (__pyx_v_counter + 1);
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":819
- *             counter += 1
- * 
- *         return counter             # <<<<<<<<<<<<<<
- * 
- *     def pileup( self,
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_counter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":789
- *         return mate
- * 
- *     def count(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_read);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":821
- *         return counter
- * 
- *     def pileup( self,             # <<<<<<<<<<<<<<
- *                 reference = None,
- *                 start = None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_29pileup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_28pileup[] = "AlignmentFile.pileup(self, reference=None, start=None, end=None, region=None, **kwargs)\nperform a :term:`pileup` within a :term:`region`. The region is\n        specified by :term:`reference`, *start* and *end* (using\n        0-based indexing).  Alternatively, a samtools *region* string\n        can be supplied.\n\n        Without *reference* or *region* all reads will be used for the\n        pileup. The reads [...]
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_29pileup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_reference = 0;
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_end = 0;
-  PyObject *__pyx_v_region = 0;
-  PyObject *__pyx_v_kwargs = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("pileup (wrapper)", 0);
-  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
-  __Pyx_GOTREF(__pyx_v_kwargs);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,0};
-    PyObject* values[4] = {0,0,0,0};
-
-    /* "pysam/calignmentfile.pyx":822
- * 
- *     def pileup( self,
- *                 reference = None,             # <<<<<<<<<<<<<<
- *                 start = None,
- *                 end = None,
- */
-    values[0] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":823
- *     def pileup( self,
- *                 reference = None,
- *                 start = None,             # <<<<<<<<<<<<<<
- *                 end = None,
- *                 region = None,
- */
-    values[1] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":824
- *                 reference = None,
- *                 start = None,
- *                 end = None,             # <<<<<<<<<<<<<<
- *                 region = None,
- *                 **kwargs ):
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":825
- *                 start = None,
- *                 end = None,
- *                 region = None,             # <<<<<<<<<<<<<<
- *                 **kwargs ):
- *         '''perform a :term:`pileup` within a :term:`region`. The region is
- */
-    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:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reference);
-          if (value) { values[0] = value; kw_args--; }
-        }
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region);
-          if (value) { values[3] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "pileup") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __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);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_reference = values[0];
-    __pyx_v_start = values[1];
-    __pyx_v_end = values[2];
-    __pyx_v_region = values[3];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("pileup", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.pileup", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_28pileup(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region, __pyx_v_kwargs);
-
-  /* "pysam/calignmentfile.pyx":821
- *         return counter
- * 
- *     def pileup( self,             # <<<<<<<<<<<<<<
- *                 reference = None,
- *                 start = None,
- */
-
-  /* function exit code */
-  __Pyx_XDECREF(__pyx_v_kwargs);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_28pileup(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_kwargs) {
-  int __pyx_v_rtid;
-  int __pyx_v_rstart;
-  int __pyx_v_rend;
-  int __pyx_v_has_coord;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *(*__pyx_t_9)(PyObject *);
-  int __pyx_t_10;
-  int __pyx_t_11;
-  int __pyx_t_12;
-  int __pyx_t_13;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("pileup", 0);
-  __Pyx_TraceCall("pileup", __pyx_f[0], 821);
-
-  /* "pysam/calignmentfile.pyx":891
- *         cdef int rtid, rstart, rend, has_coord
- * 
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError( "I/O operation on closed file" )
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":892
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":894
- *             raise ValueError( "I/O operation on closed file" )
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(             # <<<<<<<<<<<<<<
- *             reference, start, end, region )
- * 
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parseRegion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-
-  /* "pysam/calignmentfile.pyx":895
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(
- *             reference, start, end, region )             # <<<<<<<<<<<<<<
- * 
- *         if self.isbam:
- */
-  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_reference);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reference);
-  __Pyx_GIVEREF(__pyx_v_reference);
-  __Pyx_INCREF(__pyx_v_start);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start);
-  __Pyx_GIVEREF(__pyx_v_start);
-  __Pyx_INCREF(__pyx_v_end);
-  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
-  __Pyx_GIVEREF(__pyx_v_end);
-  __Pyx_INCREF(__pyx_v_region);
-  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_region);
-  __Pyx_GIVEREF(__pyx_v_region);
-
-  /* "pysam/calignmentfile.pyx":894
- *             raise ValueError( "I/O operation on closed file" )
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(             # <<<<<<<<<<<<<<
- *             reference, start, end, region )
- * 
- */
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
-    PyObject* sequence = __pyx_t_5;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 4)) {
-      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
-      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
-      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3); 
-    } else {
-      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
-      __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
-      __pyx_t_7 = PyList_GET_ITEM(sequence, 3); 
-    }
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_t_6);
-    __Pyx_INCREF(__pyx_t_7);
-    #else
-    {
-      Py_ssize_t i;
-      PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_6,&__pyx_t_7};
-      for (i=0; i < 4; i++) {
-        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(item);
-        *(temps[i]) = item;
-      }
-    }
-    #endif
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_6,&__pyx_t_7};
-    __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-    for (index=0; index < 4; index++) {
-      PyObject* item = __pyx_t_9(__pyx_t_8); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
-      __Pyx_GOTREF(item);
-      *(temps[index]) = item;
-    }
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_9 = NULL;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    goto __pyx_L5_unpacking_done;
-    __pyx_L4_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_9 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L5_unpacking_done:;
-  }
-  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_v_has_coord = __pyx_t_10;
-  __pyx_v_rtid = __pyx_t_11;
-  __pyx_v_rstart = __pyx_t_12;
-  __pyx_v_rend = __pyx_t_13;
-
-  /* "pysam/calignmentfile.pyx":897
- *             reference, start, end, region )
- * 
- *         if self.isbam:             # <<<<<<<<<<<<<<
- *             if not self._hasIndex():
- *                 raise ValueError("no index available for pileup")
- */
-  __pyx_t_4 = (__pyx_v_self->isbam != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":898
- * 
- *         if self.isbam:
- *             if not self._hasIndex():             # <<<<<<<<<<<<<<
- *                 raise ValueError("no index available for pileup")
- * 
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hasIndex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_3 = ((!__pyx_t_4) != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":899
- *         if self.isbam:
- *             if not self._hasIndex():
- *                 raise ValueError("no index available for pileup")             # <<<<<<<<<<<<<<
- * 
- *             if has_coord:
- */
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":901
- *                 raise ValueError("no index available for pileup")
- * 
- *             if has_coord:             # <<<<<<<<<<<<<<
- *                 return IteratorColumnRegion(self,
- *                                             tid = rtid,
- */
-    __pyx_t_3 = (__pyx_v_has_coord != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":902
- * 
- *             if has_coord:
- *                 return IteratorColumnRegion(self,             # <<<<<<<<<<<<<<
- *                                             tid = rtid,
- *                                             start = rstart,
- */
-      __Pyx_XDECREF(__pyx_r);
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_INCREF(((PyObject *)__pyx_v_self));
-      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_self));
-      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-
-      /* "pysam/calignmentfile.pyx":906
- *                                             start = rstart,
- *                                             end = rend,
- *                                             **kwargs )             # <<<<<<<<<<<<<<
- *             else:
- *                 return IteratorColumnAllRefs(self, **kwargs )
- */
-      __pyx_t_5 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-
-      /* "pysam/calignmentfile.pyx":903
- *             if has_coord:
- *                 return IteratorColumnRegion(self,
- *                                             tid = rtid,             # <<<<<<<<<<<<<<
- *                                             start = rstart,
- *                                             end = rend,
- */
-      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rtid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      if (unlikely(PyDict_GetItem(__pyx_t_5, __pyx_n_s_tid))) {
-        __Pyx_RaiseDoubleKeywordsError("function", __pyx_n_s_tid); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_tid, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-      /* "pysam/calignmentfile.pyx":904
- *                 return IteratorColumnRegion(self,
- *                                             tid = rtid,
- *                                             start = rstart,             # <<<<<<<<<<<<<<
- *                                             end = rend,
- *                                             **kwargs )
- */
-      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rstart); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      if (unlikely(PyDict_GetItem(__pyx_t_5, __pyx_n_s_start))) {
-        __Pyx_RaiseDoubleKeywordsError("function", __pyx_n_s_start); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_start, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-      /* "pysam/calignmentfile.pyx":905
- *                                             tid = rtid,
- *                                             start = rstart,
- *                                             end = rend,             # <<<<<<<<<<<<<<
- *                                             **kwargs )
- *             else:
- */
-      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_rend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      if (unlikely(PyDict_GetItem(__pyx_t_5, __pyx_n_s_end))) {
-        __Pyx_RaiseDoubleKeywordsError("function", __pyx_n_s_end); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_end, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-      /* "pysam/calignmentfile.pyx":902
- * 
- *             if has_coord:
- *                 return IteratorColumnRegion(self,             # <<<<<<<<<<<<<<
- *                                             tid = rtid,
- *                                             start = rstart,
- */
-      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion)), __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_r = __pyx_t_6;
-      __pyx_t_6 = 0;
-      goto __pyx_L0;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":908
- *                                             **kwargs )
- *             else:
- *                 return IteratorColumnAllRefs(self, **kwargs )             # <<<<<<<<<<<<<<
- * 
- *         else:
- */
-      __Pyx_XDECREF(__pyx_r);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_INCREF(((PyObject *)__pyx_v_self));
-      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_self));
-      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-      __pyx_t_5 = __pyx_v_kwargs;
-      __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs)), __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_r = __pyx_t_7;
-      __pyx_t_7 = 0;
-      goto __pyx_L0;
-    }
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":911
- * 
- *         else:
- *             raise NotImplementedError( "pileup of samfiles not implemented yet" )             # <<<<<<<<<<<<<<
- * 
- *     def close( self ):
- */
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":821
- *         return counter
- * 
- *     def pileup( self,             # <<<<<<<<<<<<<<
- *                 reference = None,
- *                 start = None,
- */
-
-  /* function exit code */
-  __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_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.pileup", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":913
- *             raise NotImplementedError( "pileup of samfiles not implemented yet" )
- * 
- *     def close( self ):             # <<<<<<<<<<<<<<
- *         '''
- *         closes the :class:`pysam.AlignmentFile`.'''
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_31close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_30close[] = "AlignmentFile.close(self)\n\n        closes the :class:`pysam.AlignmentFile`.";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_31close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("close (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_30close(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_30close(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("close", 0);
-  __Pyx_TraceCall("close", __pyx_f[0], 913);
-
-  /* "pysam/calignmentfile.pyx":916
- *         '''
- *         closes the :class:`pysam.AlignmentFile`.'''
- *         if self.htsfile != NULL:             # <<<<<<<<<<<<<<
- *             hts_close(self.htsfile)
- *             hts_idx_destroy(self.index);
- */
-  __pyx_t_1 = ((__pyx_v_self->htsfile != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":917
- *         closes the :class:`pysam.AlignmentFile`.'''
- *         if self.htsfile != NULL:
- *             hts_close(self.htsfile)             # <<<<<<<<<<<<<<
- *             hts_idx_destroy(self.index);
- *             self.htsfile = NULL
- */
-    hts_close(__pyx_v_self->htsfile);
-
-    /* "pysam/calignmentfile.pyx":918
- *         if self.htsfile != NULL:
- *             hts_close(self.htsfile)
- *             hts_idx_destroy(self.index);             # <<<<<<<<<<<<<<
- *             self.htsfile = NULL
- * 
- */
-    hts_idx_destroy(__pyx_v_self->index);
-
-    /* "pysam/calignmentfile.pyx":919
- *             hts_close(self.htsfile)
- *             hts_idx_destroy(self.index);
- *             self.htsfile = NULL             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__( self ):
- */
-    __pyx_v_self->htsfile = NULL;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":913
- *             raise NotImplementedError( "pileup of samfiles not implemented yet" )
- * 
- *     def close( self ):             # <<<<<<<<<<<<<<
- *         '''
- *         closes the :class:`pysam.AlignmentFile`.'''
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":921
- *             self.htsfile = NULL
- * 
- *     def __dealloc__( self ):             # <<<<<<<<<<<<<<
- *         # remember: dealloc cannot call other methods
- *         # note: no doc string
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_33__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_33__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_32__dealloc__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_32__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 921);
-
-  /* "pysam/calignmentfile.pyx":925
- *         # note: no doc string
- *         # note: __del__ is not called.
- *         self.close()             # <<<<<<<<<<<<<<
- *         bam_destroy1(self.b)
- *         if self.header != NULL:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":926
- *         # note: __del__ is not called.
- *         self.close()
- *         bam_destroy1(self.b)             # <<<<<<<<<<<<<<
- *         if self.header != NULL:
- *             bam_hdr_destroy(self.header)
- */
-  bam_destroy1(__pyx_v_self->b);
-
-  /* "pysam/calignmentfile.pyx":927
- *         self.close()
- *         bam_destroy1(self.b)
- *         if self.header != NULL:             # <<<<<<<<<<<<<<
- *             bam_hdr_destroy(self.header)
- * 
- */
-  __pyx_t_3 = ((__pyx_v_self->header != NULL) != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":928
- *         bam_destroy1(self.b)
- *         if self.header != NULL:
- *             bam_hdr_destroy(self.header)             # <<<<<<<<<<<<<<
- * 
- *     cpdef int write(self, AlignedSegment read) except -1:
- */
-    bam_hdr_destroy(__pyx_v_self->header);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":921
- *             self.htsfile = NULL
- * 
- *     def __dealloc__( self ):             # <<<<<<<<<<<<<<
- *         # remember: dealloc cannot call other methods
- *         # note: no doc string
- */
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_WriteUnraisable("pysam.calignmentfile.AlignmentFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/calignmentfile.pyx":930
- *             bam_hdr_destroy(self.header)
- * 
- *     cpdef int write(self, AlignedSegment read) except -1:             # <<<<<<<<<<<<<<
- *         '''
- *         write a single :class:`pysam.AlignedSegment` to disk.
- */
-
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_35write(PyObject *__pyx_v_self, PyObject *__pyx_v_read); /*proto*/
-static int __pyx_f_5pysam_14calignmentfile_13AlignmentFile_write(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_read, int __pyx_skip_dispatch) {
-  int __pyx_v_x;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("write", 0);
-  __Pyx_TraceCall("write", __pyx_f[0], 930);
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_35write)) {
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(((PyObject *)__pyx_v_read));
-      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_read));
-      __Pyx_GIVEREF(((PyObject *)__pyx_v_read));
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_r = __pyx_t_4;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L0;
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-
-  /* "pysam/calignmentfile.pyx":936
- *         returns the number of bytes written.
- *         '''
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             return 0
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_6 = ((!__pyx_t_5) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/calignmentfile.pyx":937
- *         '''
- *         if not self._isOpen():
- *             return 0             # <<<<<<<<<<<<<<
- * 
- *         x = sam_write1(self.htsfile,
- */
-    __pyx_r = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":939
- *             return 0
- * 
- *         x = sam_write1(self.htsfile,             # <<<<<<<<<<<<<<
- *                        self.header,
- *                        read._delegate)
- */
-  __pyx_v_x = sam_write1(__pyx_v_self->htsfile, __pyx_v_self->header, __pyx_v_read->_delegate);
-
-  /* "pysam/calignmentfile.pyx":943
- *                        read._delegate)
- * 
- *         return x             # <<<<<<<<<<<<<<
- * 
- *     def __enter__(self):
- */
-  __pyx_r = __pyx_v_x;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":930
- *             bam_hdr_destroy(self.header)
- * 
- *     cpdef int write(self, AlignedSegment read) except -1:             # <<<<<<<<<<<<<<
- *         '''
- *         write a single :class:`pysam.AlignedSegment` to disk.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_WriteUnraisable("pysam.calignmentfile.AlignmentFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_35write(PyObject *__pyx_v_self, PyObject *__pyx_v_read); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_34write[] = "AlignmentFile.write(self, AlignedSegment read) -> int\n\n        write a single :class:`pysam.AlignedSegment` to disk.\n\n        returns the number of bytes written.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_35write(PyObject *__pyx_v_self, PyObject *__pyx_v_read) {
-  CYTHON_UNUSED int __pyx_lineno = 0;
-  CYTHON_UNUSED const char *__pyx_filename = NULL;
-  CYTHON_UNUSED int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("write (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read), __pyx_ptype_5pysam_14calignmentfile_AlignedSegment, 1, "read", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_34write(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_read));
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_34write(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_read) {
-  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("write", 0);
-  __Pyx_TraceCall("write", __pyx_f[0], 930);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(((struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, __pyx_v_read, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":945
- *         return x
- * 
- *     def __enter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_37__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_36__enter__[] = "AlignmentFile.__enter__(self)";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_37__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_36__enter__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_36__enter__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__enter__", 0);
-  __Pyx_TraceCall("__enter__", __pyx_f[0], 945);
-
-  /* "pysam/calignmentfile.pyx":946
- * 
- *     def __enter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     def __exit__(self, exc_type, exc_value, traceback):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":945
- *         return x
- * 
- *     def __enter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":948
- *         return self
- * 
- *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
- *         self.close()
- *         return False
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_39__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_38__exit__[] = "AlignmentFile.__exit__(self, exc_type, exc_value, traceback)";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_39__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
-  CYTHON_UNUSED PyObject *__pyx_v_exc_value = 0;
-  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_value,&__pyx_n_s_traceback,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_value)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __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_exc_type = values[0];
-    __pyx_v_exc_value = values[1];
-    __pyx_v_traceback = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_38__exit__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_value, __pyx_v_traceback);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_38__exit__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__exit__", 0);
-  __Pyx_TraceCall("__exit__", __pyx_f[0], 948);
-
-  /* "pysam/calignmentfile.pyx":949
- * 
- *     def __exit__(self, exc_type, exc_value, traceback):
- *         self.close()             # <<<<<<<<<<<<<<
- *         return False
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":950
- *     def __exit__(self, exc_type, exc_value, traceback):
- *         self.close()
- *         return False             # <<<<<<<<<<<<<<
- * 
- *     ###############################################################
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(Py_False);
-  __pyx_r = Py_False;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":948
- *         return self
- * 
- *     def __exit__(self, exc_type, exc_value, traceback):             # <<<<<<<<<<<<<<
- *         self.close()
- *         return False
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":959
- *     property filename:
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._filename
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_8filename_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_8filename_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8filename___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8filename___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 959);
-
-  /* "pysam/calignmentfile.pyx":960
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):
- *             return self._filename             # <<<<<<<<<<<<<<
- * 
- *     property nreferences:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self->_filename);
-  __pyx_r = __pyx_v_self->_filename;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":959
- *     property filename:
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._filename
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":964
- *     property nreferences:
- *         '''number of :term:`reference` sequences in the file.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             return self.header.n_targets
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_11nreferences_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_11nreferences_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_11nreferences___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_11nreferences___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 964);
-
-  /* "pysam/calignmentfile.pyx":965
- *         '''number of :term:`reference` sequences in the file.'''
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *             return self.header.n_targets
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":966
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             return self.header.n_targets             # <<<<<<<<<<<<<<
- * 
- *     property references:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_self->header->n_targets); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":964
- *     property nreferences:
- *         '''number of :term:`reference` sequences in the file.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             return self.header.n_targets
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.nreferences.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":970
- *     property references:
- *         """tuple with the names of :term:`reference` sequences."""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             t = []
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_10references_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_10references_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_10references___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_10references___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_v_t = NULL;
-  long __pyx_v_x;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int32_t __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 970);
-
-  /* "pysam/calignmentfile.pyx":971
- *         """tuple with the names of :term:`reference` sequences."""
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *             t = []
- *             for x from 0 <= x < self.header.n_targets:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":972
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             t = []             # <<<<<<<<<<<<<<
- *             for x from 0 <= x < self.header.n_targets:
- *                 t.append(_charptr_to_str(self.header.target_name[x]))
- */
-  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_t = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":973
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             t = []
- *             for x from 0 <= x < self.header.n_targets:             # <<<<<<<<<<<<<<
- *                 t.append(_charptr_to_str(self.header.target_name[x]))
- *             return tuple(t)
- */
-  __pyx_t_5 = __pyx_v_self->header->n_targets;
-  for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_5; __pyx_v_x++) {
-
-    /* "pysam/calignmentfile.pyx":974
- *             t = []
- *             for x from 0 <= x < self.header.n_targets:
- *                 t.append(_charptr_to_str(self.header.target_name[x]))             # <<<<<<<<<<<<<<
- *             return tuple(t)
- * 
- */
-    __pyx_t_2 = __pyx_f_5pysam_14calignmentfile__charptr_to_str((__pyx_v_self->header->target_name[__pyx_v_x])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_t, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  }
-
-  /* "pysam/calignmentfile.pyx":975
- *             for x from 0 <= x < self.header.n_targets:
- *                 t.append(_charptr_to_str(self.header.target_name[x]))
- *             return tuple(t)             # <<<<<<<<<<<<<<
- * 
- *     property lengths:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = PyList_AsTuple(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":970
- *     property references:
- *         """tuple with the names of :term:`reference` sequences."""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             t = []
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.references.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_t);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":983
- * 
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             t = []
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_7lengths_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_7lengths_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_7lengths___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_7lengths___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_v_t = NULL;
-  long __pyx_v_x;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int32_t __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 983);
-
-  /* "pysam/calignmentfile.pyx":984
- *         """
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *             t = []
- *             for x from 0 <= x < self.header.n_targets:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":985
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             t = []             # <<<<<<<<<<<<<<
- *             for x from 0 <= x < self.header.n_targets:
- *                 t.append( self.header.target_len[x] )
- */
-  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_t = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":986
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             t = []
- *             for x from 0 <= x < self.header.n_targets:             # <<<<<<<<<<<<<<
- *                 t.append( self.header.target_len[x] )
- *             return tuple(t)
- */
-  __pyx_t_5 = __pyx_v_self->header->n_targets;
-  for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_5; __pyx_v_x++) {
-
-    /* "pysam/calignmentfile.pyx":987
- *             t = []
- *             for x from 0 <= x < self.header.n_targets:
- *                 t.append( self.header.target_len[x] )             # <<<<<<<<<<<<<<
- *             return tuple(t)
- * 
- */
-    __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_self->header->target_len[__pyx_v_x])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_t, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  }
-
-  /* "pysam/calignmentfile.pyx":988
- *             for x from 0 <= x < self.header.n_targets:
- *                 t.append( self.header.target_len[x] )
- *             return tuple(t)             # <<<<<<<<<<<<<<
- * 
- *     property mapped:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = PyList_AsTuple(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":983
- * 
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )
- *             t = []
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.lengths.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_t);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":993
- *         """total number of mapped alignments in file.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             self._checkIndex()
- *             cdef int tid
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_6mapped_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_6mapped_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6mapped___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6mapped___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  int __pyx_v_tid;
-  uint64_t __pyx_v_total;
-  uint64_t __pyx_v_mapped;
-  uint64_t __pyx_v_unmapped;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int32_t __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 993);
-
-  /* "pysam/calignmentfile.pyx":994
- *         """
- *         def __get__(self):
- *             self._checkIndex()             # <<<<<<<<<<<<<<
- *             cdef int tid
- *             cdef uint64_t total = 0
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checkIndex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":996
- *             self._checkIndex()
- *             cdef int tid
- *             cdef uint64_t total = 0             # <<<<<<<<<<<<<<
- *             cdef uint64_t mapped, unmapped
- *             for tid from 0 <= tid < self.header.n_targets:
- */
-  __pyx_v_total = 0;
-
-  /* "pysam/calignmentfile.pyx":998
- *             cdef uint64_t total = 0
- *             cdef uint64_t mapped, unmapped
- *             for tid from 0 <= tid < self.header.n_targets:             # <<<<<<<<<<<<<<
- *                 hts_idx_get_stat(self.index, tid, &mapped, &unmapped)
- *                 total += mapped
- */
-  __pyx_t_3 = __pyx_v_self->header->n_targets;
-  for (__pyx_v_tid = 0; __pyx_v_tid < __pyx_t_3; __pyx_v_tid++) {
-
-    /* "pysam/calignmentfile.pyx":999
- *             cdef uint64_t mapped, unmapped
- *             for tid from 0 <= tid < self.header.n_targets:
- *                 hts_idx_get_stat(self.index, tid, &mapped, &unmapped)             # <<<<<<<<<<<<<<
- *                 total += mapped
- *             return total
- */
-    hts_idx_get_stat(__pyx_v_self->index, __pyx_v_tid, (&__pyx_v_mapped), (&__pyx_v_unmapped));
-
-    /* "pysam/calignmentfile.pyx":1000
- *             for tid from 0 <= tid < self.header.n_targets:
- *                 hts_idx_get_stat(self.index, tid, &mapped, &unmapped)
- *                 total += mapped             # <<<<<<<<<<<<<<
- *             return total
- * 
- */
-    __pyx_v_total = (__pyx_v_total + __pyx_v_mapped);
-  }
-
-  /* "pysam/calignmentfile.pyx":1001
- *                 hts_idx_get_stat(self.index, tid, &mapped, &unmapped)
- *                 total += mapped
- *             return total             # <<<<<<<<<<<<<<
- * 
- *     def _checkIndex(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_total); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":993
- *         """total number of mapped alignments in file.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             self._checkIndex()
- *             cdef int tid
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.mapped.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1003
- *             return total
- * 
- *     def _checkIndex(self):             # <<<<<<<<<<<<<<
- *         '''check if index is present. Otherwise raise
- *         an error.'''
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_41_checkIndex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_40_checkIndex[] = "AlignmentFile._checkIndex(self)\ncheck if index is present. Otherwise raise\n        an error.";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_41_checkIndex(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_checkIndex (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_40_checkIndex(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_40_checkIndex(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_checkIndex", 0);
-  __Pyx_TraceCall("_checkIndex", __pyx_f[0], 1003);
-
-  /* "pysam/calignmentfile.pyx":1006
- *         '''check if index is present. Otherwise raise
- *         an error.'''
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file")
- *         if not self.isbam:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1007
- *         an error.'''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *         if not self.isbam:
- *             raise AttributeError("AlignmentFile.mapped only available in bam files")
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1008
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")
- *         if not self.isbam:             # <<<<<<<<<<<<<<
- *             raise AttributeError("AlignmentFile.mapped only available in bam files")
- *         if self.index == NULL:
- */
-  __pyx_t_4 = ((!(__pyx_v_self->isbam != 0)) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1009
- *             raise ValueError("I/O operation on closed file")
- *         if not self.isbam:
- *             raise AttributeError("AlignmentFile.mapped only available in bam files")             # <<<<<<<<<<<<<<
- *         if self.index == NULL:
- *             raise ValueError("mapping information not recorded in index "
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1010
- *         if not self.isbam:
- *             raise AttributeError("AlignmentFile.mapped only available in bam files")
- *         if self.index == NULL:             # <<<<<<<<<<<<<<
- *             raise ValueError("mapping information not recorded in index "
- *                                  "or index not available")
- */
-  __pyx_t_4 = ((__pyx_v_self->index == NULL) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1011
- *             raise AttributeError("AlignmentFile.mapped only available in bam files")
- *         if self.index == NULL:
- *             raise ValueError("mapping information not recorded in index "             # <<<<<<<<<<<<<<
- *                                  "or index not available")
- * 
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1003
- *             return total
- * 
- *     def _checkIndex(self):             # <<<<<<<<<<<<<<
- *         '''check if index is present. Otherwise raise
- *         an error.'''
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._checkIndex", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1018
- *         """total number of unmapped reads in file.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             self._checkIndex()
- *             cdef int tid
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_8unmapped_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_8unmapped_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8unmapped___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_8unmapped___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  int __pyx_v_tid;
-  uint64_t __pyx_v_total;
-  uint64_t __pyx_v_mapped;
-  uint64_t __pyx_v_unmapped;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int32_t __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 1018);
-
-  /* "pysam/calignmentfile.pyx":1019
- *         """
- *         def __get__(self):
- *             self._checkIndex()             # <<<<<<<<<<<<<<
- *             cdef int tid
- *             cdef uint64_t total = 0
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checkIndex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":1021
- *             self._checkIndex()
- *             cdef int tid
- *             cdef uint64_t total = 0             # <<<<<<<<<<<<<<
- *             cdef uint64_t mapped, unmapped
- *             for tid from 0 <= tid < self.header.n_targets:
- */
-  __pyx_v_total = 0;
-
-  /* "pysam/calignmentfile.pyx":1023
- *             cdef uint64_t total = 0
- *             cdef uint64_t mapped, unmapped
- *             for tid from 0 <= tid < self.header.n_targets:             # <<<<<<<<<<<<<<
- *                 hts_idx_get_stat(self.index, tid, &mapped, &unmapped)
- *                 total += unmapped
- */
-  __pyx_t_3 = __pyx_v_self->header->n_targets;
-  for (__pyx_v_tid = 0; __pyx_v_tid < __pyx_t_3; __pyx_v_tid++) {
-
-    /* "pysam/calignmentfile.pyx":1024
- *             cdef uint64_t mapped, unmapped
- *             for tid from 0 <= tid < self.header.n_targets:
- *                 hts_idx_get_stat(self.index, tid, &mapped, &unmapped)             # <<<<<<<<<<<<<<
- *                 total += unmapped
- *             return total
- */
-    hts_idx_get_stat(__pyx_v_self->index, __pyx_v_tid, (&__pyx_v_mapped), (&__pyx_v_unmapped));
-
-    /* "pysam/calignmentfile.pyx":1025
- *             for tid from 0 <= tid < self.header.n_targets:
- *                 hts_idx_get_stat(self.index, tid, &mapped, &unmapped)
- *                 total += unmapped             # <<<<<<<<<<<<<<
- *             return total
- * 
- */
-    __pyx_v_total = (__pyx_v_total + __pyx_v_unmapped);
-  }
-
-  /* "pysam/calignmentfile.pyx":1026
- *                 hts_idx_get_stat(self.index, tid, &mapped, &unmapped)
- *                 total += unmapped
- *             return total             # <<<<<<<<<<<<<<
- * 
- *     property nocoordinate:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_total); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1018
- *         """total number of unmapped reads in file.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             self._checkIndex()
- *             cdef int tid
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.unmapped.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1031
- *         """total number of reads without coordinates
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             self._checkIndex()
- *             return hts_idx_get_n_no_coor(self.index)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_12nocoordinate_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_12nocoordinate_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_12nocoordinate___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_12nocoordinate___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 1031);
-
-  /* "pysam/calignmentfile.pyx":1032
- *         """
- *         def __get__(self):
- *             self._checkIndex()             # <<<<<<<<<<<<<<
- *             return hts_idx_get_n_no_coor(self.index)
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_checkIndex); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":1033
- *         def __get__(self):
- *             self._checkIndex()
- *             return hts_idx_get_n_no_coor(self.index)             # <<<<<<<<<<<<<<
- * 
- *     property text:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(hts_idx_get_n_no_coor(__pyx_v_self->index)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1031
- *         """total number of reads without coordinates
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             self._checkIndex()
- *             return hts_idx_get_n_no_coor(self.index)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.nocoordinate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1042
- * 
- *         '''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_4text_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_4text_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_4text___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_4text___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 1042);
-
-  /* "pysam/calignmentfile.pyx":1043
- *         '''
- *         def __get__(self):
- *             if not self._isOpen():             # <<<<<<<<<<<<<<
- *                 raise ValueError( "I/O operation on closed file" )
- *             return from_string_and_size(self.header.text, self.header.l_text)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1044
- *         def __get__(self):
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *             return from_string_and_size(self.header.text, self.header.l_text)
- * 
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1045
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )
- *             return from_string_and_size(self.header.text, self.header.l_text)             # <<<<<<<<<<<<<<
- * 
- *     property header:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_from_string_and_size(__pyx_v_self->header->text, __pyx_v_self->header->l_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1042
- * 
- *         '''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.text.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1068
- * 
- *         '''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_6header_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_6header_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6header___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_6header___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_v_t = NULL;
-  PyObject *__pyx_v_line = NULL;
-  PyObject *__pyx_v_fields = NULL;
-  PyObject *__pyx_v_record = NULL;
-  PyObject *__pyx_v_x = NULL;
-  PyObject *__pyx_v_idx = NULL;
-  PyObject *__pyx_v_field = NULL;
-  PyObject *__pyx_v_key = NULL;
-  PyObject *__pyx_v_value = NULL;
-  PyObject *__pyx_v_sq = NULL;
-  PyObject *__pyx_v_ref = NULL;
-  PyObject *__pyx_v_length = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  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_t_9;
-  Py_ssize_t __pyx_t_10;
-  PyObject *(*__pyx_t_11)(PyObject *);
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  PyObject *__pyx_t_14 = NULL;
-  PyObject *(*__pyx_t_15)(PyObject *);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 1068);
-
-  /* "pysam/calignmentfile.pyx":1069
- *         '''
- *         def __get__(self):
- *             if not self._isOpen():             # <<<<<<<<<<<<<<
- *                 raise ValueError( "I/O operation on closed file" )
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1070
- *         def __get__(self):
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *             result = {}
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1072
- *                 raise ValueError( "I/O operation on closed file" )
- * 
- *             result = {}             # <<<<<<<<<<<<<<
- * 
- *             if self.header.text != NULL:
- */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_result = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":1074
- *             result = {}
- * 
- *             if self.header.text != NULL:             # <<<<<<<<<<<<<<
- *                 # convert to python string (note: call self.text to
- *                 # create 0-terminated string)
- */
-  __pyx_t_4 = ((__pyx_v_self->header->text != NULL) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1077
- *                 # convert to python string (note: call self.text to
- *                 # create 0-terminated string)
- *                 t = self.text             # <<<<<<<<<<<<<<
- *                 for line in t.split("\n"):
- *                     if not line.strip(): continue
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_t = __pyx_t_2;
-    __pyx_t_2 = 0;
-
-    /* "pysam/calignmentfile.pyx":1078
- *                 # create 0-terminated string)
- *                 t = self.text
- *                 for line in t.split("\n"):             # <<<<<<<<<<<<<<
- *                     if not line.strip(): continue
- *                     assert line.startswith("@"), \
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
-      __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-    } else {
-      __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    for (;;) {
-      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) {
-        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) {
-        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_1 = __pyx_t_6(__pyx_t_2);
-        if (unlikely(!__pyx_t_1)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_1);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
-      __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":1079
- *                 t = self.text
- *                 for line in t.split("\n"):
- *                     if not line.strip(): continue             # <<<<<<<<<<<<<<
- *                     assert line.startswith("@"), \
- *                         "header line without '@': '%s'" % line
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_3 = ((!__pyx_t_4) != 0);
-      if (__pyx_t_3) {
-        goto __pyx_L5_continue;
-      }
-
-      /* "pysam/calignmentfile.pyx":1080
- *                 for line in t.split("\n"):
- *                     if not line.strip(): continue
- *                     assert line.startswith("@"), \             # <<<<<<<<<<<<<<
- *                         "header line without '@': '%s'" % line
- *                     fields = line[1:].split("\t")
- */
-      #ifndef CYTHON_WITHOUT_ASSERTIONS
-      if (unlikely(!Py_OptimizeFlag)) {
-        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        if (unlikely(!__pyx_t_3)) {
-
-          /* "pysam/calignmentfile.pyx":1081
- *                     if not line.strip(): continue
- *                     assert line.startswith("@"), \
- *                         "header line without '@': '%s'" % line             # <<<<<<<<<<<<<<
- *                     fields = line[1:].split("\t")
- *                     record = fields[0]
- */
-          __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_header_line_without_s, __pyx_v_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          PyErr_SetObject(PyExc_AssertionError, __pyx_t_1);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-      }
-      #endif
-
-      /* "pysam/calignmentfile.pyx":1082
- *                     assert line.startswith("@"), \
- *                         "header line without '@': '%s'" % line
- *                     fields = line[1:].split("\t")             # <<<<<<<<<<<<<<
- *                     record = fields[0]
- *                     assert record in VALID_HEADER_TYPES, \
- */
-      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_line, 1, 0, NULL, NULL, &__pyx_slice__42, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_1);
-      __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":1083
- *                         "header line without '@': '%s'" % line
- *                     fields = line[1:].split("\t")
- *                     record = fields[0]             # <<<<<<<<<<<<<<
- *                     assert record in VALID_HEADER_TYPES, \
- *                         "header line with invalid type '%s': '%s'" % (record, line)
- */
-      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_XDECREF_SET(__pyx_v_record, __pyx_t_1);
-      __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":1084
- *                     fields = line[1:].split("\t")
- *                     record = fields[0]
- *                     assert record in VALID_HEADER_TYPES, \             # <<<<<<<<<<<<<<
- *                         "header line with invalid type '%s': '%s'" % (record, line)
- * 
- */
-      #ifndef CYTHON_WITHOUT_ASSERTIONS
-      if (unlikely(!Py_OptimizeFlag)) {
-        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADER_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_record, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        if (unlikely(!(__pyx_t_3 != 0))) {
-
-          /* "pysam/calignmentfile.pyx":1085
- *                     record = fields[0]
- *                     assert record in VALID_HEADER_TYPES, \
- *                         "header line with invalid type '%s': '%s'" % (record, line)             # <<<<<<<<<<<<<<
- * 
- *                     # treat comments
- */
-          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_INCREF(__pyx_v_record);
-          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_record);
-          __Pyx_GIVEREF(__pyx_v_record);
-          __Pyx_INCREF(__pyx_v_line);
-          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_line);
-          __Pyx_GIVEREF(__pyx_v_line);
-          __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_header_line_with_invalid_type_s, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          PyErr_SetObject(PyExc_AssertionError, __pyx_t_7);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-      }
-      #endif
-
-      /* "pysam/calignmentfile.pyx":1088
- * 
- *                     # treat comments
- *                     if record == "CO":             # <<<<<<<<<<<<<<
- *                         if record not in result:
- *                             result[record] = []
- */
-      __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_record, __pyx_n_s_CO, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (__pyx_t_3) {
-
-        /* "pysam/calignmentfile.pyx":1089
- *                     # treat comments
- *                     if record == "CO":
- *                         if record not in result:             # <<<<<<<<<<<<<<
- *                             result[record] = []
- *                         result[record].append("\t".join( fields[1:]))
- */
-        __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_record, __pyx_v_result, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_4 = (__pyx_t_3 != 0);
-        if (__pyx_t_4) {
-
-          /* "pysam/calignmentfile.pyx":1090
- *                     if record == "CO":
- *                         if record not in result:
- *                             result[record] = []             # <<<<<<<<<<<<<<
- *                         result[record].append("\t".join( fields[1:]))
- *                         continue
- */
-          __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_record, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          goto __pyx_L9;
-        }
-        __pyx_L9:;
-
-        /* "pysam/calignmentfile.pyx":1091
- *                         if record not in result:
- *                             result[record] = []
- *                         result[record].append("\t".join( fields[1:]))             # <<<<<<<<<<<<<<
- *                         continue
- *                     # the following is clumsy as generators do not work?
- */
-        __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_record); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 1, 0, NULL, NULL, &__pyx_slice__45, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_8 = __Pyx_PyString_Join(__pyx_kp_s__43, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-        /* "pysam/calignmentfile.pyx":1092
- *                             result[record] = []
- *                         result[record].append("\t".join( fields[1:]))
- *                         continue             # <<<<<<<<<<<<<<
- *                     # the following is clumsy as generators do not work?
- *                     x = {}
- */
-        goto __pyx_L5_continue;
-      }
-
-      /* "pysam/calignmentfile.pyx":1094
- *                         continue
- *                     # the following is clumsy as generators do not work?
- *                     x = {}             # <<<<<<<<<<<<<<
- * 
- *                     for idx, field in enumerate(fields[1:]):
- */
-      __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_XDECREF_SET(__pyx_v_x, ((PyObject*)__pyx_t_8));
-      __pyx_t_8 = 0;
-
-      /* "pysam/calignmentfile.pyx":1096
- *                     x = {}
- * 
- *                     for idx, field in enumerate(fields[1:]):             # <<<<<<<<<<<<<<
- *                         if ":" not in field:
- *                             raise ValueError("malformatted header: no ':' in field" )
- */
-      __Pyx_INCREF(__pyx_int_0);
-      __pyx_t_8 = __pyx_int_0;
-      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 1, 0, NULL, NULL, &__pyx_slice__46, 1, 0, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
-        __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
-        __pyx_t_11 = NULL;
-      } else {
-        __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
-      }
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      for (;;) {
-        if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) {
-          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) {
-          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else {
-          __pyx_t_7 = __pyx_t_11(__pyx_t_1);
-          if (unlikely(!__pyx_t_7)) {
-            PyObject* exc_type = PyErr_Occurred();
-            if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            }
-            break;
-          }
-          __Pyx_GOTREF(__pyx_t_7);
-        }
-        __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_7);
-        __pyx_t_7 = 0;
-        __Pyx_INCREF(__pyx_t_8);
-        __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_8);
-        __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_8);
-        __pyx_t_8 = __pyx_t_7;
-        __pyx_t_7 = 0;
-
-        /* "pysam/calignmentfile.pyx":1097
- * 
- *                     for idx, field in enumerate(fields[1:]):
- *                         if ":" not in field:             # <<<<<<<<<<<<<<
- *                             raise ValueError("malformatted header: no ':' in field" )
- *                         key, value = field.split(":", 1)
- */
-        __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_kp_s__47, __pyx_v_field, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_3 = (__pyx_t_4 != 0);
-        if (__pyx_t_3) {
-
-          /* "pysam/calignmentfile.pyx":1098
- *                     for idx, field in enumerate(fields[1:]):
- *                         if ":" not in field:
- *                             raise ValueError("malformatted header: no ':' in field" )             # <<<<<<<<<<<<<<
- *                         key, value = field.split(":", 1)
- *                         if key in ("CL",):
- */
-          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-
-        /* "pysam/calignmentfile.pyx":1099
- *                         if ":" not in field:
- *                             raise ValueError("malformatted header: no ':' in field" )
- *                         key, value = field.split(":", 1)             # <<<<<<<<<<<<<<
- *                         if key in ("CL",):
- *                             # special treatment for command line
- */
-        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_12);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
-          PyObject* sequence = __pyx_t_12;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          Py_ssize_t size = Py_SIZE(sequence);
-          #else
-          Py_ssize_t size = PySequence_Size(sequence);
-          #endif
-          if (unlikely(size != 2)) {
-            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          #if CYTHON_COMPILING_IN_CPYTHON
-          if (likely(PyTuple_CheckExact(sequence))) {
-            __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
-            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
-          } else {
-            __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
-            __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
-          }
-          __Pyx_INCREF(__pyx_t_7);
-          __Pyx_INCREF(__pyx_t_13);
-          #else
-          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_13);
-          #endif
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-        } else {
-          Py_ssize_t index = -1;
-          __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_14);
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext;
-          index = 0; __pyx_t_7 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_7)) goto __pyx_L13_unpacking_failed;
-          __Pyx_GOTREF(__pyx_t_7);
-          index = 1; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L13_unpacking_failed;
-          __Pyx_GOTREF(__pyx_t_13);
-          if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_15 = NULL;
-          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-          goto __pyx_L14_unpacking_done;
-          __pyx_L13_unpacking_failed:;
-          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-          __pyx_t_15 = NULL;
-          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_L14_unpacking_done:;
-        }
-        __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_7);
-        __pyx_t_7 = 0;
-        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_13);
-        __pyx_t_13 = 0;
-
-        /* "pysam/calignmentfile.pyx":1100
- *                             raise ValueError("malformatted header: no ':' in field" )
- *                         key, value = field.split(":", 1)
- *                         if key in ("CL",):             # <<<<<<<<<<<<<<
- *                             # special treatment for command line
- *                             # statements (CL). These might contain
- */
-        __Pyx_INCREF(__pyx_v_key);
-        __pyx_t_12 = __pyx_v_key;
-        __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_12, __pyx_n_s_CL, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-        __pyx_t_4 = (__pyx_t_3 != 0);
-        if (__pyx_t_4) {
-
-          /* "pysam/calignmentfile.pyx":1107
- *                             # header. Thus, in contravention to the
- *                             # SAM API, consume the rest of the line.
- *                             key, value = "\t".join(fields[idx+1:]).split(":", 1)             # <<<<<<<<<<<<<<
- *                             x[key] = VALID_HEADER_FIELDS[record][key](value)
- *                             break
- */
-          __pyx_t_12 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __pyx_t_13 = __Pyx_PyObject_GetSlice(__pyx_v_fields, 0, 0, &__pyx_t_12, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_13);
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          __pyx_t_12 = __Pyx_PyString_Join(__pyx_kp_s__43, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_13);
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
-            PyObject* sequence = __pyx_t_12;
-            #if CYTHON_COMPILING_IN_CPYTHON
-            Py_ssize_t size = Py_SIZE(sequence);
-            #else
-            Py_ssize_t size = PySequence_Size(sequence);
-            #endif
-            if (unlikely(size != 2)) {
-              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            }
-            #if CYTHON_COMPILING_IN_CPYTHON
-            if (likely(PyTuple_CheckExact(sequence))) {
-              __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
-              __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
-            } else {
-              __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
-              __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
-            }
-            __Pyx_INCREF(__pyx_t_13);
-            __Pyx_INCREF(__pyx_t_7);
-            #else
-            __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __Pyx_GOTREF(__pyx_t_13);
-            __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __Pyx_GOTREF(__pyx_t_7);
-            #endif
-            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          } else {
-            Py_ssize_t index = -1;
-            __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __Pyx_GOTREF(__pyx_t_14);
-            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-            __pyx_t_15 = Py_TYPE(__pyx_t_14)->tp_iternext;
-            index = 0; __pyx_t_13 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_13)) goto __pyx_L16_unpacking_failed;
-            __Pyx_GOTREF(__pyx_t_13);
-            index = 1; __pyx_t_7 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_7)) goto __pyx_L16_unpacking_failed;
-            __Pyx_GOTREF(__pyx_t_7);
-            if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __pyx_t_15 = NULL;
-            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-            goto __pyx_L17_unpacking_done;
-            __pyx_L16_unpacking_failed:;
-            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-            __pyx_t_15 = NULL;
-            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __pyx_L17_unpacking_done:;
-          }
-          __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_13);
-          __pyx_t_13 = 0;
-          __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_7);
-          __pyx_t_7 = 0;
-
-          /* "pysam/calignmentfile.pyx":1108
- *                             # SAM API, consume the rest of the line.
- *                             key, value = "\t".join(fields[idx+1:]).split(":", 1)
- *                             x[key] = VALID_HEADER_FIELDS[record][key](value)             # <<<<<<<<<<<<<<
- *                             break
- * 
- */
-          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADER_FIELDS); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_record); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          __pyx_t_12 = PyObject_GetItem(__pyx_t_7, __pyx_v_key); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_INCREF(__pyx_v_value);
-          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_value);
-          __Pyx_GIVEREF(__pyx_v_value);
-          __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_13);
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          if (unlikely(PyDict_SetItem(__pyx_v_x, __pyx_v_key, __pyx_t_13) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-
-          /* "pysam/calignmentfile.pyx":1109
- *                             key, value = "\t".join(fields[idx+1:]).split(":", 1)
- *                             x[key] = VALID_HEADER_FIELDS[record][key](value)
- *                             break             # <<<<<<<<<<<<<<
- * 
- *                         # uppercase keys must be valid
- */
-          goto __pyx_L11_break;
-        }
-
-        /* "pysam/calignmentfile.pyx":1112
- * 
- *                         # uppercase keys must be valid
- *                         if key in VALID_HEADER_FIELDS[record]:             # <<<<<<<<<<<<<<
- *                             x[key] = VALID_HEADER_FIELDS[record][key](value)
- *                         # lowercase are permitted for user fields
- */
-        __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADER_FIELDS); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_7 = PyObject_GetItem(__pyx_t_13, __pyx_v_record); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_3 = (__pyx_t_4 != 0);
-        if (__pyx_t_3) {
-
-          /* "pysam/calignmentfile.pyx":1113
- *                         # uppercase keys must be valid
- *                         if key in VALID_HEADER_FIELDS[record]:
- *                             x[key] = VALID_HEADER_FIELDS[record][key](value)             # <<<<<<<<<<<<<<
- *                         # lowercase are permitted for user fields
- *                         elif not key.isupper():
- */
-          __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADER_FIELDS); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __pyx_t_13 = PyObject_GetItem(__pyx_t_7, __pyx_v_record); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_13);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __pyx_t_7 = PyObject_GetItem(__pyx_t_13, __pyx_v_key); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_13);
-          __Pyx_INCREF(__pyx_v_value);
-          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_value);
-          __Pyx_GIVEREF(__pyx_v_value);
-          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          if (unlikely(PyDict_SetItem(__pyx_v_x, __pyx_v_key, __pyx_t_12) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          goto __pyx_L18;
-        }
-
-        /* "pysam/calignmentfile.pyx":1115
- *                             x[key] = VALID_HEADER_FIELDS[record][key](value)
- *                         # lowercase are permitted for user fields
- *                         elif not key.isupper():             # <<<<<<<<<<<<<<
- *                             x[key] = value
- *                         else:
- */
-        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_isupper); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_12);
-        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_13);
-        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_4 = ((!__pyx_t_3) != 0);
-        if (__pyx_t_4) {
-
-          /* "pysam/calignmentfile.pyx":1116
- *                         # lowercase are permitted for user fields
- *                         elif not key.isupper():
- *                             x[key] = value             # <<<<<<<<<<<<<<
- *                         else:
- *                             raise ValueError(
- */
-          if (unlikely(PyDict_SetItem(__pyx_v_x, __pyx_v_key, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          goto __pyx_L18;
-        }
-        /*else*/ {
-
-          /* "pysam/calignmentfile.pyx":1120
- *                             raise ValueError(
- *                                 "unknown field code '%s' in record '%s'" %
- *                                 (key, record))             # <<<<<<<<<<<<<<
- * 
- *                     if VALID_HEADER_TYPES[record] == dict:
- */
-          __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_13);
-          __Pyx_INCREF(__pyx_v_key);
-          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_key);
-          __Pyx_GIVEREF(__pyx_v_key);
-          __Pyx_INCREF(__pyx_v_record);
-          PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_record);
-          __Pyx_GIVEREF(__pyx_v_record);
-
-          /* "pysam/calignmentfile.pyx":1119
- *                         else:
- *                             raise ValueError(
- *                                 "unknown field code '%s' in record '%s'" %             # <<<<<<<<<<<<<<
- *                                 (key, record))
- * 
- */
-          __pyx_t_12 = __Pyx_PyString_Format(__pyx_kp_s_unknown_field_code_s_in_record_s, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-
-          /* "pysam/calignmentfile.pyx":1118
- *                             x[key] = value
- *                         else:
- *                             raise ValueError(             # <<<<<<<<<<<<<<
- *                                 "unknown field code '%s' in record '%s'" %
- *                                 (key, record))
- */
-          __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_13);
-          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12);
-          __Pyx_GIVEREF(__pyx_t_12);
-          __pyx_t_12 = 0;
-          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          __Pyx_Raise(__pyx_t_12, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        __pyx_L18:;
-      }
-      __pyx_L11_break:;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-      /* "pysam/calignmentfile.pyx":1122
- *                                 (key, record))
- * 
- *                     if VALID_HEADER_TYPES[record] == dict:             # <<<<<<<<<<<<<<
- *                         if record in result:
- *                             raise ValueError(
- */
-      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADER_TYPES); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_v_record); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)((PyObject*)(&PyDict_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      if (__pyx_t_4) {
-
-        /* "pysam/calignmentfile.pyx":1123
- * 
- *                     if VALID_HEADER_TYPES[record] == dict:
- *                         if record in result:             # <<<<<<<<<<<<<<
- *                             raise ValueError(
- *                                 "multiple '%s' lines are not permitted" % record)
- */
-        __pyx_t_4 = (__Pyx_PyDict_Contains(__pyx_v_record, __pyx_v_result, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_3 = (__pyx_t_4 != 0);
-        if (__pyx_t_3) {
-
-          /* "pysam/calignmentfile.pyx":1125
- *                         if record in result:
- *                             raise ValueError(
- *                                 "multiple '%s' lines are not permitted" % record)             # <<<<<<<<<<<<<<
- * 
- *                         result[record] = x
- */
-          __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_multiple_s_lines_are_not_permitt, __pyx_v_record); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-
-          /* "pysam/calignmentfile.pyx":1124
- *                     if VALID_HEADER_TYPES[record] == dict:
- *                         if record in result:
- *                             raise ValueError(             # <<<<<<<<<<<<<<
- *                                 "multiple '%s' lines are not permitted" % record)
- * 
- */
-          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
-          __Pyx_GIVEREF(__pyx_t_8);
-          __pyx_t_8 = 0;
-          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-
-        /* "pysam/calignmentfile.pyx":1127
- *                                 "multiple '%s' lines are not permitted" % record)
- * 
- *                         result[record] = x             # <<<<<<<<<<<<<<
- *                     elif VALID_HEADER_TYPES[record] == list:
- *                         if record not in result: result[record] = []
- */
-        if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_record, __pyx_v_x) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L19;
-      }
-
-      /* "pysam/calignmentfile.pyx":1128
- * 
- *                         result[record] = x
- *                     elif VALID_HEADER_TYPES[record] == list:             # <<<<<<<<<<<<<<
- *                         if record not in result: result[record] = []
- *                         result[record].append(x)
- */
-      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADER_TYPES); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_v_record); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)((PyObject*)(&PyList_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      if (__pyx_t_3) {
-
-        /* "pysam/calignmentfile.pyx":1129
- *                         result[record] = x
- *                     elif VALID_HEADER_TYPES[record] == list:
- *                         if record not in result: result[record] = []             # <<<<<<<<<<<<<<
- *                         result[record].append(x)
- * 
- */
-        __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_v_record, __pyx_v_result, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_4 = (__pyx_t_3 != 0);
-        if (__pyx_t_4) {
-          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_v_record, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          goto __pyx_L21;
-        }
-        __pyx_L21:;
-
-        /* "pysam/calignmentfile.pyx":1130
- *                     elif VALID_HEADER_TYPES[record] == list:
- *                         if record not in result: result[record] = []
- *                         result[record].append(x)             # <<<<<<<<<<<<<<
- * 
- *                 # if there are no SQ lines in the header, add the reference names
- */
-        __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_v_record); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_8, __pyx_v_x); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        goto __pyx_L19;
-      }
-      __pyx_L19:;
-      __pyx_L5_continue:;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-    /* "pysam/calignmentfile.pyx":1140
- *                 # the SQ information is not part of the textual header
- *                 # and thus are missing from the output. See issue 84.
- *                 if "SQ" not in result:             # <<<<<<<<<<<<<<
- *                     sq = []
- *                     for ref, length in zip(self.references, self.lengths):
- */
-    __pyx_t_4 = (__Pyx_PyDict_Contains(__pyx_n_s_SQ, __pyx_v_result, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = (__pyx_t_4 != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":1141
- *                 # and thus are missing from the output. See issue 84.
- *                 if "SQ" not in result:
- *                     sq = []             # <<<<<<<<<<<<<<
- *                     for ref, length in zip(self.references, self.lengths):
- *                         sq.append({'LN': length, 'SN': ref })
- */
-      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_v_sq = ((PyObject*)__pyx_t_2);
-      __pyx_t_2 = 0;
-
-      /* "pysam/calignmentfile.pyx":1142
- *                 if "SQ" not in result:
- *                     sq = []
- *                     for ref, length in zip(self.references, self.lengths):             # <<<<<<<<<<<<<<
- *                         sq.append({'LN': length, 'SN': ref })
- *                     result["SQ"] = sq
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_references); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lengths); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_2 = 0;
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __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_5 = 0;
-        __pyx_t_6 = NULL;
-      } else {
-        __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
-      }
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      for (;;) {
-        if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_1)) {
-          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
-          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else {
-          __pyx_t_8 = __pyx_t_6(__pyx_t_1);
-          if (unlikely(!__pyx_t_8)) {
-            PyObject* exc_type = PyErr_Occurred();
-            if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            }
-            break;
-          }
-          __Pyx_GOTREF(__pyx_t_8);
-        }
-        if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
-          PyObject* sequence = __pyx_t_8;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          Py_ssize_t size = Py_SIZE(sequence);
-          #else
-          Py_ssize_t size = PySequence_Size(sequence);
-          #endif
-          if (unlikely(size != 2)) {
-            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          #if CYTHON_COMPILING_IN_CPYTHON
-          if (likely(PyTuple_CheckExact(sequence))) {
-            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
-            __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
-          } else {
-            __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
-            __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
-          }
-          __Pyx_INCREF(__pyx_t_2);
-          __Pyx_INCREF(__pyx_t_12);
-          #else
-          __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          #endif
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        } else {
-          Py_ssize_t index = -1;
-          __pyx_t_13 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_13);
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __pyx_t_15 = Py_TYPE(__pyx_t_13)->tp_iternext;
-          index = 0; __pyx_t_2 = __pyx_t_15(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L25_unpacking_failed;
-          __Pyx_GOTREF(__pyx_t_2);
-          index = 1; __pyx_t_12 = __pyx_t_15(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L25_unpacking_failed;
-          __Pyx_GOTREF(__pyx_t_12);
-          if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_15 = NULL;
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          goto __pyx_L26_unpacking_done;
-          __pyx_L25_unpacking_failed:;
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          __pyx_t_15 = NULL;
-          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_L26_unpacking_done:;
-        }
-        __Pyx_XDECREF_SET(__pyx_v_ref, __pyx_t_2);
-        __pyx_t_2 = 0;
-        __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_12);
-        __pyx_t_12 = 0;
-
-        /* "pysam/calignmentfile.pyx":1143
- *                     sq = []
- *                     for ref, length in zip(self.references, self.lengths):
- *                         sq.append({'LN': length, 'SN': ref })             # <<<<<<<<<<<<<<
- *                     result["SQ"] = sq
- * 
- */
-        __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_LN, __pyx_v_length) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_SN, __pyx_v_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_sq, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      }
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/calignmentfile.pyx":1144
- *                     for ref, length in zip(self.references, self.lengths):
- *                         sq.append({'LN': length, 'SN': ref })
- *                     result["SQ"] = sq             # <<<<<<<<<<<<<<
- * 
- *             return result
- */
-      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_n_s_SQ, __pyx_v_sq) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L22;
-    }
-    __pyx_L22:;
-    goto __pyx_L4;
-  }
-  __pyx_L4:;
-
-  /* "pysam/calignmentfile.pyx":1146
- *                     result["SQ"] = sq
- * 
- *             return result             # <<<<<<<<<<<<<<
- * 
- *     def _buildLine(self, fields, record):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1068
- * 
- *         '''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_XDECREF(__pyx_t_13);
-  __Pyx_XDECREF(__pyx_t_14);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.header.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_t);
-  __Pyx_XDECREF(__pyx_v_line);
-  __Pyx_XDECREF(__pyx_v_fields);
-  __Pyx_XDECREF(__pyx_v_record);
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XDECREF(__pyx_v_idx);
-  __Pyx_XDECREF(__pyx_v_field);
-  __Pyx_XDECREF(__pyx_v_key);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XDECREF(__pyx_v_sq);
-  __Pyx_XDECREF(__pyx_v_ref);
-  __Pyx_XDECREF(__pyx_v_length);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1148
- *             return result
- * 
- *     def _buildLine(self, fields, record):             # <<<<<<<<<<<<<<
- *         '''build a header line from *fields* dictionary for *record*'''
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_43_buildLine(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_42_buildLine[] = "AlignmentFile._buildLine(self, fields, record)\nbuild a header line from *fields* dictionary for *record*";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_43_buildLine(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_fields = 0;
-  PyObject *__pyx_v_record = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_buildLine (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fields,&__pyx_n_s_record,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_record)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_buildLine", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_buildLine") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __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_fields = values[0];
-    __pyx_v_record = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_buildLine", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._buildLine", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_42_buildLine(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self), __pyx_v_fields, __pyx_v_record);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_42_buildLine(CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_record) {
-  PyObject *__pyx_v_line = NULL;
-  PyObject *__pyx_v_key = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  Py_ssize_t __pyx_t_5;
-  PyObject *(*__pyx_t_6)(PyObject *);
-  PyObject *__pyx_t_7 = NULL;
-  int __pyx_t_8;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_buildLine", 0);
-  __Pyx_TraceCall("_buildLine", __pyx_f[0], 1148);
-
-  /* "pysam/calignmentfile.pyx":1152
- * 
- *         # TODO: add checking for field and sort order
- *         line = ["@%s" % record]             # <<<<<<<<<<<<<<
- *         # comment
- *         if record == "CO":
- */
-  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_v_record); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_v_line = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":1154
- *         line = ["@%s" % record]
- *         # comment
- *         if record == "CO":             # <<<<<<<<<<<<<<
- *             line.append(fields)
- *         # user tags
- */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_record, __pyx_n_s_CO, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":1155
- *         # comment
- *         if record == "CO":
- *             line.append(fields)             # <<<<<<<<<<<<<<
- *         # user tags
- *         elif record.islower():
- */
-    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_line, __pyx_v_fields); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
-  }
-
-  /* "pysam/calignmentfile.pyx":1157
- *             line.append(fields)
- *         # user tags
- *         elif record.islower():             # <<<<<<<<<<<<<<
- *             for key in sorted(fields):
- *                 line.append("%s:%s" % (key, str(fields[key])))
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_record, __pyx_n_s_islower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":1158
- *         # user tags
- *         elif record.islower():
- *             for key in sorted(fields):             # <<<<<<<<<<<<<<
- *                 line.append("%s:%s" % (key, str(fields[key])))
- *         # defined tags
- */
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_v_fields);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fields);
-    __Pyx_GIVEREF(__pyx_v_fields);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
-      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-    } else {
-      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    for (;;) {
-      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_2 = __pyx_t_6(__pyx_t_1);
-        if (unlikely(!__pyx_t_2)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_2);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
-      __pyx_t_2 = 0;
-
-      /* "pysam/calignmentfile.pyx":1159
- *         elif record.islower():
- *             for key in sorted(fields):
- *                 line.append("%s:%s" % (key, str(fields[key])))             # <<<<<<<<<<<<<<
- *         # defined tags
- *         else:
- */
-      __pyx_t_2 = PyObject_GetItem(__pyx_v_fields, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_v_key);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_key);
-      __Pyx_GIVEREF(__pyx_v_key);
-      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_line, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":1163
- *         else:
- *             # write fields of the specification
- *             for key in VALID_HEADER_ORDER[record]:             # <<<<<<<<<<<<<<
- *                 if key in fields:
- *                     line.append("%s:%s" % (key, str(fields[key])))
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADER_ORDER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_record); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
-      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-    } else {
-      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    for (;;) {
-      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_2 = __pyx_t_6(__pyx_t_1);
-        if (unlikely(!__pyx_t_2)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_2);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
-      __pyx_t_2 = 0;
-
-      /* "pysam/calignmentfile.pyx":1164
- *             # write fields of the specification
- *             for key in VALID_HEADER_ORDER[record]:
- *                 if key in fields:             # <<<<<<<<<<<<<<
- *                     line.append("%s:%s" % (key, str(fields[key])))
- *             # write user fields
- */
-      __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_8 = (__pyx_t_3 != 0);
-      if (__pyx_t_8) {
-
-        /* "pysam/calignmentfile.pyx":1165
- *             for key in VALID_HEADER_ORDER[record]:
- *                 if key in fields:
- *                     line.append("%s:%s" % (key, str(fields[key])))             # <<<<<<<<<<<<<<
- *             # write user fields
- *             for key in fields:
- */
-        __pyx_t_2 = PyObject_GetItem(__pyx_v_fields, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_INCREF(__pyx_v_key);
-        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_key);
-        __Pyx_GIVEREF(__pyx_v_key);
-        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_line, __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L8;
-      }
-      __pyx_L8:;
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/calignmentfile.pyx":1167
- *                     line.append("%s:%s" % (key, str(fields[key])))
- *             # write user fields
- *             for key in fields:             # <<<<<<<<<<<<<<
- *                 if not key.isupper():
- *                     line.append("%s:%s" % (key, str(fields[key])))
- */
-    if (PyList_CheckExact(__pyx_v_fields) || PyTuple_CheckExact(__pyx_v_fields)) {
-      __pyx_t_1 = __pyx_v_fields; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-    } else {
-      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_fields); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_2 = __pyx_t_6(__pyx_t_1);
-        if (unlikely(!__pyx_t_2)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_2);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
-      __pyx_t_2 = 0;
-
-      /* "pysam/calignmentfile.pyx":1168
- *             # write user fields
- *             for key in fields:
- *                 if not key.isupper():             # <<<<<<<<<<<<<<
- *                     line.append("%s:%s" % (key, str(fields[key])))
- * 
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_isupper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_3 = ((!__pyx_t_8) != 0);
-      if (__pyx_t_3) {
-
-        /* "pysam/calignmentfile.pyx":1169
- *             for key in fields:
- *                 if not key.isupper():
- *                     line.append("%s:%s" % (key, str(fields[key])))             # <<<<<<<<<<<<<<
- * 
- *         return "\t".join(line)
- */
-        __pyx_t_7 = PyObject_GetItem(__pyx_v_fields, __pyx_v_key); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
-        __Pyx_GIVEREF(__pyx_t_7);
-        __pyx_t_7 = 0;
-        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_v_key);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
-        __Pyx_GIVEREF(__pyx_v_key);
-        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
-        __Pyx_GIVEREF(__pyx_t_7);
-        __pyx_t_7 = 0;
-        __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_line, __pyx_t_7); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L11;
-      }
-      __pyx_L11:;
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1171
- *                     line.append("%s:%s" % (key, str(fields[key])))
- * 
- *         return "\t".join(line)             # <<<<<<<<<<<<<<
- * 
- *     cdef bam_hdr_t * _buildHeader(self, new_header):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__43, __pyx_v_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1148
- *             return result
- * 
- *     def _buildLine(self, fields, record):             # <<<<<<<<<<<<<<
- *         '''build a header line from *fields* dictionary for *record*'''
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._buildLine", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_line);
-  __Pyx_XDECREF(__pyx_v_key);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1173
- *         return "\t".join(line)
- * 
- *     cdef bam_hdr_t * _buildHeader(self, new_header):             # <<<<<<<<<<<<<<
- *         '''return a new header built from a dictionary in *new_header*.
- * 
- */
-
-static bam_hdr_t *__pyx_f_5pysam_14calignmentfile_13AlignmentFile__buildHeader(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self, PyObject *__pyx_v_new_header) {
-  PyObject *__pyx_v_lines = NULL;
-  bam_hdr_t *__pyx_v_dest;
-  PyObject *__pyx_v_record = NULL;
-  PyObject *__pyx_v_ttype = NULL;
-  PyObject *__pyx_v_data = NULL;
-  PyObject *__pyx_v_fields = NULL;
-  PyObject *__pyx_v_text = NULL;
-  PyObject *__pyx_v_btext = 0;
-  PyObject *__pyx_v_bseqname = 0;
-  PyObject *__pyx_v_seqs = NULL;
-  long __pyx_v_x;
-  PyObject *__pyx_v_seqname = NULL;
-  PyObject *__pyx_v_seqlen = NULL;
-  bam_hdr_t *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  Py_ssize_t __pyx_t_3;
-  PyObject *(*__pyx_t_4)(PyObject *);
-  int __pyx_t_5;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  int __pyx_t_9;
-  Py_ssize_t __pyx_t_10;
-  PyObject *(*__pyx_t_11)(PyObject *);
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *(*__pyx_t_13)(PyObject *);
-  char const *__pyx_t_14;
-  PyObject *__pyx_t_15 = NULL;
-  PyObject *__pyx_t_16 = NULL;
-  PyObject *__pyx_t_17 = NULL;
-  int __pyx_t_18;
-  PyObject *__pyx_t_19 = NULL;
-  int32_t __pyx_t_20;
-  uint32_t __pyx_t_21;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_buildHeader", 0);
-  __Pyx_TraceCall("_buildHeader", __pyx_f[0], 1173);
-
-  /* "pysam/calignmentfile.pyx":1179
- *         '''
- * 
- *         lines = []             # <<<<<<<<<<<<<<
- * 
- *         # check if hash exists
- */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_lines = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1186
- *         cdef bam_hdr_t * dest
- * 
- *         dest = bam_hdr_init()             # <<<<<<<<<<<<<<
- * 
- *         # first: defined tags
- */
-  __pyx_v_dest = bam_hdr_init();
-
-  /* "pysam/calignmentfile.pyx":1189
- * 
- *         # first: defined tags
- *         for record in VALID_HEADERS:             # <<<<<<<<<<<<<<
- *             if record in new_header:
- *                 ttype = VALID_HEADER_TYPES[record]
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADERS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
-    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
-    __pyx_t_4 = NULL;
-  } else {
-    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  for (;;) {
-    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
-      if (unlikely(!__pyx_t_1)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_1);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_record, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/calignmentfile.pyx":1190
- *         # first: defined tags
- *         for record in VALID_HEADERS:
- *             if record in new_header:             # <<<<<<<<<<<<<<
- *                 ttype = VALID_HEADER_TYPES[record]
- *                 data = new_header[record]
- */
-    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_record, __pyx_v_new_header, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = (__pyx_t_5 != 0);
-    if (__pyx_t_6) {
-
-      /* "pysam/calignmentfile.pyx":1191
- *         for record in VALID_HEADERS:
- *             if record in new_header:
- *                 ttype = VALID_HEADER_TYPES[record]             # <<<<<<<<<<<<<<
- *                 data = new_header[record]
- *                 if type(data) != type(ttype()):
- */
-      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADER_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_v_record); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_ttype, __pyx_t_7);
-      __pyx_t_7 = 0;
-
-      /* "pysam/calignmentfile.pyx":1192
- *             if record in new_header:
- *                 ttype = VALID_HEADER_TYPES[record]
- *                 data = new_header[record]             # <<<<<<<<<<<<<<
- *                 if type(data) != type(ttype()):
- *                     raise ValueError(
- */
-      __pyx_t_7 = PyObject_GetItem(__pyx_v_new_header, __pyx_v_record); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_7);
-      __pyx_t_7 = 0;
-
-      /* "pysam/calignmentfile.pyx":1193
- *                 ttype = VALID_HEADER_TYPES[record]
- *                 data = new_header[record]
- *                 if type(data) != type(ttype()):             # <<<<<<<<<<<<<<
- *                     raise ValueError(
- *                         "invalid type for record %s: %s, expected %s" %
- */
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_ttype, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(__pyx_t_7)), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (__pyx_t_6) {
-
-        /* "pysam/calignmentfile.pyx":1196
- *                     raise ValueError(
- *                         "invalid type for record %s: %s, expected %s" %
- *                         (record, type(data), type(ttype())))             # <<<<<<<<<<<<<<
- *                 if type(data) is dict:
- *                     lines.append(self._buildLine(data, record))
- */
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_ttype, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_INCREF(__pyx_v_record);
-        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_record);
-        __Pyx_GIVEREF(__pyx_v_record);
-        __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_data)));
-        PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)Py_TYPE(__pyx_v_data)));
-        __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_data)));
-        __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_t_1)));
-        PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)Py_TYPE(__pyx_t_1)));
-        __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_t_1)));
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-        /* "pysam/calignmentfile.pyx":1195
- *                 if type(data) != type(ttype()):
- *                     raise ValueError(
- *                         "invalid type for record %s: %s, expected %s" %             # <<<<<<<<<<<<<<
- *                         (record, type(data), type(ttype())))
- *                 if type(data) is dict:
- */
-        __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_invalid_type_for_record_s_s_expe, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-        /* "pysam/calignmentfile.pyx":1194
- *                 data = new_header[record]
- *                 if type(data) != type(ttype()):
- *                     raise ValueError(             # <<<<<<<<<<<<<<
- *                         "invalid type for record %s: %s, expected %s" %
- *                         (record, type(data), type(ttype())))
- */
-        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
-        __Pyx_GIVEREF(__pyx_t_1);
-        __pyx_t_1 = 0;
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-
-      /* "pysam/calignmentfile.pyx":1197
- *                         "invalid type for record %s: %s, expected %s" %
- *                         (record, type(data), type(ttype())))
- *                 if type(data) is dict:             # <<<<<<<<<<<<<<
- *                     lines.append(self._buildLine(data, record))
- *                 else:
- */
-      __pyx_t_6 = (((PyObject *)Py_TYPE(__pyx_v_data)) == ((PyObject *)((PyObject*)(&PyDict_Type))));
-      __pyx_t_5 = (__pyx_t_6 != 0);
-      if (__pyx_t_5) {
-
-        /* "pysam/calignmentfile.pyx":1198
- *                         (record, type(data), type(ttype())))
- *                 if type(data) is dict:
- *                     lines.append(self._buildLine(data, record))             # <<<<<<<<<<<<<<
- *                 else:
- *                     for fields in new_header[record]:
- */
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buildLine); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_INCREF(__pyx_v_data);
-        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
-        __Pyx_GIVEREF(__pyx_v_data);
-        __Pyx_INCREF(__pyx_v_record);
-        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_record);
-        __Pyx_GIVEREF(__pyx_v_record);
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_lines, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        goto __pyx_L7;
-      }
-      /*else*/ {
-
-        /* "pysam/calignmentfile.pyx":1200
- *                     lines.append(self._buildLine(data, record))
- *                 else:
- *                     for fields in new_header[record]:             # <<<<<<<<<<<<<<
- *                         lines.append(self._buildLine(fields, record))
- * 
- */
-        __pyx_t_8 = PyObject_GetItem(__pyx_v_new_header, __pyx_v_record); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_8);
-        if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
-          __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
-          __pyx_t_11 = NULL;
-        } else {
-          __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext;
-        }
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        for (;;) {
-          if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_7)) {
-            if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
-            #if CYTHON_COMPILING_IN_CPYTHON
-            __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            #else
-            __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            #endif
-          } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_7)) {
-            if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
-            #if CYTHON_COMPILING_IN_CPYTHON
-            __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            #else
-            __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            #endif
-          } else {
-            __pyx_t_8 = __pyx_t_11(__pyx_t_7);
-            if (unlikely(!__pyx_t_8)) {
-              PyObject* exc_type = PyErr_Occurred();
-              if (exc_type) {
-                if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-                else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-              }
-              break;
-            }
-            __Pyx_GOTREF(__pyx_t_8);
-          }
-          __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_8);
-          __pyx_t_8 = 0;
-
-          /* "pysam/calignmentfile.pyx":1201
- *                 else:
- *                     for fields in new_header[record]:
- *                         lines.append(self._buildLine(fields, record))             # <<<<<<<<<<<<<<
- * 
- *         # then: user tags (lower case), sorted alphabetically
- */
-          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buildLine); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_8);
-          __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_1);
-          __Pyx_INCREF(__pyx_v_fields);
-          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fields);
-          __Pyx_GIVEREF(__pyx_v_fields);
-          __Pyx_INCREF(__pyx_v_record);
-          PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_record);
-          __Pyx_GIVEREF(__pyx_v_record);
-          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_lines, __pyx_t_12); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-        }
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      }
-      __pyx_L7:;
-      goto __pyx_L5;
-    }
-    __pyx_L5:;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":1204
- * 
- *         # then: user tags (lower case), sorted alphabetically
- *         for record, data in sorted(new_header.items()):             # <<<<<<<<<<<<<<
- *             if record in VALID_HEADERS: continue
- *             if type( data ) is dict:
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_header, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
-    __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
-    __pyx_t_4 = NULL;
-  } else {
-    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  for (;;) {
-    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_7 = __pyx_t_4(__pyx_t_2);
-      if (unlikely(!__pyx_t_7)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_7);
-    }
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 2)) {
-        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
-      } else {
-        __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
-      }
-      __Pyx_INCREF(__pyx_t_12);
-      __Pyx_INCREF(__pyx_t_1);
-      #else
-      __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_12);
-      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext;
-      index = 0; __pyx_t_12 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_12)) goto __pyx_L12_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_12);
-      index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_1);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_13 = NULL;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L13_unpacking_done;
-      __pyx_L12_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_13 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L13_unpacking_done:;
-    }
-    __Pyx_XDECREF_SET(__pyx_v_record, __pyx_t_12);
-    __pyx_t_12 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/calignmentfile.pyx":1205
- *         # then: user tags (lower case), sorted alphabetically
- *         for record, data in sorted(new_header.items()):
- *             if record in VALID_HEADERS: continue             # <<<<<<<<<<<<<<
- *             if type( data ) is dict:
- *                 lines.append( self._buildLine( data, record ) )
- */
-    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_VALID_HEADERS); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_record, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_6 = (__pyx_t_5 != 0);
-    if (__pyx_t_6) {
-      goto __pyx_L10_continue;
-    }
-
-    /* "pysam/calignmentfile.pyx":1206
- *         for record, data in sorted(new_header.items()):
- *             if record in VALID_HEADERS: continue
- *             if type( data ) is dict:             # <<<<<<<<<<<<<<
- *                 lines.append( self._buildLine( data, record ) )
- *             else:
- */
-    __pyx_t_6 = (((PyObject *)Py_TYPE(__pyx_v_data)) == ((PyObject *)((PyObject*)(&PyDict_Type))));
-    __pyx_t_5 = (__pyx_t_6 != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/calignmentfile.pyx":1207
- *             if record in VALID_HEADERS: continue
- *             if type( data ) is dict:
- *                 lines.append( self._buildLine( data, record ) )             # <<<<<<<<<<<<<<
- *             else:
- *                 for fields in new_header[record]:
- */
-      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buildLine); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_v_data);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
-      __Pyx_GIVEREF(__pyx_v_data);
-      __Pyx_INCREF(__pyx_v_record);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_record);
-      __Pyx_GIVEREF(__pyx_v_record);
-      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_12);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_lines, __pyx_t_12); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L15;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":1209
- *                 lines.append( self._buildLine( data, record ) )
- *             else:
- *                 for fields in new_header[record]:             # <<<<<<<<<<<<<<
- *                     lines.append( self._buildLine( fields, record ) )
- * 
- */
-      __pyx_t_12 = PyObject_GetItem(__pyx_v_new_header, __pyx_v_record); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_12);
-      if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
-        __pyx_t_1 = __pyx_t_12; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0;
-        __pyx_t_11 = NULL;
-      } else {
-        __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
-      }
-      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      for (;;) {
-        if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) {
-          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_1)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_12 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) {
-          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_12); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else {
-          __pyx_t_12 = __pyx_t_11(__pyx_t_1);
-          if (unlikely(!__pyx_t_12)) {
-            PyObject* exc_type = PyErr_Occurred();
-            if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            }
-            break;
-          }
-          __Pyx_GOTREF(__pyx_t_12);
-        }
-        __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_12);
-        __pyx_t_12 = 0;
-
-        /* "pysam/calignmentfile.pyx":1210
- *             else:
- *                 for fields in new_header[record]:
- *                     lines.append( self._buildLine( fields, record ) )             # <<<<<<<<<<<<<<
- * 
- *         text = "\n".join(lines) + "\n"
- */
-        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buildLine); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_12);
-        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_INCREF(__pyx_v_fields);
-        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_fields);
-        __Pyx_GIVEREF(__pyx_v_fields);
-        __Pyx_INCREF(__pyx_v_record);
-        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_record);
-        __Pyx_GIVEREF(__pyx_v_record);
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_lines, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      }
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    }
-    __pyx_L15:;
-    __pyx_L10_continue:;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":1212
- *                     lines.append( self._buildLine( fields, record ) )
- * 
- *         text = "\n".join(lines) + "\n"             # <<<<<<<<<<<<<<
- *         if dest.text != NULL: free( dest.text )
- *         dest.text = <char*>calloc( len(text), sizeof(char))
- */
-  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__38, __pyx_v_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__38); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_text = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1213
- * 
- *         text = "\n".join(lines) + "\n"
- *         if dest.text != NULL: free( dest.text )             # <<<<<<<<<<<<<<
- *         dest.text = <char*>calloc( len(text), sizeof(char))
- *         dest.l_text = len(text)
- */
-  __pyx_t_5 = ((__pyx_v_dest->text != NULL) != 0);
-  if (__pyx_t_5) {
-    free(__pyx_v_dest->text);
-    goto __pyx_L18;
-  }
-  __pyx_L18:;
-
-  /* "pysam/calignmentfile.pyx":1214
- *         text = "\n".join(lines) + "\n"
- *         if dest.text != NULL: free( dest.text )
- *         dest.text = <char*>calloc( len(text), sizeof(char))             # <<<<<<<<<<<<<<
- *         dest.l_text = len(text)
- *         cdef bytes btext = text.encode('ascii')
- */
-  __pyx_t_3 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_dest->text = ((char *)calloc(__pyx_t_3, (sizeof(char))));
-
-  /* "pysam/calignmentfile.pyx":1215
- *         if dest.text != NULL: free( dest.text )
- *         dest.text = <char*>calloc( len(text), sizeof(char))
- *         dest.l_text = len(text)             # <<<<<<<<<<<<<<
- *         cdef bytes btext = text.encode('ascii')
- *         strncpy( dest.text, btext, dest.l_text )
- */
-  __pyx_t_3 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_dest->l_text = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":1216
- *         dest.text = <char*>calloc( len(text), sizeof(char))
- *         dest.l_text = len(text)
- *         cdef bytes btext = text.encode('ascii')             # <<<<<<<<<<<<<<
- *         strncpy( dest.text, btext, dest.l_text )
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_btext = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":1217
- *         dest.l_text = len(text)
- *         cdef bytes btext = text.encode('ascii')
- *         strncpy( dest.text, btext, dest.l_text )             # <<<<<<<<<<<<<<
- * 
- *         cdef bytes bseqname
- */
-  __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_btext); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  strncpy(__pyx_v_dest->text, __pyx_t_14, __pyx_v_dest->l_text);
-
-  /* "pysam/calignmentfile.pyx":1221
- *         cdef bytes bseqname
- *         # collect targets
- *         if "SQ" in new_header:             # <<<<<<<<<<<<<<
- *             seqs = []
- *             for fields in new_header["SQ"]:
- */
-  __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_n_s_SQ, __pyx_v_new_header, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_6 = (__pyx_t_5 != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/calignmentfile.pyx":1222
- *         # collect targets
- *         if "SQ" in new_header:
- *             seqs = []             # <<<<<<<<<<<<<<
- *             for fields in new_header["SQ"]:
- *                 try:
- */
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_seqs = ((PyObject*)__pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/calignmentfile.pyx":1223
- *         if "SQ" in new_header:
- *             seqs = []
- *             for fields in new_header["SQ"]:             # <<<<<<<<<<<<<<
- *                 try:
- *                     seqs.append( (fields["SN"], fields["LN"] ) )
- */
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_new_header, __pyx_n_s_SQ); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
-      __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
-      __pyx_t_4 = NULL;
-    } else {
-      __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    for (;;) {
-      if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_2 = __pyx_t_4(__pyx_t_1);
-        if (unlikely(!__pyx_t_2)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_2);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_2);
-      __pyx_t_2 = 0;
-
-      /* "pysam/calignmentfile.pyx":1224
- *             seqs = []
- *             for fields in new_header["SQ"]:
- *                 try:             # <<<<<<<<<<<<<<
- *                     seqs.append( (fields["SN"], fields["LN"] ) )
- *                 except KeyError:
- */
-      {
-        __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
-        __Pyx_XGOTREF(__pyx_t_15);
-        __Pyx_XGOTREF(__pyx_t_16);
-        __Pyx_XGOTREF(__pyx_t_17);
-        /*try:*/ {
-
-          /* "pysam/calignmentfile.pyx":1225
- *             for fields in new_header["SQ"]:
- *                 try:
- *                     seqs.append( (fields["SN"], fields["LN"] ) )             # <<<<<<<<<<<<<<
- *                 except KeyError:
- *                     raise KeyError( "incomplete sequence information in '%s'" % str(fields))
- */
-          __pyx_t_2 = PyObject_GetItem(__pyx_v_fields, __pyx_n_s_SN); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L22_error;};
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_8 = PyObject_GetItem(__pyx_v_fields, __pyx_n_s_LN); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L22_error;};
-          __Pyx_GOTREF(__pyx_t_8);
-          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
-          __Pyx_GIVEREF(__pyx_t_2);
-          PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
-          __Pyx_GIVEREF(__pyx_t_8);
-          __pyx_t_2 = 0;
-          __pyx_t_8 = 0;
-          __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_seqs, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        }
-        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
-        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
-        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
-        goto __pyx_L29_try_end;
-        __pyx_L22_error:;
-        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-        /* "pysam/calignmentfile.pyx":1226
- *                 try:
- *                     seqs.append( (fields["SN"], fields["LN"] ) )
- *                 except KeyError:             # <<<<<<<<<<<<<<
- *                     raise KeyError( "incomplete sequence information in '%s'" % str(fields))
- * 
- */
-        __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
-        if (__pyx_t_18) {
-          __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile._buildHeader", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
-          __Pyx_GOTREF(__pyx_t_7);
-          __Pyx_GOTREF(__pyx_t_8);
-          __Pyx_GOTREF(__pyx_t_2);
-
-          /* "pysam/calignmentfile.pyx":1227
- *                     seqs.append( (fields["SN"], fields["LN"] ) )
- *                 except KeyError:
- *                     raise KeyError( "incomplete sequence information in '%s'" % str(fields))             # <<<<<<<<<<<<<<
- * 
- *             dest.n_targets = len(seqs)
- */
-          __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_INCREF(__pyx_v_fields);
-          PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_fields);
-          __Pyx_GIVEREF(__pyx_v_fields);
-          __pyx_t_19 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_12, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
-          __Pyx_GOTREF(__pyx_t_19);
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          __pyx_t_12 = __Pyx_PyString_Format(__pyx_kp_s_incomplete_sequence_information, __pyx_t_19); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
-          __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
-          __Pyx_GOTREF(__pyx_t_19);
-          PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_12);
-          __Pyx_GIVEREF(__pyx_t_12);
-          __pyx_t_12 = 0;
-          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_19, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
-          __Pyx_GOTREF(__pyx_t_12);
-          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
-          __Pyx_Raise(__pyx_t_12, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L23_exception_handled;
-        }
-        goto __pyx_L24_except_error;
-        __pyx_L24_except_error:;
-        __Pyx_XGIVEREF(__pyx_t_15);
-        __Pyx_XGIVEREF(__pyx_t_16);
-        __Pyx_XGIVEREF(__pyx_t_17);
-        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
-        goto __pyx_L1_error;
-        __pyx_L23_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_15);
-        __Pyx_XGIVEREF(__pyx_t_16);
-        __Pyx_XGIVEREF(__pyx_t_17);
-        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
-        __pyx_L29_try_end:;
-      }
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/calignmentfile.pyx":1229
- *                     raise KeyError( "incomplete sequence information in '%s'" % str(fields))
- * 
- *             dest.n_targets = len(seqs)             # <<<<<<<<<<<<<<
- *             dest.target_name = <char**>calloc(dest.n_targets, sizeof(char*))
- *             dest.target_len = <uint32_t*>calloc(dest.n_targets, sizeof(uint32_t))
- */
-    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_seqs); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_dest->n_targets = __pyx_t_3;
-
-    /* "pysam/calignmentfile.pyx":1230
- * 
- *             dest.n_targets = len(seqs)
- *             dest.target_name = <char**>calloc(dest.n_targets, sizeof(char*))             # <<<<<<<<<<<<<<
- *             dest.target_len = <uint32_t*>calloc(dest.n_targets, sizeof(uint32_t))
- * 
- */
-    __pyx_v_dest->target_name = ((char **)calloc(__pyx_v_dest->n_targets, (sizeof(char *))));
-
-    /* "pysam/calignmentfile.pyx":1231
- *             dest.n_targets = len(seqs)
- *             dest.target_name = <char**>calloc(dest.n_targets, sizeof(char*))
- *             dest.target_len = <uint32_t*>calloc(dest.n_targets, sizeof(uint32_t))             # <<<<<<<<<<<<<<
- * 
- *             for x from 0 <= x < dest.n_targets:
- */
-    __pyx_v_dest->target_len = ((uint32_t *)calloc(__pyx_v_dest->n_targets, (sizeof(uint32_t))));
-
-    /* "pysam/calignmentfile.pyx":1233
- *             dest.target_len = <uint32_t*>calloc(dest.n_targets, sizeof(uint32_t))
- * 
- *             for x from 0 <= x < dest.n_targets:             # <<<<<<<<<<<<<<
- *                 seqname, seqlen = seqs[x]
- *                 dest.target_name[x] = <char*>calloc(
- */
-    __pyx_t_20 = __pyx_v_dest->n_targets;
-    for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_20; __pyx_v_x++) {
-
-      /* "pysam/calignmentfile.pyx":1234
- * 
- *             for x from 0 <= x < dest.n_targets:
- *                 seqname, seqlen = seqs[x]             # <<<<<<<<<<<<<<
- *                 dest.target_name[x] = <char*>calloc(
- *                     len(seqname) + 1, sizeof(char))
- */
-      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_seqs, __pyx_v_x, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
-        PyObject* sequence = __pyx_t_1;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        Py_ssize_t size = Py_SIZE(sequence);
-        #else
-        Py_ssize_t size = PySequence_Size(sequence);
-        #endif
-        if (unlikely(size != 2)) {
-          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        #if CYTHON_COMPILING_IN_CPYTHON
-        if (likely(PyTuple_CheckExact(sequence))) {
-          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
-          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
-        } else {
-          __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
-          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
-        }
-        __Pyx_INCREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_t_8);
-        #else
-        __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        #endif
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      } else {
-        Py_ssize_t index = -1;
-        __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext;
-        index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L34_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_2);
-        index = 1; __pyx_t_8 = __pyx_t_13(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L34_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_8);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_13 = NULL;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L35_unpacking_done;
-        __pyx_L34_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_13 = NULL;
-        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L35_unpacking_done:;
-      }
-      __Pyx_XDECREF_SET(__pyx_v_seqname, __pyx_t_2);
-      __pyx_t_2 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_seqlen, __pyx_t_8);
-      __pyx_t_8 = 0;
-
-      /* "pysam/calignmentfile.pyx":1236
- *                 seqname, seqlen = seqs[x]
- *                 dest.target_name[x] = <char*>calloc(
- *                     len(seqname) + 1, sizeof(char))             # <<<<<<<<<<<<<<
- *                 bseqname = seqname.encode('ascii')
- *                 strncpy(dest.target_name[x], bseqname,
- */
-      __pyx_t_3 = PyObject_Length(__pyx_v_seqname); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-      /* "pysam/calignmentfile.pyx":1235
- *             for x from 0 <= x < dest.n_targets:
- *                 seqname, seqlen = seqs[x]
- *                 dest.target_name[x] = <char*>calloc(             # <<<<<<<<<<<<<<
- *                     len(seqname) + 1, sizeof(char))
- *                 bseqname = seqname.encode('ascii')
- */
-      (__pyx_v_dest->target_name[__pyx_v_x]) = ((char *)calloc((__pyx_t_3 + 1), (sizeof(char))));
-
-      /* "pysam/calignmentfile.pyx":1237
- *                 dest.target_name[x] = <char*>calloc(
- *                     len(seqname) + 1, sizeof(char))
- *                 bseqname = seqname.encode('ascii')             # <<<<<<<<<<<<<<
- *                 strncpy(dest.target_name[x], bseqname,
- *                         len(seqname) + 1)
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_seqname, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (!(likely(PyBytes_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_XDECREF_SET(__pyx_v_bseqname, ((PyObject*)__pyx_t_8));
-      __pyx_t_8 = 0;
-
-      /* "pysam/calignmentfile.pyx":1238
- *                     len(seqname) + 1, sizeof(char))
- *                 bseqname = seqname.encode('ascii')
- *                 strncpy(dest.target_name[x], bseqname,             # <<<<<<<<<<<<<<
- *                         len(seqname) + 1)
- *                 dest.target_len[x] = seqlen
- */
-      __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_bseqname); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-      /* "pysam/calignmentfile.pyx":1239
- *                 bseqname = seqname.encode('ascii')
- *                 strncpy(dest.target_name[x], bseqname,
- *                         len(seqname) + 1)             # <<<<<<<<<<<<<<
- *                 dest.target_len[x] = seqlen
- * 
- */
-      __pyx_t_3 = PyObject_Length(__pyx_v_seqname); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-      /* "pysam/calignmentfile.pyx":1238
- *                     len(seqname) + 1, sizeof(char))
- *                 bseqname = seqname.encode('ascii')
- *                 strncpy(dest.target_name[x], bseqname,             # <<<<<<<<<<<<<<
- *                         len(seqname) + 1)
- *                 dest.target_len[x] = seqlen
- */
-      strncpy((__pyx_v_dest->target_name[__pyx_v_x]), __pyx_t_14, (__pyx_t_3 + 1));
-
-      /* "pysam/calignmentfile.pyx":1240
- *                 strncpy(dest.target_name[x], bseqname,
- *                         len(seqname) + 1)
- *                 dest.target_len[x] = seqlen             # <<<<<<<<<<<<<<
- * 
- *         return dest
- */
-      __pyx_t_21 = __Pyx_PyInt_As_uint32_t(__pyx_v_seqlen); if (unlikely((__pyx_t_21 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      (__pyx_v_dest->target_len[__pyx_v_x]) = __pyx_t_21;
-    }
-    goto __pyx_L19;
-  }
-  __pyx_L19:;
-
-  /* "pysam/calignmentfile.pyx":1242
- *                 dest.target_len[x] = seqlen
- * 
- *         return dest             # <<<<<<<<<<<<<<
- * 
- *     ###############################################################
- */
-  __pyx_r = __pyx_v_dest;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1173
- *         return "\t".join(line)
- * 
- *     cdef bam_hdr_t * _buildHeader(self, new_header):             # <<<<<<<<<<<<<<
- *         '''return a new header built from a dictionary in *new_header*.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_XDECREF(__pyx_t_19);
-  __Pyx_WriteUnraisable("pysam.calignmentfile.AlignmentFile._buildHeader", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_lines);
-  __Pyx_XDECREF(__pyx_v_record);
-  __Pyx_XDECREF(__pyx_v_ttype);
-  __Pyx_XDECREF(__pyx_v_data);
-  __Pyx_XDECREF(__pyx_v_fields);
-  __Pyx_XDECREF(__pyx_v_text);
-  __Pyx_XDECREF(__pyx_v_btext);
-  __Pyx_XDECREF(__pyx_v_bseqname);
-  __Pyx_XDECREF(__pyx_v_seqs);
-  __Pyx_XDECREF(__pyx_v_seqname);
-  __Pyx_XDECREF(__pyx_v_seqlen);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1252
- *     ## Possible solutions: deprecate or open new file handle
- *     ###############################################################
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_45__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_45__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_44__iter__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_44__iter__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-  __Pyx_TraceCall("__iter__", __pyx_f[0], 1252);
-
-  /* "pysam/calignmentfile.pyx":1253
- *     ###############################################################
- *     def __iter__(self):
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError( "I/O operation on closed file" )
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1254
- *     def __iter__(self):
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         if not self.isbam and self.header.n_targets == 0:
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1256
- *             raise ValueError( "I/O operation on closed file" )
- * 
- *         if not self.isbam and self.header.n_targets == 0:             # <<<<<<<<<<<<<<
- *             raise NotImplementedError(
- *                 "can not iterate over samfile without header")
- */
-  __pyx_t_4 = ((!(__pyx_v_self->isbam != 0)) != 0);
-  if (__pyx_t_4) {
-    __pyx_t_3 = ((__pyx_v_self->header->n_targets == 0) != 0);
-    __pyx_t_5 = __pyx_t_3;
-  } else {
-    __pyx_t_5 = __pyx_t_4;
-  }
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":1257
- * 
- *         if not self.isbam and self.header.n_targets == 0:
- *             raise NotImplementedError(             # <<<<<<<<<<<<<<
- *                 "can not iterate over samfile without header")
- *         return self
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1259
- *             raise NotImplementedError(
- *                 "can not iterate over samfile without header")
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef bam1_t * getCurrent( self ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1252
- *     ## Possible solutions: deprecate or open new file handle
- *     ###############################################################
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1261
- *         return self
- * 
- *     cdef bam1_t * getCurrent( self ):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-static bam1_t *__pyx_f_5pysam_14calignmentfile_13AlignmentFile_getCurrent(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  bam1_t *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("getCurrent", 0);
-  __Pyx_TraceCall("getCurrent", __pyx_f[0], 1261);
-
-  /* "pysam/calignmentfile.pyx":1262
- * 
- *     cdef bam1_t * getCurrent( self ):
- *         return self.b             # <<<<<<<<<<<<<<
- * 
- *     cdef int cnext(self):
- */
-  __pyx_r = __pyx_v_self->b;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1261
- *         return self
- * 
- *     cdef bam1_t * getCurrent( self ):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1264
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''
- *         cversion of iterator. Used by :class:`pysam.AlignmentFile.IteratorColumn`.
- */
-
-static int __pyx_f_5pysam_14calignmentfile_13AlignmentFile_cnext(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("cnext", 0);
-  __Pyx_TraceCall("cnext", __pyx_f[0], 1264);
-
-  /* "pysam/calignmentfile.pyx":1268
- *         cversion of iterator. Used by :class:`pysam.AlignmentFile.IteratorColumn`.
- *         '''
- *         return sam_read1(self.htsfile,             # <<<<<<<<<<<<<<
- *                          self.header,
- *                          self.b)
- */
-  __pyx_r = sam_read1(__pyx_v_self->htsfile, __pyx_v_self->header, __pyx_v_self->b);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1264
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''
- *         cversion of iterator. Used by :class:`pysam.AlignmentFile.IteratorColumn`.
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1272
- *                          self.b)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """
- *         python version of next().
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_47__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_46__next__[] = "\n        python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_13AlignmentFile_46__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_47__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_13AlignmentFile_46__next__(((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_13AlignmentFile_46__next__(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_self) {
-  int __pyx_v_ret;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 1272);
-
-  /* "pysam/calignmentfile.pyx":1276
- *         python version of next().
- *         """
- *         cdef int ret = self.cnext()             # <<<<<<<<<<<<<<
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)
- */
-  __pyx_v_ret = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *)__pyx_v_self->__pyx_vtab)->cnext(__pyx_v_self);
-
-  /* "pysam/calignmentfile.pyx":1277
- *         """
- *         cdef int ret = self.cnext()
- *         if (ret >= 0):             # <<<<<<<<<<<<<<
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- */
-  __pyx_t_1 = ((__pyx_v_ret >= 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1278
- *         cdef int ret = self.cnext()
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)             # <<<<<<<<<<<<<<
- *         elif (ret == -2):
- *             raise IOError('truncated file')
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_makeAlignedSegment(__pyx_v_self->b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":1279
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):             # <<<<<<<<<<<<<<
- *             raise IOError('truncated file')
- *         else:
- */
-  __pyx_t_1 = ((__pyx_v_ret == -2) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1280
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- *             raise IOError('truncated file')             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":1282
- *             raise IOError('truncated file')
- *         else:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- * ##-------------------------------------------------------------------
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1272
- *                          self.b)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """
- *         python version of next().
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignmentFile.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1310
- *     '''
- * 
- *     def __init__(self, AlignmentFile samfile, int multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         if not samfile._isOpen():
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_11IteratorRow_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_11IteratorRow_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  int __pyx_v_multiple_iterators;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,&__pyx_n_s_multiple_iterators,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __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_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-    if (values[1]) {
-      __pyx_v_multiple_iterators = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_multiple_iterators == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_multiple_iterators = ((int)0);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRow.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_11IteratorRow___init__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *)__pyx_v_self), __pyx_v_samfile, __pyx_v_multiple_iterators);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_11IteratorRow___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_multiple_iterators) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  char const *__pyx_t_5;
-  htsFile *__pyx_t_6;
-  bam_hdr_t *__pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 1310);
-
-  /* "pysam/calignmentfile.pyx":1312
- *     def __init__(self, AlignmentFile samfile, int multiple_iterators=False):
- * 
- *         if not samfile._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file")
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_samfile), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1313
- * 
- *         if not samfile._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- * 
- *         # makes sure that samfile stays alive as long as the
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1317
- *         # makes sure that samfile stays alive as long as the
- *         # iterator is alive
- *         self.samfile = samfile             # <<<<<<<<<<<<<<
- * 
- *         # reopen the file - note that this makes the iterator
- */
-  __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
-  __Pyx_GOTREF(__pyx_v_self->samfile);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->samfile));
-  __pyx_v_self->samfile = __pyx_v_samfile;
-
-  /* "pysam/calignmentfile.pyx":1321
- *         # reopen the file - note that this makes the iterator
- *         # slow and causes pileup to slow down significantly.
- *         if multiple_iterators:             # <<<<<<<<<<<<<<
- *             self.htsfile = hts_open(samfile._filename, 'r')
- *             assert self.htsfile != NULL
- */
-  __pyx_t_4 = (__pyx_v_multiple_iterators != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":1322
- *         # slow and causes pileup to slow down significantly.
- *         if multiple_iterators:
- *             self.htsfile = hts_open(samfile._filename, 'r')             # <<<<<<<<<<<<<<
- *             assert self.htsfile != NULL
- *             # read header - required for accurate positioning
- */
-    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_samfile->_filename); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_self->htsfile = hts_open(__pyx_t_5, __pyx_k_r);
-
-    /* "pysam/calignmentfile.pyx":1323
- *         if multiple_iterators:
- *             self.htsfile = hts_open(samfile._filename, 'r')
- *             assert self.htsfile != NULL             # <<<<<<<<<<<<<<
- *             # read header - required for accurate positioning
- *             # could a tell/seek work?
- */
-    #ifndef CYTHON_WITHOUT_ASSERTIONS
-    if (unlikely(!Py_OptimizeFlag)) {
-      if (unlikely(!((__pyx_v_self->htsfile != NULL) != 0))) {
-        PyErr_SetNone(PyExc_AssertionError);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-    }
-    #endif
-
-    /* "pysam/calignmentfile.pyx":1326
- *             # read header - required for accurate positioning
- *             # could a tell/seek work?
- *             self.header = sam_hdr_read(self.htsfile)             # <<<<<<<<<<<<<<
- *             assert self.header != NULL
- *             self.owns_samfile = True
- */
-    __pyx_v_self->header = sam_hdr_read(__pyx_v_self->htsfile);
-
-    /* "pysam/calignmentfile.pyx":1327
- *             # could a tell/seek work?
- *             self.header = sam_hdr_read(self.htsfile)
- *             assert self.header != NULL             # <<<<<<<<<<<<<<
- *             self.owns_samfile = True
- *         else:
- */
-    #ifndef CYTHON_WITHOUT_ASSERTIONS
-    if (unlikely(!Py_OptimizeFlag)) {
-      if (unlikely(!((__pyx_v_self->header != NULL) != 0))) {
-        PyErr_SetNone(PyExc_AssertionError);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-    }
-    #endif
-
-    /* "pysam/calignmentfile.pyx":1328
- *             self.header = sam_hdr_read(self.htsfile)
- *             assert self.header != NULL
- *             self.owns_samfile = True             # <<<<<<<<<<<<<<
- *         else:
- *             self.htsfile = self.samfile.htsfile
- */
-    __pyx_v_self->owns_samfile = 1;
-    goto __pyx_L4;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":1330
- *             self.owns_samfile = True
- *         else:
- *             self.htsfile = self.samfile.htsfile             # <<<<<<<<<<<<<<
- *             self.owns_samfile = False
- *             self.header = self.samfile.header
- */
-    __pyx_t_6 = __pyx_v_self->samfile->htsfile;
-    __pyx_v_self->htsfile = __pyx_t_6;
-
-    /* "pysam/calignmentfile.pyx":1331
- *         else:
- *             self.htsfile = self.samfile.htsfile
- *             self.owns_samfile = False             # <<<<<<<<<<<<<<
- *             self.header = self.samfile.header
- * 
- */
-    __pyx_v_self->owns_samfile = 0;
-
-    /* "pysam/calignmentfile.pyx":1332
- *             self.htsfile = self.samfile.htsfile
- *             self.owns_samfile = False
- *             self.header = self.samfile.header             # <<<<<<<<<<<<<<
- * 
- *         self.retval = 0
- */
-    __pyx_t_7 = __pyx_v_self->samfile->header;
-    __pyx_v_self->header = __pyx_t_7;
-  }
-  __pyx_L4:;
-
-  /* "pysam/calignmentfile.pyx":1334
- *             self.header = self.samfile.header
- * 
- *         self.retval = 0             # <<<<<<<<<<<<<<
- * 
- *         self.b = bam_init1()
- */
-  __pyx_v_self->retval = 0;
-
-  /* "pysam/calignmentfile.pyx":1336
- *         self.retval = 0
- * 
- *         self.b = bam_init1()             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-  __pyx_v_self->b = bam_init1();
-
-  /* "pysam/calignmentfile.pyx":1310
- *     '''
- * 
- *     def __init__(self, AlignmentFile samfile, int multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         if not samfile._isOpen():
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRow.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1338
- *         self.b = bam_init1()
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         bam_destroy1(self.b)
- *         if self.owns_samfile:
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_14calignmentfile_11IteratorRow_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_14calignmentfile_11IteratorRow_3__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_14calignmentfile_11IteratorRow_2__dealloc__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_14calignmentfile_11IteratorRow_2__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1338);
-
-  /* "pysam/calignmentfile.pyx":1339
- * 
- *     def __dealloc__(self):
- *         bam_destroy1(self.b)             # <<<<<<<<<<<<<<
- *         if self.owns_samfile:
- *             hts_close(self.htsfile)
- */
-  bam_destroy1(__pyx_v_self->b);
-
-  /* "pysam/calignmentfile.pyx":1340
- *     def __dealloc__(self):
- *         bam_destroy1(self.b)
- *         if self.owns_samfile:             # <<<<<<<<<<<<<<
- *             hts_close(self.htsfile)
- *             bam_hdr_destroy(self.header)
- */
-  __pyx_t_1 = (__pyx_v_self->owns_samfile != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1341
- *         bam_destroy1(self.b)
- *         if self.owns_samfile:
- *             hts_close(self.htsfile)             # <<<<<<<<<<<<<<
- *             bam_hdr_destroy(self.header)
- * 
- */
-    hts_close(__pyx_v_self->htsfile);
-
-    /* "pysam/calignmentfile.pyx":1342
- *         if self.owns_samfile:
- *             hts_close(self.htsfile)
- *             bam_hdr_destroy(self.header)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    bam_hdr_destroy(__pyx_v_self->header);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1338
- *         self.b = bam_init1()
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         bam_destroy1(self.b)
- *         if self.owns_samfile:
- */
-
-  /* function exit code */
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/calignmentfile.pyx":1357
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile,             # <<<<<<<<<<<<<<
- *                  int tid, int beg, int end,
- *                  int multiple_iterators=False):
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  int __pyx_v_tid;
-  int __pyx_v_beg;
-  int __pyx_v_end;
-  int __pyx_v_multiple_iterators;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,&__pyx_n_s_tid,&__pyx_n_s_beg,&__pyx_n_s_end,&__pyx_n_s_multiple_iterators,0};
-    PyObject* values[5] = {0,0,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  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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tid)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_beg)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[4] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-    __pyx_v_tid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_beg = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_beg == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_end = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    if (values[4]) {
-      __pyx_v_multiple_iterators = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_multiple_iterators == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-
-      /* "pysam/calignmentfile.pyx":1359
- *     def __init__(self, AlignmentFile samfile,
- *                  int tid, int beg, int end,
- *                  int multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- */
-      __pyx_v_multiple_iterators = ((int)0);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowRegion.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion___init__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_v_self), __pyx_v_samfile, __pyx_v_tid, __pyx_v_beg, __pyx_v_end, __pyx_v_multiple_iterators);
-
-  /* "pysam/calignmentfile.pyx":1357
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile,             # <<<<<<<<<<<<<<
- *                  int tid, int beg, int end,
- *                  int multiple_iterators=False):
- */
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_tid, int __pyx_v_beg, int __pyx_v_end, int __pyx_v_multiple_iterators) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 1357);
-
-  /* "pysam/calignmentfile.pyx":1361
- *                  int multiple_iterators=False):
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- * 
- *         if not samfile._hasIndex():
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRow)), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __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 = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_multiple_iterators); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_multiple_iterators, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":1363
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- * 
- *         if not samfile._hasIndex():             # <<<<<<<<<<<<<<
- *             raise ValueError( "no index available for iteration" )
- * 
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_samfile), __pyx_n_s_hasIndex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_6 = ((!__pyx_t_5) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/calignmentfile.pyx":1364
- * 
- *         if not samfile._hasIndex():
- *             raise ValueError( "no index available for iteration" )             # <<<<<<<<<<<<<<
- * 
- *         self.iter = sam_itr_queryi(
- */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1366
- *             raise ValueError( "no index available for iteration" )
- * 
- *         self.iter = sam_itr_queryi(             # <<<<<<<<<<<<<<
- *             self.samfile.index,
- *             tid,
- */
-  __pyx_v_self->iter = sam_itr_queryi(__pyx_v_self->__pyx_base.samfile->index, __pyx_v_tid, __pyx_v_beg, __pyx_v_end);
-
-  /* "pysam/calignmentfile.pyx":1357
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile,             # <<<<<<<<<<<<<<
- *                  int tid, int beg, int end,
- *                  int multiple_iterators=False):
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowRegion.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1372
- *             end)
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_3__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_3__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_2__iter__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-  __Pyx_TraceCall("__iter__", __pyx_f[0], 1372);
-
-  /* "pysam/calignmentfile.pyx":1373
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef bam1_t * getCurrent(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1372
- *             end)
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1375
- *         return self
- * 
- *     cdef bam1_t * getCurrent(self):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-static bam1_t *__pyx_f_5pysam_14calignmentfile_17IteratorRowRegion_getCurrent(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self) {
-  bam1_t *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("getCurrent", 0);
-  __Pyx_TraceCall("getCurrent", __pyx_f[0], 1375);
-
-  /* "pysam/calignmentfile.pyx":1376
- * 
- *     cdef bam1_t * getCurrent(self):
- *         return self.b             # <<<<<<<<<<<<<<
- * 
- *     cdef int cnext(self):
- */
-  __pyx_r = __pyx_v_self->__pyx_base.b;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1375
- *         return self
- * 
- *     cdef bam1_t * getCurrent(self):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1378
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         self.retval = hts_itr_next(self.htsfile.fp.bgzf,
- */
-
-static int __pyx_f_5pysam_14calignmentfile_17IteratorRowRegion_cnext(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("cnext", 0);
-  __Pyx_TraceCall("cnext", __pyx_f[0], 1378);
-
-  /* "pysam/calignmentfile.pyx":1380
- *     cdef int cnext(self):
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         self.retval = hts_itr_next(self.htsfile.fp.bgzf,             # <<<<<<<<<<<<<<
- *                                    self.iter,
- *                                    self.b,
- */
-  __pyx_v_self->__pyx_base.retval = hts_itr_next(__pyx_v_self->__pyx_base.htsfile->fp.bgzf, __pyx_v_self->iter, __pyx_v_self->__pyx_base.b, NULL);
-
-  /* "pysam/calignmentfile.pyx":1378
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         self.retval = hts_itr_next(self.htsfile.fp.bgzf,
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1385
- *                                    NULL)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_5__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_17IteratorRowRegion_4__next__[] = "python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_17IteratorRowRegion_4__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_5__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_4__next__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_4__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 1385);
-
-  /* "pysam/calignmentfile.pyx":1388
- *         """python version of next().
- *         """
- *         self.cnext()             # <<<<<<<<<<<<<<
- *         if self.retval < 0:
- *             raise StopIteration
- */
-  ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_v_self->__pyx_vtab)->cnext(__pyx_v_self);
-
-  /* "pysam/calignmentfile.pyx":1389
- *         """
- *         self.cnext()
- *         if self.retval < 0:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- *         return makeAlignedSegment(self.b)
- */
-  __pyx_t_1 = ((__pyx_v_self->__pyx_base.retval < 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1390
- *         self.cnext()
- *         if self.retval < 0:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- *         return makeAlignedSegment(self.b)
- * 
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1391
- *         if self.retval < 0:
- *             raise StopIteration
- *         return makeAlignedSegment(self.b)             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_makeAlignedSegment(__pyx_v_self->__pyx_base.b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1385
- *                                    NULL)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowRegion.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1393
- *         return makeAlignedSegment(self.b)
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         hts_itr_destroy(self.iter)
- * 
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_7__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_6__dealloc__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_14calignmentfile_17IteratorRowRegion_6__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1393);
-
-  /* "pysam/calignmentfile.pyx":1394
- * 
- *     def __dealloc__(self):
- *         hts_itr_destroy(self.iter)             # <<<<<<<<<<<<<<
- * 
- * cdef class IteratorRowHead(IteratorRow):
- */
-  hts_itr_destroy(__pyx_v_self->iter);
-
-  /* "pysam/calignmentfile.pyx":1393
- *         return makeAlignedSegment(self.b)
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         hts_itr_destroy(self.iter)
- * 
- */
-
-  /* function exit code */
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/calignmentfile.pyx":1408
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, int n, int multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  int __pyx_v_n;
-  int __pyx_v_multiple_iterators;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,&__pyx_n_s_n,&__pyx_n_s_multiple_iterators,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-    __pyx_v_n = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    if (values[2]) {
-      __pyx_v_multiple_iterators = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_multiple_iterators == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_multiple_iterators = ((int)0);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowHead.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_15IteratorRowHead___init__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *)__pyx_v_self), __pyx_v_samfile, __pyx_v_n, __pyx_v_multiple_iterators);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_15IteratorRowHead___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_n, int __pyx_v_multiple_iterators) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 1408);
-
-  /* "pysam/calignmentfile.pyx":1410
- *     def __init__(self, AlignmentFile samfile, int n, int multiple_iterators=False):
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- * 
- *         self.max_rows = n
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRow)), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __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 = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_multiple_iterators); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_multiple_iterators, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":1412
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- * 
- *         self.max_rows = n             # <<<<<<<<<<<<<<
- *         self.current_row = 0
- * 
- */
-  __pyx_v_self->max_rows = __pyx_v_n;
-
-  /* "pysam/calignmentfile.pyx":1413
- * 
- *         self.max_rows = n
- *         self.current_row = 0             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __pyx_v_self->current_row = 0;
-
-  /* "pysam/calignmentfile.pyx":1408
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, int n, int multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowHead.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1415
- *         self.current_row = 0
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_3__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_3__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_15IteratorRowHead_2__iter__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_15IteratorRowHead_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-  __Pyx_TraceCall("__iter__", __pyx_f[0], 1415);
-
-  /* "pysam/calignmentfile.pyx":1416
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef bam1_t * getCurrent( self ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1415
- *         self.current_row = 0
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1418
- *         return self
- * 
- *     cdef bam1_t * getCurrent( self ):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-static bam1_t *__pyx_f_5pysam_14calignmentfile_15IteratorRowHead_getCurrent(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *__pyx_v_self) {
-  bam1_t *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("getCurrent", 0);
-  __Pyx_TraceCall("getCurrent", __pyx_f[0], 1418);
-
-  /* "pysam/calignmentfile.pyx":1419
- * 
- *     cdef bam1_t * getCurrent( self ):
- *         return self.b             # <<<<<<<<<<<<<<
- * 
- *     cdef int cnext(self):
- */
-  __pyx_r = __pyx_v_self->__pyx_base.b;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1418
- *         return self
- * 
- *     cdef bam1_t * getCurrent( self ):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1421
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         return sam_read1(self.htsfile,
- */
-
-static int __pyx_f_5pysam_14calignmentfile_15IteratorRowHead_cnext(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("cnext", 0);
-  __Pyx_TraceCall("cnext", __pyx_f[0], 1421);
-
-  /* "pysam/calignmentfile.pyx":1423
- *     cdef int cnext(self):
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         return sam_read1(self.htsfile,             # <<<<<<<<<<<<<<
- *                          self.samfile.header,
- *                          self.b)
- */
-  __pyx_r = sam_read1(__pyx_v_self->__pyx_base.htsfile, __pyx_v_self->__pyx_base.samfile->header, __pyx_v_self->__pyx_base.b);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1421
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         return sam_read1(self.htsfile,
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1427
- *                          self.b)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_5__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_15IteratorRowHead_4__next__[] = "python version of next().\n\n        pyrex uses this non-standard name instead of next()\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_15IteratorRowHead_4__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_5__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_15IteratorRowHead_4__next__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_15IteratorRowHead_4__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *__pyx_v_self) {
-  int __pyx_v_ret;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 1427);
-
-  /* "pysam/calignmentfile.pyx":1432
- *         pyrex uses this non-standard name instead of next()
- *         """
- *         if self.current_row >= self.max_rows:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- * 
- */
-  __pyx_t_1 = ((__pyx_v_self->current_row >= __pyx_v_self->max_rows) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1433
- *         """
- *         if self.current_row >= self.max_rows:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *         cdef int ret = self.cnext()
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1435
- *             raise StopIteration
- * 
- *         cdef int ret = self.cnext()             # <<<<<<<<<<<<<<
- *         if (ret >= 0):
- *             self.current_row += 1
- */
-  __pyx_v_ret = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead *)__pyx_v_self->__pyx_vtab)->cnext(__pyx_v_self);
-
-  /* "pysam/calignmentfile.pyx":1436
- * 
- *         cdef int ret = self.cnext()
- *         if (ret >= 0):             # <<<<<<<<<<<<<<
- *             self.current_row += 1
- *             return makeAlignedSegment( self.b )
- */
-  __pyx_t_1 = ((__pyx_v_ret >= 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1437
- *         cdef int ret = self.cnext()
- *         if (ret >= 0):
- *             self.current_row += 1             # <<<<<<<<<<<<<<
- *             return makeAlignedSegment( self.b )
- *         elif (ret == -2):
- */
-    __pyx_v_self->current_row = (__pyx_v_self->current_row + 1);
-
-    /* "pysam/calignmentfile.pyx":1438
- *         if (ret >= 0):
- *             self.current_row += 1
- *             return makeAlignedSegment( self.b )             # <<<<<<<<<<<<<<
- *         elif (ret == -2):
- *             raise IOError('truncated file')
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_makeAlignedSegment(__pyx_v_self->__pyx_base.b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":1439
- *             self.current_row += 1
- *             return makeAlignedSegment( self.b )
- *         elif (ret == -2):             # <<<<<<<<<<<<<<
- *             raise IOError('truncated file')
- *         else:
- */
-  __pyx_t_1 = ((__pyx_v_ret == -2) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1440
- *             return makeAlignedSegment( self.b )
- *         elif (ret == -2):
- *             raise IOError('truncated file')             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":1442
- *             raise IOError('truncated file')
- *         else:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1427
- *                          self.b)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowHead.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1457
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, int multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  int __pyx_v_multiple_iterators;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,&__pyx_n_s_multiple_iterators,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __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_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-    if (values[1]) {
-      __pyx_v_multiple_iterators = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_multiple_iterators == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_multiple_iterators = ((int)0);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowAll.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14IteratorRowAll___init__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *)__pyx_v_self), __pyx_v_samfile, __pyx_v_multiple_iterators);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14IteratorRowAll___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_multiple_iterators) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 1457);
-
-  /* "pysam/calignmentfile.pyx":1459
- *     def __init__(self, AlignmentFile samfile, int multiple_iterators=False):
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRow)), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __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 = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_multiple_iterators); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_multiple_iterators, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":1457
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, int multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowAll.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1461
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_3__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_3__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14IteratorRowAll_2__iter__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorRowAll_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-  __Pyx_TraceCall("__iter__", __pyx_f[0], 1461);
-
-  /* "pysam/calignmentfile.pyx":1462
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef bam1_t * getCurrent( self ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1461
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1464
- *         return self
- * 
- *     cdef bam1_t * getCurrent( self ):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-static bam1_t *__pyx_f_5pysam_14calignmentfile_14IteratorRowAll_getCurrent(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *__pyx_v_self) {
-  bam1_t *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("getCurrent", 0);
-  __Pyx_TraceCall("getCurrent", __pyx_f[0], 1464);
-
-  /* "pysam/calignmentfile.pyx":1465
- * 
- *     cdef bam1_t * getCurrent( self ):
- *         return self.b             # <<<<<<<<<<<<<<
- * 
- *     cdef int cnext(self):
- */
-  __pyx_r = __pyx_v_self->__pyx_base.b;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1464
- *         return self
- * 
- *     cdef bam1_t * getCurrent( self ):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1467
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         return sam_read1(self.htsfile,
- */
-
-static int __pyx_f_5pysam_14calignmentfile_14IteratorRowAll_cnext(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("cnext", 0);
-  __Pyx_TraceCall("cnext", __pyx_f[0], 1467);
-
-  /* "pysam/calignmentfile.pyx":1469
- *     cdef int cnext(self):
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         return sam_read1(self.htsfile,             # <<<<<<<<<<<<<<
- *                          self.samfile.header,
- *                          self.b)
- */
-  __pyx_r = sam_read1(__pyx_v_self->__pyx_base.htsfile, __pyx_v_self->__pyx_base.samfile->header, __pyx_v_self->__pyx_base.b);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1467
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''cversion of iterator. Used by IteratorColumn'''
- *         return sam_read1(self.htsfile,
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1473
- *                          self.b)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_5__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14IteratorRowAll_4__next__[] = "python version of next().\n\n        pyrex uses this non-standard name instead of next()\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_14IteratorRowAll_4__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_5__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14IteratorRowAll_4__next__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorRowAll_4__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *__pyx_v_self) {
-  int __pyx_v_ret;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 1473);
-
-  /* "pysam/calignmentfile.pyx":1478
- *         pyrex uses this non-standard name instead of next()
- *         """
- *         cdef int ret = self.cnext()             # <<<<<<<<<<<<<<
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)
- */
-  __pyx_v_ret = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll *)__pyx_v_self->__pyx_vtab)->cnext(__pyx_v_self);
-
-  /* "pysam/calignmentfile.pyx":1479
- *         """
- *         cdef int ret = self.cnext()
- *         if (ret >= 0):             # <<<<<<<<<<<<<<
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- */
-  __pyx_t_1 = ((__pyx_v_ret >= 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1480
- *         cdef int ret = self.cnext()
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)             # <<<<<<<<<<<<<<
- *         elif (ret == -2):
- *             raise IOError('truncated file')
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_makeAlignedSegment(__pyx_v_self->__pyx_base.b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":1481
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):             # <<<<<<<<<<<<<<
- *             raise IOError('truncated file')
- *         else:
- */
-  __pyx_t_1 = ((__pyx_v_ret == -2) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1482
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- *             raise IOError('truncated file')             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":1484
- *             raise IOError('truncated file')
- *         else:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1473
- *                          self.b)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowAll.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1495
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile,
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  PyObject *__pyx_v_multiple_iterators = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,&__pyx_n_s_multiple_iterators,0};
-    PyObject* values[2] = {0,0};
-    values[1] = ((PyObject *)Py_False);
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __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_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-    __pyx_v_multiple_iterators = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowAllRefs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs___init__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *)__pyx_v_self), __pyx_v_samfile, __pyx_v_multiple_iterators);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, PyObject *__pyx_v_multiple_iterators) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 1495);
-
-  /* "pysam/calignmentfile.pyx":1497
- *     def __init__(self, AlignmentFile samfile, multiple_iterators=False):
- * 
- *         IteratorRow.__init__(self, samfile,             # <<<<<<<<<<<<<<
- *                              multiple_iterators=multiple_iterators)
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRow)), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __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 = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-
-  /* "pysam/calignmentfile.pyx":1498
- * 
- *         IteratorRow.__init__(self, samfile,
- *                              multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- * 
- *         if not samfile._hasIndex():
- */
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_multiple_iterators, __pyx_v_multiple_iterators) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":1497
- *     def __init__(self, AlignmentFile samfile, multiple_iterators=False):
- * 
- *         IteratorRow.__init__(self, samfile,             # <<<<<<<<<<<<<<
- *                              multiple_iterators=multiple_iterators)
- * 
- */
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":1500
- *                              multiple_iterators=multiple_iterators)
- * 
- *         if not samfile._hasIndex():             # <<<<<<<<<<<<<<
- *             raise ValueError("no index available for fetch")
- * 
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_samfile), __pyx_n_s_hasIndex); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_6 = ((!__pyx_t_5) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/calignmentfile.pyx":1501
- * 
- *         if not samfile._hasIndex():
- *             raise ValueError("no index available for fetch")             # <<<<<<<<<<<<<<
- * 
- *         self.tid = -1
- */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1503
- *             raise ValueError("no index available for fetch")
- * 
- *         self.tid = -1             # <<<<<<<<<<<<<<
- * 
- *     def nextiter(self):
- */
-  __pyx_v_self->tid = -1;
-
-  /* "pysam/calignmentfile.pyx":1495
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, multiple_iterators=False):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile,
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowAllRefs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1505
- *         self.tid = -1
- * 
- *     def nextiter(self):             # <<<<<<<<<<<<<<
- *         # get a new iterator for a chromosome. The file
- *         # will not be re-opened.
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_3nextiter(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_18IteratorRowAllRefs_2nextiter[] = "IteratorRowAllRefs.nextiter(self)";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_3nextiter(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("nextiter (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_2nextiter(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_2nextiter(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  htsFile *__pyx_t_3;
-  bam_hdr_t *__pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("nextiter", 0);
-  __Pyx_TraceCall("nextiter", __pyx_f[0], 1505);
-
-  /* "pysam/calignmentfile.pyx":1509
- *         # will not be re-opened.
- *         self.rowiter = IteratorRowRegion(self.samfile,
- *                                          self.tid,             # <<<<<<<<<<<<<<
- *                                          0,
- *                                          1<<29)
- */
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/calignmentfile.pyx":1508
- *         # get a new iterator for a chromosome. The file
- *         # will not be re-opened.
- *         self.rowiter = IteratorRowRegion(self.samfile,             # <<<<<<<<<<<<<<
- *                                          self.tid,
- *                                          0,
- */
-  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.samfile));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->__pyx_base.samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.samfile));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __Pyx_INCREF(__pyx_int_536870912);
-  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_int_536870912);
-  __Pyx_GIVEREF(__pyx_int_536870912);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_GOTREF(__pyx_v_self->rowiter);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->rowiter));
-  __pyx_v_self->rowiter = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1514
- *         # set htsfile and header of the rowiter
- *         # to the values in this iterator to reflect multiple_iterators
- *         self.rowiter.htsfile = self.htsfile             # <<<<<<<<<<<<<<
- *         self.rowiter.header = self.header
- * 
- */
-  __pyx_t_3 = __pyx_v_self->__pyx_base.htsfile;
-  __pyx_v_self->rowiter->__pyx_base.htsfile = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":1515
- *         # to the values in this iterator to reflect multiple_iterators
- *         self.rowiter.htsfile = self.htsfile
- *         self.rowiter.header = self.header             # <<<<<<<<<<<<<<
- * 
- *         # make sure the iterator understand that IteratorRowAllRefs
- */
-  __pyx_t_4 = __pyx_v_self->__pyx_base.header;
-  __pyx_v_self->rowiter->__pyx_base.header = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":1519
- *         # make sure the iterator understand that IteratorRowAllRefs
- *         # has ownership
- *         self.rowiter.owns_samfile = False             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __pyx_v_self->rowiter->__pyx_base.owns_samfile = 0;
-
-  /* "pysam/calignmentfile.pyx":1505
- *         self.tid = -1
- * 
- *     def nextiter(self):             # <<<<<<<<<<<<<<
- *         # get a new iterator for a chromosome. The file
- *         # will not be re-opened.
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowAllRefs.nextiter", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1521
- *         self.rowiter.owns_samfile = False
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_5__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_5__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_4__iter__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_4__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-  __Pyx_TraceCall("__iter__", __pyx_f[0], 1521);
-
-  /* "pysam/calignmentfile.pyx":1522
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1521
- *         self.rowiter.owns_samfile = False
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1524
- *         return self
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_7__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__[] = "python version of next().\n\n        pyrex uses this non-standard name instead of next()\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_7__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 1524);
-
-  /* "pysam/calignmentfile.pyx":1530
- *         """
- *         # Create an initial iterator
- *         if self.tid == -1:             # <<<<<<<<<<<<<<
- *             if not self.samfile.nreferences:
- *                 raise StopIteration
- */
-  __pyx_t_1 = ((__pyx_v_self->tid == -1) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1531
- *         # Create an initial iterator
- *         if self.tid == -1:
- *             if not self.samfile.nreferences:             # <<<<<<<<<<<<<<
- *                 raise StopIteration
- *             self.tid = 0
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.samfile), __pyx_n_s_nreferences); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = ((!__pyx_t_1) != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":1532
- *         if self.tid == -1:
- *             if not self.samfile.nreferences:
- *                 raise StopIteration             # <<<<<<<<<<<<<<
- *             self.tid = 0
- *             self.nextiter()
- */
-      __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":1533
- *             if not self.samfile.nreferences:
- *                 raise StopIteration
- *             self.tid = 0             # <<<<<<<<<<<<<<
- *             self.nextiter()
- * 
- */
-    __pyx_v_self->tid = 0;
-
-    /* "pysam/calignmentfile.pyx":1534
- *                 raise StopIteration
- *             self.tid = 0
- *             self.nextiter()             # <<<<<<<<<<<<<<
- * 
- *         while 1:
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nextiter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1536
- *             self.nextiter()
- * 
- *         while 1:             # <<<<<<<<<<<<<<
- *             self.rowiter.cnext()
- * 
- */
-  while (1) {
-
-    /* "pysam/calignmentfile.pyx":1537
- * 
- *         while 1:
- *             self.rowiter.cnext()             # <<<<<<<<<<<<<<
- * 
- *             # If current iterator is not exhausted, return aligned read
- */
-    ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_v_self->rowiter->__pyx_vtab)->cnext(__pyx_v_self->rowiter);
-
-    /* "pysam/calignmentfile.pyx":1540
- * 
- *             # If current iterator is not exhausted, return aligned read
- *             if self.rowiter.retval > 0:             # <<<<<<<<<<<<<<
- *                 return makeAlignedSegment(self.rowiter.b)
- * 
- */
-    __pyx_t_3 = ((__pyx_v_self->rowiter->__pyx_base.retval > 0) != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":1541
- *             # If current iterator is not exhausted, return aligned read
- *             if self.rowiter.retval > 0:
- *                 return makeAlignedSegment(self.rowiter.b)             # <<<<<<<<<<<<<<
- * 
- *             self.tid += 1
- */
-      __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = __pyx_f_5pysam_14calignmentfile_makeAlignedSegment(__pyx_v_self->rowiter->__pyx_base.b); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_r = __pyx_t_4;
-      __pyx_t_4 = 0;
-      goto __pyx_L0;
-    }
-
-    /* "pysam/calignmentfile.pyx":1543
- *                 return makeAlignedSegment(self.rowiter.b)
- * 
- *             self.tid += 1             # <<<<<<<<<<<<<<
- * 
- *             # Otherwise, proceed to next reference or stop
- */
-    __pyx_v_self->tid = (__pyx_v_self->tid + 1);
-
-    /* "pysam/calignmentfile.pyx":1546
- * 
- *             # Otherwise, proceed to next reference or stop
- *             if self.tid < self.samfile.nreferences:             # <<<<<<<<<<<<<<
- *                 self.nextiter()
- *             else:
- */
-    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->tid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.samfile), __pyx_n_s_nreferences); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":1547
- *             # Otherwise, proceed to next reference or stop
- *             if self.tid < self.samfile.nreferences:
- *                 self.nextiter()             # <<<<<<<<<<<<<<
- *             else:
- *                 raise StopIteration
- */
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nextiter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L8;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":1549
- *                 self.nextiter()
- *             else:
- *                 raise StopIteration             # <<<<<<<<<<<<<<
- * 
- * 
- */
-      __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __pyx_L8:;
-  }
-
-  /* "pysam/calignmentfile.pyx":1524
- *         return self
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowAllRefs.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1562
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, positions, int multiple_iterators=True):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  PyObject *__pyx_v_positions = 0;
-  int __pyx_v_multiple_iterators;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,&__pyx_n_s_positions,&__pyx_n_s_multiple_iterators,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_positions)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-    __pyx_v_positions = values[1];
-    if (values[2]) {
-      __pyx_v_multiple_iterators = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_multiple_iterators == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_multiple_iterators = ((int)1);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowSelection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection___init__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *)__pyx_v_self), __pyx_v_samfile, __pyx_v_positions, __pyx_v_multiple_iterators);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection___init__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, PyObject *__pyx_v_positions, int __pyx_v_multiple_iterators) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  BGZF *__pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 1562);
-
-  /* "pysam/calignmentfile.pyx":1564
- *     def __init__(self, AlignmentFile samfile, positions, int multiple_iterators=True):
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)             # <<<<<<<<<<<<<<
- * 
- *         self.positions = positions
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRow)), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __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 = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_multiple_iterators); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_multiple_iterators, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":1566
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- * 
- *         self.positions = positions             # <<<<<<<<<<<<<<
- *         self.current_pos = 0
- * 
- */
-  __Pyx_INCREF(__pyx_v_positions);
-  __Pyx_GIVEREF(__pyx_v_positions);
-  __Pyx_GOTREF(__pyx_v_self->positions);
-  __Pyx_DECREF(__pyx_v_self->positions);
-  __pyx_v_self->positions = __pyx_v_positions;
-
-  /* "pysam/calignmentfile.pyx":1567
- * 
- *         self.positions = positions
- *         self.current_pos = 0             # <<<<<<<<<<<<<<
- * 
- *         self.fp = self.htsfile.fp.bgzf
- */
-  __pyx_v_self->current_pos = 0;
-
-  /* "pysam/calignmentfile.pyx":1569
- *         self.current_pos = 0
- * 
- *         self.fp = self.htsfile.fp.bgzf             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __pyx_t_5 = __pyx_v_self->__pyx_base.htsfile->fp.bgzf;
-  __pyx_v_self->fp = __pyx_t_5;
-
-  /* "pysam/calignmentfile.pyx":1562
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, positions, int multiple_iterators=True):             # <<<<<<<<<<<<<<
- * 
- *         IteratorRow.__init__(self, samfile, multiple_iterators=multiple_iterators)
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowSelection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1571
- *         self.fp = self.htsfile.fp.bgzf
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_3__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_3__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection_2__iter__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-  __Pyx_TraceCall("__iter__", __pyx_f[0], 1571);
-
-  /* "pysam/calignmentfile.pyx":1572
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef bam1_t * getCurrent(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1571
- *         self.fp = self.htsfile.fp.bgzf
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1574
- *         return self
- * 
- *     cdef bam1_t * getCurrent(self):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-static bam1_t *__pyx_f_5pysam_14calignmentfile_20IteratorRowSelection_getCurrent(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *__pyx_v_self) {
-  bam1_t *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("getCurrent", 0);
-  __Pyx_TraceCall("getCurrent", __pyx_f[0], 1574);
-
-  /* "pysam/calignmentfile.pyx":1575
- * 
- *     cdef bam1_t * getCurrent(self):
- *         return self.b             # <<<<<<<<<<<<<<
- * 
- *     cdef int cnext(self):
- */
-  __pyx_r = __pyx_v_self->__pyx_base.b;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1574
- *         return self
- * 
- *     cdef bam1_t * getCurrent(self):             # <<<<<<<<<<<<<<
- *         return self.b
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1577
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''cversion of iterator'''
- * 
- */
-
-static int __pyx_f_5pysam_14calignmentfile_20IteratorRowSelection_cnext(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  Py_ssize_t __pyx_t_2;
-  int __pyx_t_3;
-  int64_t __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("cnext", 0);
-  __Pyx_TraceCall("cnext", __pyx_f[0], 1577);
-
-  /* "pysam/calignmentfile.pyx":1581
- * 
- *         # end iteration if out of positions
- *         if self.current_pos >= len(self.positions): return -1             # <<<<<<<<<<<<<<
- * 
- *         bgzf_seek(self.fp,
- */
-  __pyx_t_1 = __pyx_v_self->positions;
-  __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = ((__pyx_v_self->current_pos >= __pyx_t_2) != 0);
-  if (__pyx_t_3) {
-    __pyx_r = -1;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":1584
- * 
- *         bgzf_seek(self.fp,
- *                   self.positions[self.current_pos],             # <<<<<<<<<<<<<<
- *                   0)
- *         self.current_pos += 1
- */
-  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->positions, __pyx_v_self->current_pos, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1583
- *         if self.current_pos >= len(self.positions): return -1
- * 
- *         bgzf_seek(self.fp,             # <<<<<<<<<<<<<<
- *                   self.positions[self.current_pos],
- *                   0)
- */
-  bgzf_seek(__pyx_v_self->fp, __pyx_t_4, 0);
-
-  /* "pysam/calignmentfile.pyx":1586
- *                   self.positions[self.current_pos],
- *                   0)
- *         self.current_pos += 1             # <<<<<<<<<<<<<<
- *         return sam_read1(self.htsfile,
- *                          self.samfile.header,
- */
-  __pyx_v_self->current_pos = (__pyx_v_self->current_pos + 1);
-
-  /* "pysam/calignmentfile.pyx":1587
- *                   0)
- *         self.current_pos += 1
- *         return sam_read1(self.htsfile,             # <<<<<<<<<<<<<<
- *                          self.samfile.header,
- *                          self.b)
- */
-  __pyx_r = sam_read1(__pyx_v_self->__pyx_base.htsfile, __pyx_v_self->__pyx_base.samfile->header, __pyx_v_self->__pyx_base.b);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1577
- *         return self.b
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''cversion of iterator'''
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_WriteUnraisable("pysam.calignmentfile.IteratorRowSelection.cnext", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1591
- *                          self.b)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_5__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_20IteratorRowSelection_4__next__[] = "python version of next().\n\n        pyrex uses this non-standard name instead of next()\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_20IteratorRowSelection_4__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_5__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection_4__next__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_20IteratorRowSelection_4__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *__pyx_v_self) {
-  int __pyx_v_ret;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 1591);
-
-  /* "pysam/calignmentfile.pyx":1596
- *         pyrex uses this non-standard name instead of next()
- *         """
- *         cdef int ret = self.cnext()             # <<<<<<<<<<<<<<
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)
- */
-  __pyx_v_ret = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection *)__pyx_v_self->__pyx_vtab)->cnext(__pyx_v_self);
-
-  /* "pysam/calignmentfile.pyx":1597
- *         """
- *         cdef int ret = self.cnext()
- *         if (ret >= 0):             # <<<<<<<<<<<<<<
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- */
-  __pyx_t_1 = ((__pyx_v_ret >= 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1598
- *         cdef int ret = self.cnext()
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)             # <<<<<<<<<<<<<<
- *         elif (ret == -2):
- *             raise IOError('truncated file')
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_makeAlignedSegment(__pyx_v_self->__pyx_base.b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":1599
- *         if (ret >= 0):
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):             # <<<<<<<<<<<<<<
- *             raise IOError('truncated file')
- *         else:
- */
-  __pyx_t_1 = ((__pyx_v_ret == -2) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1600
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- *             raise IOError('truncated file')             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":1602
- *             raise IOError('truncated file')
- *         else:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1591
- *                          self.b)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorRowSelection.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1605
- * 
- * 
- * cdef int __advance_nofilter(void *data, bam1_t *b):             # <<<<<<<<<<<<<<
- *     '''advance without any read filtering.
- *     '''
- */
-
-static int __pyx_f_5pysam_14calignmentfile___advance_nofilter(void *__pyx_v_data, bam1_t *__pyx_v_b) {
-  __pyx_t_5pysam_14calignmentfile___iterdata *__pyx_v_d;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__advance_nofilter", 0);
-  __Pyx_TraceCall("__advance_nofilter", __pyx_f[0], 1605);
-
-  /* "pysam/calignmentfile.pyx":1609
- *     '''
- *     cdef __iterdata * d
- *     d = <__iterdata*>data             # <<<<<<<<<<<<<<
- *     return sam_itr_next(d.htsfile, d.iter, b)
- * 
- */
-  __pyx_v_d = ((__pyx_t_5pysam_14calignmentfile___iterdata *)__pyx_v_data);
-
-  /* "pysam/calignmentfile.pyx":1610
- *     cdef __iterdata * d
- *     d = <__iterdata*>data
- *     return sam_itr_next(d.htsfile, d.iter, b)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_r = sam_itr_next(__pyx_v_d->htsfile, __pyx_v_d->iter, __pyx_v_b);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1605
- * 
- * 
- * cdef int __advance_nofilter(void *data, bam1_t *b):             # <<<<<<<<<<<<<<
- *     '''advance without any read filtering.
- *     '''
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1613
- * 
- * 
- * cdef int __advance_all(void *data, bam1_t *b):             # <<<<<<<<<<<<<<
- *     '''only use reads for pileup passing basic
- *     filters:
- */
-
-static int __pyx_f_5pysam_14calignmentfile___advance_all(void *__pyx_v_data, bam1_t *__pyx_v_b) {
-  __pyx_t_5pysam_14calignmentfile___iterdata *__pyx_v_d;
-  PyObject *__pyx_v_mask = 0;
-  int __pyx_v_ret;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__advance_all", 0);
-  __Pyx_TraceCall("__advance_all", __pyx_f[0], 1613);
-
-  /* "pysam/calignmentfile.pyx":1621
- * 
- *     cdef __iterdata * d
- *     cdef mask = BAM_FUNMAP | BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP             # <<<<<<<<<<<<<<
- *     d = <__iterdata*>data
- *     cdef int ret = sam_itr_next(d.htsfile, d.iter, b)
- */
-  __pyx_t_1 = __Pyx_PyInt_From_int((((BAM_FUNMAP | BAM_FSECONDARY) | BAM_FQCFAIL) | BAM_FDUP)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_mask = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1622
- *     cdef __iterdata * d
- *     cdef mask = BAM_FUNMAP | BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP
- *     d = <__iterdata*>data             # <<<<<<<<<<<<<<
- *     cdef int ret = sam_itr_next(d.htsfile, d.iter, b)
- *     while ret >= 0 and b.core.flag & mask:
- */
-  __pyx_v_d = ((__pyx_t_5pysam_14calignmentfile___iterdata *)__pyx_v_data);
-
-  /* "pysam/calignmentfile.pyx":1623
- *     cdef mask = BAM_FUNMAP | BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP
- *     d = <__iterdata*>data
- *     cdef int ret = sam_itr_next(d.htsfile, d.iter, b)             # <<<<<<<<<<<<<<
- *     while ret >= 0 and b.core.flag & mask:
- *         ret = sam_itr_next(d.htsfile, d.iter, b)
- */
-  __pyx_v_ret = sam_itr_next(__pyx_v_d->htsfile, __pyx_v_d->iter, __pyx_v_b);
-
-  /* "pysam/calignmentfile.pyx":1624
- *     d = <__iterdata*>data
- *     cdef int ret = sam_itr_next(d.htsfile, d.iter, b)
- *     while ret >= 0 and b.core.flag & mask:             # <<<<<<<<<<<<<<
- *         ret = sam_itr_next(d.htsfile, d.iter, b)
- * 
- */
-  while (1) {
-    __pyx_t_2 = (__pyx_v_ret >= 0);
-    if (__pyx_t_2) {
-      __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_b->core.flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_v_mask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_5 = __pyx_t_4;
-    } else {
-      __pyx_t_5 = __pyx_t_2;
-    }
-    if (!__pyx_t_5) break;
-
-    /* "pysam/calignmentfile.pyx":1625
- *     cdef int ret = sam_itr_next(d.htsfile, d.iter, b)
- *     while ret >= 0 and b.core.flag & mask:
- *         ret = sam_itr_next(d.htsfile, d.iter, b)             # <<<<<<<<<<<<<<
- * 
- *     return ret
- */
-    __pyx_v_ret = sam_itr_next(__pyx_v_d->htsfile, __pyx_v_d->iter, __pyx_v_b);
-  }
-
-  /* "pysam/calignmentfile.pyx":1627
- *         ret = sam_itr_next(d.htsfile, d.iter, b)
- * 
- *     return ret             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_r = __pyx_v_ret;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1613
- * 
- * 
- * cdef int __advance_all(void *data, bam1_t *b):             # <<<<<<<<<<<<<<
- *     '''only use reads for pileup passing basic
- *     filters:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_WriteUnraisable("pysam.calignmentfile.__advance_all", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_mask);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1630
- * 
- * 
- * cdef int __advance_snpcalls(void * data, bam1_t * b):             # <<<<<<<<<<<<<<
- *     '''advance using same filter and read processing as in
- *     the samtools pileup.
- */
-
-static int __pyx_f_5pysam_14calignmentfile___advance_snpcalls(void *__pyx_v_data, bam1_t *__pyx_v_b) {
-  __pyx_t_5pysam_14calignmentfile___iterdata *__pyx_v_d;
-  int __pyx_v_ret;
-  int __pyx_v_skip;
-  int __pyx_v_q;
-  int __pyx_v_is_cns;
-  int __pyx_v_is_nobaq;
-  int __pyx_v_capQ_thres;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int32_t __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("__advance_snpcalls", 0);
-  __Pyx_TraceCall("__advance_snpcalls", __pyx_f[0], 1630);
-
-  /* "pysam/calignmentfile.pyx":1642
- *     # 2. bam_cap_mapQ
- *     cdef __iterdata * d
- *     d = <__iterdata*>data             # <<<<<<<<<<<<<<
- * 
- *     cdef int ret = sam_itr_next(d.htsfile, d.iter, b)
- */
-  __pyx_v_d = ((__pyx_t_5pysam_14calignmentfile___iterdata *)__pyx_v_data);
-
-  /* "pysam/calignmentfile.pyx":1644
- *     d = <__iterdata*>data
- * 
- *     cdef int ret = sam_itr_next(d.htsfile, d.iter, b)             # <<<<<<<<<<<<<<
- *     cdef int skip = 0
- *     cdef int q
- */
-  __pyx_v_ret = sam_itr_next(__pyx_v_d->htsfile, __pyx_v_d->iter, __pyx_v_b);
-
-  /* "pysam/calignmentfile.pyx":1645
- * 
- *     cdef int ret = sam_itr_next(d.htsfile, d.iter, b)
- *     cdef int skip = 0             # <<<<<<<<<<<<<<
- *     cdef int q
- *     cdef int is_cns = 1
- */
-  __pyx_v_skip = 0;
-
-  /* "pysam/calignmentfile.pyx":1647
- *     cdef int skip = 0
- *     cdef int q
- *     cdef int is_cns = 1             # <<<<<<<<<<<<<<
- *     cdef int is_nobaq = 0
- *     cdef int capQ_thres = 0
- */
-  __pyx_v_is_cns = 1;
-
-  /* "pysam/calignmentfile.pyx":1648
- *     cdef int q
- *     cdef int is_cns = 1
- *     cdef int is_nobaq = 0             # <<<<<<<<<<<<<<
- *     cdef int capQ_thres = 0
- * 
- */
-  __pyx_v_is_nobaq = 0;
-
-  /* "pysam/calignmentfile.pyx":1649
- *     cdef int is_cns = 1
- *     cdef int is_nobaq = 0
- *     cdef int capQ_thres = 0             # <<<<<<<<<<<<<<
- * 
- *     # reload sequence
- */
-  __pyx_v_capQ_thres = 0;
-
-  /* "pysam/calignmentfile.pyx":1652
- * 
- *     # reload sequence
- *     if d.fastafile != NULL and b.core.tid != d.tid:             # <<<<<<<<<<<<<<
- *         if d.seq != NULL:
- *             free(d.seq)
- */
-  __pyx_t_1 = ((__pyx_v_d->fastafile != NULL) != 0);
-  if (__pyx_t_1) {
-    __pyx_t_2 = ((__pyx_v_b->core.tid != __pyx_v_d->tid) != 0);
-    __pyx_t_3 = __pyx_t_2;
-  } else {
-    __pyx_t_3 = __pyx_t_1;
-  }
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":1653
- *     # reload sequence
- *     if d.fastafile != NULL and b.core.tid != d.tid:
- *         if d.seq != NULL:             # <<<<<<<<<<<<<<
- *             free(d.seq)
- *         d.tid = b.core.tid
- */
-    __pyx_t_3 = ((__pyx_v_d->seq != NULL) != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":1654
- *     if d.fastafile != NULL and b.core.tid != d.tid:
- *         if d.seq != NULL:
- *             free(d.seq)             # <<<<<<<<<<<<<<
- *         d.tid = b.core.tid
- *         d.seq = faidx_fetch_seq(
- */
-      free(__pyx_v_d->seq);
-      goto __pyx_L4;
-    }
-    __pyx_L4:;
-
-    /* "pysam/calignmentfile.pyx":1655
- *         if d.seq != NULL:
- *             free(d.seq)
- *         d.tid = b.core.tid             # <<<<<<<<<<<<<<
- *         d.seq = faidx_fetch_seq(
- *             d.fastafile,
- */
-    __pyx_t_4 = __pyx_v_b->core.tid;
-    __pyx_v_d->tid = __pyx_t_4;
-
-    /* "pysam/calignmentfile.pyx":1656
- *             free(d.seq)
- *         d.tid = b.core.tid
- *         d.seq = faidx_fetch_seq(             # <<<<<<<<<<<<<<
- *             d.fastafile,
- *             d.header.target_name[d.tid],
- */
-    __pyx_v_d->seq = faidx_fetch_seq(__pyx_v_d->fastafile, (__pyx_v_d->header->target_name[__pyx_v_d->tid]), 0, __pyx_v_5pysam_14calignmentfile_max_pos, (&__pyx_v_d->seq_len));
-
-    /* "pysam/calignmentfile.pyx":1662
- *             &d.seq_len)
- * 
- *         if d.seq == NULL:             # <<<<<<<<<<<<<<
- *             raise ValueError(
- *                 "reference sequence for '%s' (tid=%i) not found" % \
- */
-    __pyx_t_3 = ((__pyx_v_d->seq == NULL) != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":1665
- *             raise ValueError(
- *                 "reference sequence for '%s' (tid=%i) not found" % \
- *                 (d.header.target_name[d.tid],             # <<<<<<<<<<<<<<
- *                  d.tid))
- * 
- */
-      __pyx_t_5 = __Pyx_PyBytes_FromString((__pyx_v_d->header->target_name[__pyx_v_d->tid])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-
-      /* "pysam/calignmentfile.pyx":1666
- *                 "reference sequence for '%s' (tid=%i) not found" % \
- *                 (d.header.target_name[d.tid],
- *                  d.tid))             # <<<<<<<<<<<<<<
- * 
- *     while ret >= 0:
- */
-      __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_d->tid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-
-      /* "pysam/calignmentfile.pyx":1665
- *             raise ValueError(
- *                 "reference sequence for '%s' (tid=%i) not found" % \
- *                 (d.header.target_name[d.tid],             # <<<<<<<<<<<<<<
- *                  d.tid))
- * 
- */
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
-      __Pyx_GIVEREF(__pyx_t_5);
-      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_5 = 0;
-      __pyx_t_6 = 0;
-
-      /* "pysam/calignmentfile.pyx":1664
- *         if d.seq == NULL:
- *             raise ValueError(
- *                 "reference sequence for '%s' (tid=%i) not found" % \             # <<<<<<<<<<<<<<
- *                 (d.header.target_name[d.tid],
- *                  d.tid))
- */
-      __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_reference_sequence_for_s_tid_i_n, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-      /* "pysam/calignmentfile.pyx":1663
- * 
- *         if d.seq == NULL:
- *             raise ValueError(             # <<<<<<<<<<<<<<
- *                 "reference sequence for '%s' (tid=%i) not found" % \
- *                 (d.header.target_name[d.tid],
- */
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1668
- *                  d.tid))
- * 
- *     while ret >= 0:             # <<<<<<<<<<<<<<
- *         skip = 0
- * 
- */
-  while (1) {
-    __pyx_t_3 = ((__pyx_v_ret >= 0) != 0);
-    if (!__pyx_t_3) break;
-
-    /* "pysam/calignmentfile.pyx":1669
- * 
- *     while ret >= 0:
- *         skip = 0             # <<<<<<<<<<<<<<
- * 
- *         # realign read - changes base qualities
- */
-    __pyx_v_skip = 0;
-
-    /* "pysam/calignmentfile.pyx":1672
- * 
- *         # realign read - changes base qualities
- *         if d.seq != NULL and is_cns and not is_nobaq:             # <<<<<<<<<<<<<<
- *             bam_prob_realn(b, d.seq)
- * 
- */
-    __pyx_t_3 = (__pyx_v_d->seq != NULL);
-    if (__pyx_t_3) {
-      if ((__pyx_v_is_cns != 0)) {
-        __pyx_t_1 = (!(__pyx_v_is_nobaq != 0));
-        __pyx_t_2 = __pyx_t_1;
-      } else {
-        __pyx_t_2 = (__pyx_v_is_cns != 0);
-      }
-      __pyx_t_1 = __pyx_t_2;
-    } else {
-      __pyx_t_1 = __pyx_t_3;
-    }
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1673
- *         # realign read - changes base qualities
- *         if d.seq != NULL and is_cns and not is_nobaq:
- *             bam_prob_realn(b, d.seq)             # <<<<<<<<<<<<<<
- * 
- *         if d.seq != NULL and capQ_thres > 10:
- */
-      bam_prob_realn(__pyx_v_b, __pyx_v_d->seq);
-      goto __pyx_L8;
-    }
-    __pyx_L8:;
-
-    /* "pysam/calignmentfile.pyx":1675
- *             bam_prob_realn(b, d.seq)
- * 
- *         if d.seq != NULL and capQ_thres > 10:             # <<<<<<<<<<<<<<
- *             q = bam_cap_mapQ(b, d.seq, capQ_thres)
- *             if q < 0:
- */
-    __pyx_t_1 = ((__pyx_v_d->seq != NULL) != 0);
-    if (__pyx_t_1) {
-      __pyx_t_3 = ((__pyx_v_capQ_thres > 10) != 0);
-      __pyx_t_2 = __pyx_t_3;
-    } else {
-      __pyx_t_2 = __pyx_t_1;
-    }
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":1676
- * 
- *         if d.seq != NULL and capQ_thres > 10:
- *             q = bam_cap_mapQ(b, d.seq, capQ_thres)             # <<<<<<<<<<<<<<
- *             if q < 0:
- *                 skip = 1
- */
-      __pyx_v_q = bam_cap_mapQ(__pyx_v_b, __pyx_v_d->seq, __pyx_v_capQ_thres);
-
-      /* "pysam/calignmentfile.pyx":1677
- *         if d.seq != NULL and capQ_thres > 10:
- *             q = bam_cap_mapQ(b, d.seq, capQ_thres)
- *             if q < 0:             # <<<<<<<<<<<<<<
- *                 skip = 1
- *             elif b.core.qual > q:
- */
-      __pyx_t_2 = ((__pyx_v_q < 0) != 0);
-      if (__pyx_t_2) {
-
-        /* "pysam/calignmentfile.pyx":1678
- *             q = bam_cap_mapQ(b, d.seq, capQ_thres)
- *             if q < 0:
- *                 skip = 1             # <<<<<<<<<<<<<<
- *             elif b.core.qual > q:
- *                 b.core.qual = q
- */
-        __pyx_v_skip = 1;
-        goto __pyx_L10;
-      }
-
-      /* "pysam/calignmentfile.pyx":1679
- *             if q < 0:
- *                 skip = 1
- *             elif b.core.qual > q:             # <<<<<<<<<<<<<<
- *                 b.core.qual = q
- *         if b.core.flag & BAM_FUNMAP:
- */
-      __pyx_t_2 = ((__pyx_v_b->core.qual > __pyx_v_q) != 0);
-      if (__pyx_t_2) {
-
-        /* "pysam/calignmentfile.pyx":1680
- *                 skip = 1
- *             elif b.core.qual > q:
- *                 b.core.qual = q             # <<<<<<<<<<<<<<
- *         if b.core.flag & BAM_FUNMAP:
- *             skip = 1
- */
-        __pyx_v_b->core.qual = __pyx_v_q;
-        goto __pyx_L10;
-      }
-      __pyx_L10:;
-      goto __pyx_L9;
-    }
-    __pyx_L9:;
-
-    /* "pysam/calignmentfile.pyx":1681
- *             elif b.core.qual > q:
- *                 b.core.qual = q
- *         if b.core.flag & BAM_FUNMAP:             # <<<<<<<<<<<<<<
- *             skip = 1
- *         elif b.core.flag & 1 and not b.core.flag & 2:
- */
-    __pyx_t_2 = ((__pyx_v_b->core.flag & BAM_FUNMAP) != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":1682
- *                 b.core.qual = q
- *         if b.core.flag & BAM_FUNMAP:
- *             skip = 1             # <<<<<<<<<<<<<<
- *         elif b.core.flag & 1 and not b.core.flag & 2:
- *             skip = 1
- */
-      __pyx_v_skip = 1;
-      goto __pyx_L11;
-    }
-
-    /* "pysam/calignmentfile.pyx":1683
- *         if b.core.flag & BAM_FUNMAP:
- *             skip = 1
- *         elif b.core.flag & 1 and not b.core.flag & 2:             # <<<<<<<<<<<<<<
- *             skip = 1
- * 
- */
-    if (((__pyx_v_b->core.flag & 1) != 0)) {
-      __pyx_t_2 = (!((__pyx_v_b->core.flag & 2) != 0));
-      __pyx_t_1 = __pyx_t_2;
-    } else {
-      __pyx_t_1 = ((__pyx_v_b->core.flag & 1) != 0);
-    }
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1684
- *             skip = 1
- *         elif b.core.flag & 1 and not b.core.flag & 2:
- *             skip = 1             # <<<<<<<<<<<<<<
- * 
- *         if not skip:
- */
-      __pyx_v_skip = 1;
-      goto __pyx_L11;
-    }
-    __pyx_L11:;
-
-    /* "pysam/calignmentfile.pyx":1686
- *             skip = 1
- * 
- *         if not skip:             # <<<<<<<<<<<<<<
- *             break
- *         # additional filters
- */
-    __pyx_t_1 = ((!(__pyx_v_skip != 0)) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1687
- * 
- *         if not skip:
- *             break             # <<<<<<<<<<<<<<
- *         # additional filters
- * 
- */
-      goto __pyx_L7_break;
-    }
-
-    /* "pysam/calignmentfile.pyx":1690
- *         # additional filters
- * 
- *         ret = sam_itr_next(d.htsfile, d.iter, b)             # <<<<<<<<<<<<<<
- * 
- *     return ret
- */
-    __pyx_v_ret = sam_itr_next(__pyx_v_d->htsfile, __pyx_v_d->iter, __pyx_v_b);
-  }
-  __pyx_L7_break:;
-
-  /* "pysam/calignmentfile.pyx":1692
- *         ret = sam_itr_next(d.htsfile, d.iter, b)
- * 
- *     return ret             # <<<<<<<<<<<<<<
- * 
- * cdef class IteratorColumn:
- */
-  __pyx_r = __pyx_v_ret;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1630
- * 
- * 
- * cdef int __advance_snpcalls(void * data, bam1_t * b):             # <<<<<<<<<<<<<<
- *     '''advance using same filter and read processing as in
- *     the samtools pileup.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_WriteUnraisable("pysam.calignmentfile.__advance_snpcalls", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1745
- *     '''
- * 
- *     def __cinit__( self, AlignmentFile samfile, **kwargs ):             # <<<<<<<<<<<<<<
- *         self.samfile = samfile
- *         # TODO
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  PyObject *__pyx_v_kwargs = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
-  __Pyx_GOTREF(__pyx_v_kwargs);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,0};
-    PyObject* values[1] = {0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-    }
-    __pyx_v_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumn.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14IteratorColumn___cinit__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self), __pyx_v_samfile, __pyx_v_kwargs);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_kwargs);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14IteratorColumn___cinit__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, PyObject *__pyx_v_kwargs) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-  __Pyx_TraceCall("__cinit__", __pyx_f[0], 1745);
-
-  /* "pysam/calignmentfile.pyx":1746
- * 
- *     def __cinit__( self, AlignmentFile samfile, **kwargs ):
- *         self.samfile = samfile             # <<<<<<<<<<<<<<
- *         # TODO
- *         # self.mask = kwargs.get("mask", BAM_DEF_MASK )
- */
-  __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
-  __Pyx_GOTREF(__pyx_v_self->samfile);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->samfile));
-  __pyx_v_self->samfile = __pyx_v_samfile;
-
-  /* "pysam/calignmentfile.pyx":1749
- *         # TODO
- *         # self.mask = kwargs.get("mask", BAM_DEF_MASK )
- *         self.fastafile = kwargs.get("fastafile", None)             # <<<<<<<<<<<<<<
- *         self.stepper = kwargs.get("stepper", None)
- *         self.max_depth = kwargs.get("max_depth", 8000)
- */
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_fastafile, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysam_6cfaidx_Fastafile))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_GOTREF(__pyx_v_self->fastafile);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->fastafile));
-  __pyx_v_self->fastafile = ((struct __pyx_obj_5pysam_6cfaidx_Fastafile *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1750
- *         # self.mask = kwargs.get("mask", BAM_DEF_MASK )
- *         self.fastafile = kwargs.get("fastafile", None)
- *         self.stepper = kwargs.get("stepper", None)             # <<<<<<<<<<<<<<
- *         self.max_depth = kwargs.get("max_depth", 8000)
- *         self.iterdata.seq = NULL
- */
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_stepper, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_GOTREF(__pyx_v_self->stepper);
-  __Pyx_DECREF(__pyx_v_self->stepper);
-  __pyx_v_self->stepper = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1751
- *         self.fastafile = kwargs.get("fastafile", None)
- *         self.stepper = kwargs.get("stepper", None)
- *         self.max_depth = kwargs.get("max_depth", 8000)             # <<<<<<<<<<<<<<
- *         self.iterdata.seq = NULL
- *         self.tid = 0
- */
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_max_depth, __pyx_int_8000); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_self->max_depth = __pyx_t_2;
-
-  /* "pysam/calignmentfile.pyx":1752
- *         self.stepper = kwargs.get("stepper", None)
- *         self.max_depth = kwargs.get("max_depth", 8000)
- *         self.iterdata.seq = NULL             # <<<<<<<<<<<<<<
- *         self.tid = 0
- *         self.pos = 0
- */
-  __pyx_v_self->iterdata.seq = NULL;
-
-  /* "pysam/calignmentfile.pyx":1753
- *         self.max_depth = kwargs.get("max_depth", 8000)
- *         self.iterdata.seq = NULL
- *         self.tid = 0             # <<<<<<<<<<<<<<
- *         self.pos = 0
- *         self.n_plp = 0
- */
-  __pyx_v_self->tid = 0;
-
-  /* "pysam/calignmentfile.pyx":1754
- *         self.iterdata.seq = NULL
- *         self.tid = 0
- *         self.pos = 0             # <<<<<<<<<<<<<<
- *         self.n_plp = 0
- *         self.plp = NULL
- */
-  __pyx_v_self->pos = 0;
-
-  /* "pysam/calignmentfile.pyx":1755
- *         self.tid = 0
- *         self.pos = 0
- *         self.n_plp = 0             # <<<<<<<<<<<<<<
- *         self.plp = NULL
- *         self.pileup_iter = <bam_plp_t>NULL
- */
-  __pyx_v_self->n_plp = 0;
-
-  /* "pysam/calignmentfile.pyx":1756
- *         self.pos = 0
- *         self.n_plp = 0
- *         self.plp = NULL             # <<<<<<<<<<<<<<
- *         self.pileup_iter = <bam_plp_t>NULL
- * 
- */
-  __pyx_v_self->plp = NULL;
-
-  /* "pysam/calignmentfile.pyx":1757
- *         self.n_plp = 0
- *         self.plp = NULL
- *         self.pileup_iter = <bam_plp_t>NULL             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __pyx_v_self->pileup_iter = ((bam_plp_t)NULL);
-
-  /* "pysam/calignmentfile.pyx":1745
- *     '''
- * 
- *     def __cinit__( self, AlignmentFile samfile, **kwargs ):             # <<<<<<<<<<<<<<
- *         self.samfile = samfile
- *         # TODO
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumn.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1759
- *         self.pileup_iter = <bam_plp_t>NULL
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_3__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_3__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14IteratorColumn_2__iter__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorColumn_2__iter__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-  __Pyx_TraceCall("__iter__", __pyx_f[0], 1759);
-
-  /* "pysam/calignmentfile.pyx":1760
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef int cnext(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1759
- *         self.pileup_iter = <bam_plp_t>NULL
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1762
- *         return self
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''perform next iteration.
- *         '''
- */
-
-static int __pyx_f_5pysam_14calignmentfile_14IteratorColumn_cnext(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("cnext", 0);
-  __Pyx_TraceCall("cnext", __pyx_f[0], 1762);
-
-  /* "pysam/calignmentfile.pyx":1765
- *         '''perform next iteration.
- *         '''
- *         self.plp = bam_plp_auto( self.pileup_iter,             # <<<<<<<<<<<<<<
- *                                  &self.tid,
- *                                  &self.pos,
- */
-  __pyx_v_self->plp = bam_plp_auto(__pyx_v_self->pileup_iter, (&__pyx_v_self->tid), (&__pyx_v_self->pos), (&__pyx_v_self->n_plp));
-
-  /* "pysam/calignmentfile.pyx":1762
- *         return self
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''perform next iteration.
- *         '''
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1770
- *                                  &self.n_plp )
- * 
- *     cdef char * getSequence( self ):             # <<<<<<<<<<<<<<
- *         '''return current reference sequence underlying the iterator.
- *         '''
- */
-
-static char *__pyx_f_5pysam_14calignmentfile_14IteratorColumn_getSequence(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self) {
-  char *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("getSequence", 0);
-  __Pyx_TraceCall("getSequence", __pyx_f[0], 1770);
-
-  /* "pysam/calignmentfile.pyx":1773
- *         '''return current reference sequence underlying the iterator.
- *         '''
- *         return self.iterdata.seq             # <<<<<<<<<<<<<<
- * 
- *     property seq_len:
- */
-  __pyx_r = __pyx_v_self->iterdata.seq;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1770
- *                                  &self.n_plp )
- * 
- *     cdef char * getSequence( self ):             # <<<<<<<<<<<<<<
- *         '''return current reference sequence underlying the iterator.
- *         '''
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1777
- *     property seq_len:
- *         '''current sequence length.'''
- *         def __get__(self): return self.iterdata.seq_len             # <<<<<<<<<<<<<<
- * 
- *     def addReference(self, Fastafile fastafile):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_7seq_len_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_7seq_len_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14IteratorColumn_7seq_len___get__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorColumn_7seq_len___get__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 1777);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->iterdata.seq_len); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumn.seq_len.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1779
- *         def __get__(self): return self.iterdata.seq_len
- * 
- *     def addReference(self, Fastafile fastafile):             # <<<<<<<<<<<<<<
- *        '''
- *        add reference sequences in *fastafile* to iterator.'''
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_5addReference(PyObject *__pyx_v_self, PyObject *__pyx_v_fastafile); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14IteratorColumn_4addReference[] = "IteratorColumn.addReference(self, Fastafile fastafile)\n\n       add reference sequences in *fastafile* to iterator.";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_5addReference(PyObject *__pyx_v_self, PyObject *__pyx_v_fastafile) {
-  CYTHON_UNUSED int __pyx_lineno = 0;
-  CYTHON_UNUSED const char *__pyx_filename = NULL;
-  CYTHON_UNUSED int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("addReference (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fastafile), __pyx_ptype_5pysam_6cfaidx_Fastafile, 1, "fastafile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14IteratorColumn_4addReference(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self), ((struct __pyx_obj_5pysam_6cfaidx_Fastafile *)__pyx_v_fastafile));
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorColumn_4addReference(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self, struct __pyx_obj_5pysam_6cfaidx_Fastafile *__pyx_v_fastafile) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  faidx_t *__pyx_t_2;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("addReference", 0);
-  __Pyx_TraceCall("addReference", __pyx_f[0], 1779);
-
-  /* "pysam/calignmentfile.pyx":1782
- *        '''
- *        add reference sequences in *fastafile* to iterator.'''
- *        self.fastafile = fastafile             # <<<<<<<<<<<<<<
- *        if self.iterdata.seq != NULL: free(self.iterdata.seq)
- *        self.iterdata.tid = -1
- */
-  __Pyx_INCREF(((PyObject *)__pyx_v_fastafile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_fastafile));
-  __Pyx_GOTREF(__pyx_v_self->fastafile);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->fastafile));
-  __pyx_v_self->fastafile = __pyx_v_fastafile;
-
-  /* "pysam/calignmentfile.pyx":1783
- *        add reference sequences in *fastafile* to iterator.'''
- *        self.fastafile = fastafile
- *        if self.iterdata.seq != NULL: free(self.iterdata.seq)             # <<<<<<<<<<<<<<
- *        self.iterdata.tid = -1
- *        self.iterdata.fastafile = self.fastafile.fastafile
- */
-  __pyx_t_1 = ((__pyx_v_self->iterdata.seq != NULL) != 0);
-  if (__pyx_t_1) {
-    free(__pyx_v_self->iterdata.seq);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1784
- *        self.fastafile = fastafile
- *        if self.iterdata.seq != NULL: free(self.iterdata.seq)
- *        self.iterdata.tid = -1             # <<<<<<<<<<<<<<
- *        self.iterdata.fastafile = self.fastafile.fastafile
- * 
- */
-  __pyx_v_self->iterdata.tid = -1;
-
-  /* "pysam/calignmentfile.pyx":1785
- *        if self.iterdata.seq != NULL: free(self.iterdata.seq)
- *        self.iterdata.tid = -1
- *        self.iterdata.fastafile = self.fastafile.fastafile             # <<<<<<<<<<<<<<
- * 
- *     def hasReference(self):
- */
-  __pyx_t_2 = __pyx_v_self->fastafile->__pyx_base.fastafile;
-  __pyx_v_self->iterdata.fastafile = __pyx_t_2;
-
-  /* "pysam/calignmentfile.pyx":1779
- *         def __get__(self): return self.iterdata.seq_len
- * 
- *     def addReference(self, Fastafile fastafile):             # <<<<<<<<<<<<<<
- *        '''
- *        add reference sequences in *fastafile* to iterator.'''
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1787
- *        self.iterdata.fastafile = self.fastafile.fastafile
- * 
- *     def hasReference(self):             # <<<<<<<<<<<<<<
- *         '''
- *         return true if iterator is associated with a reference'''
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_7hasReference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14IteratorColumn_6hasReference[] = "IteratorColumn.hasReference(self)\n\n        return true if iterator is associated with a reference";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_7hasReference(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("hasReference (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14IteratorColumn_6hasReference(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14IteratorColumn_6hasReference(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("hasReference", 0);
-  __Pyx_TraceCall("hasReference", __pyx_f[0], 1787);
-
-  /* "pysam/calignmentfile.pyx":1790
- *         '''
- *         return true if iterator is associated with a reference'''
- *         return self.fastafile             # <<<<<<<<<<<<<<
- * 
- *     cdef setMask(self, mask):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self->fastafile));
-  __pyx_r = ((PyObject *)__pyx_v_self->fastafile);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1787
- *        self.iterdata.fastafile = self.fastafile.fastafile
- * 
- *     def hasReference(self):             # <<<<<<<<<<<<<<
- *         '''
- *         return true if iterator is associated with a reference'''
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1792
- *         return self.fastafile
- * 
- *     cdef setMask(self, mask):             # <<<<<<<<<<<<<<
- *         '''set masking flag in iterator.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_14IteratorColumn_setMask(CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_mask) {
-  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("setMask", 0);
-  __Pyx_TraceCall("setMask", __pyx_f[0], 1792);
-
-  /* "pysam/calignmentfile.pyx":1797
- *         reads with bits set in *mask* will be skipped.
- *         '''
- *         raise NotImplementedError()             # <<<<<<<<<<<<<<
- *         # self.mask = mask
- *         # bam_plp_set_mask( self.pileup_iter, self.mask )
- */
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":1792
- *         return self.fastafile
- * 
- *     cdef setMask(self, mask):             # <<<<<<<<<<<<<<
- *         '''set masking flag in iterator.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumn.setMask", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1801
- *         # bam_plp_set_mask( self.pileup_iter, self.mask )
- * 
- *     cdef setupIteratorData( self,             # <<<<<<<<<<<<<<
- *                             int tid,
- *                             int start,
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self, int __pyx_v_tid, int __pyx_v_start, int __pyx_v_end, struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData *__pyx_optional_args) {
-  int __pyx_v_multiple_iterators = ((int)0);
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  htsFile *__pyx_t_6;
-  hts_itr_t *__pyx_t_7;
-  bam_hdr_t *__pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  faidx_t *__pyx_t_11;
-  int __pyx_t_12;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("setupIteratorData", 0);
-  __Pyx_TraceCall("setupIteratorData", __pyx_f[0], 1801);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_multiple_iterators = __pyx_optional_args->multiple_iterators;
-    }
-  }
-
-  /* "pysam/calignmentfile.pyx":1808
- *         '''setup the iterator structure'''
- * 
- *         self.iter = IteratorRowRegion(self.samfile, tid, start, end, multiple_iterators)             # <<<<<<<<<<<<<<
- *         self.iterdata.htsfile = self.samfile.htsfile
- *         self.iterdata.iter = self.iter.iter
- */
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_multiple_iterators); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self->samfile));
-  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self->samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->samfile));
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_1 = 0;
-  __pyx_t_2 = 0;
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_GIVEREF(__pyx_t_4);
-  __Pyx_GOTREF(__pyx_v_self->iter);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->iter));
-  __pyx_v_self->iter = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_t_4);
-  __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":1809
- * 
- *         self.iter = IteratorRowRegion(self.samfile, tid, start, end, multiple_iterators)
- *         self.iterdata.htsfile = self.samfile.htsfile             # <<<<<<<<<<<<<<
- *         self.iterdata.iter = self.iter.iter
- *         self.iterdata.seq = NULL
- */
-  __pyx_t_6 = __pyx_v_self->samfile->htsfile;
-  __pyx_v_self->iterdata.htsfile = __pyx_t_6;
-
-  /* "pysam/calignmentfile.pyx":1810
- *         self.iter = IteratorRowRegion(self.samfile, tid, start, end, multiple_iterators)
- *         self.iterdata.htsfile = self.samfile.htsfile
- *         self.iterdata.iter = self.iter.iter             # <<<<<<<<<<<<<<
- *         self.iterdata.seq = NULL
- *         self.iterdata.tid = -1
- */
-  __pyx_t_7 = __pyx_v_self->iter->iter;
-  __pyx_v_self->iterdata.iter = __pyx_t_7;
-
-  /* "pysam/calignmentfile.pyx":1811
- *         self.iterdata.htsfile = self.samfile.htsfile
- *         self.iterdata.iter = self.iter.iter
- *         self.iterdata.seq = NULL             # <<<<<<<<<<<<<<
- *         self.iterdata.tid = -1
- *         self.iterdata.header = self.samfile.header
- */
-  __pyx_v_self->iterdata.seq = NULL;
-
-  /* "pysam/calignmentfile.pyx":1812
- *         self.iterdata.iter = self.iter.iter
- *         self.iterdata.seq = NULL
- *         self.iterdata.tid = -1             # <<<<<<<<<<<<<<
- *         self.iterdata.header = self.samfile.header
- * 
- */
-  __pyx_v_self->iterdata.tid = -1;
-
-  /* "pysam/calignmentfile.pyx":1813
- *         self.iterdata.seq = NULL
- *         self.iterdata.tid = -1
- *         self.iterdata.header = self.samfile.header             # <<<<<<<<<<<<<<
- * 
- *         if self.fastafile is not None:
- */
-  __pyx_t_8 = __pyx_v_self->samfile->header;
-  __pyx_v_self->iterdata.header = __pyx_t_8;
-
-  /* "pysam/calignmentfile.pyx":1815
- *         self.iterdata.header = self.samfile.header
- * 
- *         if self.fastafile is not None:             # <<<<<<<<<<<<<<
- *             self.iterdata.fastafile = self.fastafile.fastafile
- *         else:
- */
-  __pyx_t_9 = (((PyObject *)__pyx_v_self->fastafile) != Py_None);
-  __pyx_t_10 = (__pyx_t_9 != 0);
-  if (__pyx_t_10) {
-
-    /* "pysam/calignmentfile.pyx":1816
- * 
- *         if self.fastafile is not None:
- *             self.iterdata.fastafile = self.fastafile.fastafile             # <<<<<<<<<<<<<<
- *         else:
- *             self.iterdata.fastafile = NULL
- */
-    __pyx_t_11 = __pyx_v_self->fastafile->__pyx_base.fastafile;
-    __pyx_v_self->iterdata.fastafile = __pyx_t_11;
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":1818
- *             self.iterdata.fastafile = self.fastafile.fastafile
- *         else:
- *             self.iterdata.fastafile = NULL             # <<<<<<<<<<<<<<
- * 
- *         # Free any previously allocated memory before reassigning
- */
-    __pyx_v_self->iterdata.fastafile = NULL;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1822
- *         # Free any previously allocated memory before reassigning
- *         # pileup_iter
- *         self._free_pileup_iter()             # <<<<<<<<<<<<<<
- * 
- *         if self.stepper is None or self.stepper == "all":
- */
-  __pyx_t_4 = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self->__pyx_vtab)->_free_pileup_iter(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":1824
- *         self._free_pileup_iter()
- * 
- *         if self.stepper is None or self.stepper == "all":             # <<<<<<<<<<<<<<
- *             self.pileup_iter = bam_plp_init(
- *                 <bam_plp_auto_f>&__advance_all,
- */
-  __pyx_t_10 = (__pyx_v_self->stepper == Py_None);
-  if (!__pyx_t_10) {
-    __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_self->stepper, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_12 = __pyx_t_9;
-  } else {
-    __pyx_t_12 = __pyx_t_10;
-  }
-  if (__pyx_t_12) {
-
-    /* "pysam/calignmentfile.pyx":1825
- * 
- *         if self.stepper is None or self.stepper == "all":
- *             self.pileup_iter = bam_plp_init(             # <<<<<<<<<<<<<<
- *                 <bam_plp_auto_f>&__advance_all,
- *                 &self.iterdata)
- */
-    __pyx_v_self->pileup_iter = bam_plp_init(((bam_plp_auto_f)(&__pyx_f_5pysam_14calignmentfile___advance_all)), (&__pyx_v_self->iterdata));
-    goto __pyx_L4;
-  }
-
-  /* "pysam/calignmentfile.pyx":1828
- *                 <bam_plp_auto_f>&__advance_all,
- *                 &self.iterdata)
- *         elif self.stepper == "nofilter":             # <<<<<<<<<<<<<<
- *             self.pileup_iter = bam_plp_init(
- *                 <bam_plp_auto_f>&__advance_nofilter,
- */
-  __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_v_self->stepper, __pyx_n_s_nofilter, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_12) {
-
-    /* "pysam/calignmentfile.pyx":1829
- *                 &self.iterdata)
- *         elif self.stepper == "nofilter":
- *             self.pileup_iter = bam_plp_init(             # <<<<<<<<<<<<<<
- *                 <bam_plp_auto_f>&__advance_nofilter,
- *                 &self.iterdata)
- */
-    __pyx_v_self->pileup_iter = bam_plp_init(((bam_plp_auto_f)(&__pyx_f_5pysam_14calignmentfile___advance_nofilter)), (&__pyx_v_self->iterdata));
-    goto __pyx_L4;
-  }
-
-  /* "pysam/calignmentfile.pyx":1832
- *                 <bam_plp_auto_f>&__advance_nofilter,
- *                 &self.iterdata)
- *         elif self.stepper == "samtools":             # <<<<<<<<<<<<<<
- *             self.pileup_iter = bam_plp_init(
- *                 <bam_plp_auto_f>&__advance_snpcalls,
- */
-  __pyx_t_12 = (__Pyx_PyString_Equals(__pyx_v_self->stepper, __pyx_n_s_samtools, Py_EQ)); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_12) {
-
-    /* "pysam/calignmentfile.pyx":1833
- *                 &self.iterdata)
- *         elif self.stepper == "samtools":
- *             self.pileup_iter = bam_plp_init(             # <<<<<<<<<<<<<<
- *                 <bam_plp_auto_f>&__advance_snpcalls,
- *                 &self.iterdata)
- */
-    __pyx_v_self->pileup_iter = bam_plp_init(((bam_plp_auto_f)(&__pyx_f_5pysam_14calignmentfile___advance_snpcalls)), (&__pyx_v_self->iterdata));
-    goto __pyx_L4;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":1838
- *         else:
- *             raise ValueError(
- *                 "unknown stepper option `%s` in IteratorColumn" % self.stepper)             # <<<<<<<<<<<<<<
- * 
- *         if self.max_depth:
- */
-    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unknown_stepper_option_s_in_Iter, __pyx_v_self->stepper); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-
-    /* "pysam/calignmentfile.pyx":1837
- *                 &self.iterdata)
- *         else:
- *             raise ValueError(             # <<<<<<<<<<<<<<
- *                 "unknown stepper option `%s` in IteratorColumn" % self.stepper)
- * 
- */
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_L4:;
-
-  /* "pysam/calignmentfile.pyx":1840
- *                 "unknown stepper option `%s` in IteratorColumn" % self.stepper)
- * 
- *         if self.max_depth:             # <<<<<<<<<<<<<<
- *             bam_plp_set_maxcnt(self.pileup_iter, self.max_depth)
- * 
- */
-  __pyx_t_12 = (__pyx_v_self->max_depth != 0);
-  if (__pyx_t_12) {
-
-    /* "pysam/calignmentfile.pyx":1841
- * 
- *         if self.max_depth:
- *             bam_plp_set_maxcnt(self.pileup_iter, self.max_depth)             # <<<<<<<<<<<<<<
- * 
- *         # bam_plp_set_mask( self.pileup_iter, self.mask )
- */
-    bam_plp_set_maxcnt(__pyx_v_self->pileup_iter, __pyx_v_self->max_depth);
-    goto __pyx_L5;
-  }
-  __pyx_L5:;
-
-  /* "pysam/calignmentfile.pyx":1801
- *         # bam_plp_set_mask( self.pileup_iter, self.mask )
- * 
- *     cdef setupIteratorData( self,             # <<<<<<<<<<<<<<
- *                             int tid,
- *                             int start,
- */
-
-  /* function exit code */
-  __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_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumn.setupIteratorData", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1845
- *         # bam_plp_set_mask( self.pileup_iter, self.mask )
- * 
- *     cdef reset( self, tid, start, end ):             # <<<<<<<<<<<<<<
- *         '''reset iterator position.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_14IteratorColumn_reset(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self, PyObject *__pyx_v_tid, PyObject *__pyx_v_start, PyObject *__pyx_v_end) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  hts_itr_t *__pyx_t_4;
-  int __pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("reset", 0);
-  __Pyx_TraceCall("reset", __pyx_f[0], 1845);
-
-  /* "pysam/calignmentfile.pyx":1851
- *         having to incur the full set-up costs.
- *         '''
- *         self.iter = IteratorRowRegion( self.samfile, tid, start, end, multiple_iterators = 0 )             # <<<<<<<<<<<<<<
- *         self.iterdata.iter = self.iter.iter
- * 
- */
-  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self->samfile));
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->samfile));
-  __Pyx_INCREF(__pyx_v_tid);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tid);
-  __Pyx_GIVEREF(__pyx_v_tid);
-  __Pyx_INCREF(__pyx_v_start);
-  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_start);
-  __Pyx_GIVEREF(__pyx_v_start);
-  __Pyx_INCREF(__pyx_v_end);
-  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_end);
-  __Pyx_GIVEREF(__pyx_v_end);
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_multiple_iterators, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion)), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_GIVEREF(__pyx_t_3);
-  __Pyx_GOTREF(__pyx_v_self->iter);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->iter));
-  __pyx_v_self->iter = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)__pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":1852
- *         '''
- *         self.iter = IteratorRowRegion( self.samfile, tid, start, end, multiple_iterators = 0 )
- *         self.iterdata.iter = self.iter.iter             # <<<<<<<<<<<<<<
- * 
- *         # invalidate sequence if different tid
- */
-  __pyx_t_4 = __pyx_v_self->iter->iter;
-  __pyx_v_self->iterdata.iter = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":1855
- * 
- *         # invalidate sequence if different tid
- *         if self.tid != tid:             # <<<<<<<<<<<<<<
- *             if self.iterdata.seq != NULL: free( self.iterdata.seq )
- *             self.iterdata.seq = NULL
- */
-  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->tid); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_tid, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":1856
- *         # invalidate sequence if different tid
- *         if self.tid != tid:
- *             if self.iterdata.seq != NULL: free( self.iterdata.seq )             # <<<<<<<<<<<<<<
- *             self.iterdata.seq = NULL
- *             self.iterdata.tid = -1
- */
-    __pyx_t_5 = ((__pyx_v_self->iterdata.seq != NULL) != 0);
-    if (__pyx_t_5) {
-      free(__pyx_v_self->iterdata.seq);
-      goto __pyx_L4;
-    }
-    __pyx_L4:;
-
-    /* "pysam/calignmentfile.pyx":1857
- *         if self.tid != tid:
- *             if self.iterdata.seq != NULL: free( self.iterdata.seq )
- *             self.iterdata.seq = NULL             # <<<<<<<<<<<<<<
- *             self.iterdata.tid = -1
- * 
- */
-    __pyx_v_self->iterdata.seq = NULL;
-
-    /* "pysam/calignmentfile.pyx":1858
- *             if self.iterdata.seq != NULL: free( self.iterdata.seq )
- *             self.iterdata.seq = NULL
- *             self.iterdata.tid = -1             # <<<<<<<<<<<<<<
- * 
- *         # self.pileup_iter = bam_plp_init( &__advancepileup, &self.iterdata )
- */
-    __pyx_v_self->iterdata.tid = -1;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1861
- * 
- *         # self.pileup_iter = bam_plp_init( &__advancepileup, &self.iterdata )
- *         bam_plp_reset(self.pileup_iter)             # <<<<<<<<<<<<<<
- * 
- *     cdef _free_pileup_iter(self):
- */
-  bam_plp_reset(__pyx_v_self->pileup_iter);
-
-  /* "pysam/calignmentfile.pyx":1845
- *         # bam_plp_set_mask( self.pileup_iter, self.mask )
- * 
- *     cdef reset( self, tid, start, end ):             # <<<<<<<<<<<<<<
- *         '''reset iterator position.
- * 
- */
-
-  /* function exit code */
-  __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("pysam.calignmentfile.IteratorColumn.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1863
- *         bam_plp_reset(self.pileup_iter)
- * 
- *     cdef _free_pileup_iter(self):             # <<<<<<<<<<<<<<
- *         '''free the memory alloc'd by bam_plp_init.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_14calignmentfile_14IteratorColumn__free_pileup_iter(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_free_pileup_iter", 0);
-  __Pyx_TraceCall("_free_pileup_iter", __pyx_f[0], 1863);
-
-  /* "pysam/calignmentfile.pyx":1869
- *         another pileup_iter, or else memory will be lost.
- *         '''
- *         if self.pileup_iter != <bam_plp_t>NULL:             # <<<<<<<<<<<<<<
- *             bam_plp_reset(self.pileup_iter)
- *             bam_plp_destroy(self.pileup_iter)
- */
-  __pyx_t_1 = ((__pyx_v_self->pileup_iter != ((bam_plp_t)NULL)) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1870
- *         '''
- *         if self.pileup_iter != <bam_plp_t>NULL:
- *             bam_plp_reset(self.pileup_iter)             # <<<<<<<<<<<<<<
- *             bam_plp_destroy(self.pileup_iter)
- *             self.pileup_iter = <bam_plp_t>NULL
- */
-    bam_plp_reset(__pyx_v_self->pileup_iter);
-
-    /* "pysam/calignmentfile.pyx":1871
- *         if self.pileup_iter != <bam_plp_t>NULL:
- *             bam_plp_reset(self.pileup_iter)
- *             bam_plp_destroy(self.pileup_iter)             # <<<<<<<<<<<<<<
- *             self.pileup_iter = <bam_plp_t>NULL
- * 
- */
-    bam_plp_destroy(__pyx_v_self->pileup_iter);
-
-    /* "pysam/calignmentfile.pyx":1872
- *             bam_plp_reset(self.pileup_iter)
- *             bam_plp_destroy(self.pileup_iter)
- *             self.pileup_iter = <bam_plp_t>NULL             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-    __pyx_v_self->pileup_iter = ((bam_plp_t)NULL);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1863
- *         bam_plp_reset(self.pileup_iter)
- * 
- *     cdef _free_pileup_iter(self):             # <<<<<<<<<<<<<<
- *         '''free the memory alloc'd by bam_plp_init.
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1874
- *             self.pileup_iter = <bam_plp_t>NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         # reset in order to avoid memory leak messages for iterators
- *         # that have not been fully consumed
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_9__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_9__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_14calignmentfile_14IteratorColumn_8__dealloc__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_14calignmentfile_14IteratorColumn_8__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 1874);
-
-  /* "pysam/calignmentfile.pyx":1877
- *         # reset in order to avoid memory leak messages for iterators
- *         # that have not been fully consumed
- *         self._free_pileup_iter()             # <<<<<<<<<<<<<<
- *         self.plp = <bam_pileup1_t*>NULL
- * 
- */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self->__pyx_vtab)->_free_pileup_iter(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1878
- *         # that have not been fully consumed
- *         self._free_pileup_iter()
- *         self.plp = <bam_pileup1_t*>NULL             # <<<<<<<<<<<<<<
- * 
- *         if self.iterdata.seq != NULL:
- */
-  __pyx_v_self->plp = ((bam_pileup1_t *)NULL);
-
-  /* "pysam/calignmentfile.pyx":1880
- *         self.plp = <bam_pileup1_t*>NULL
- * 
- *         if self.iterdata.seq != NULL:             # <<<<<<<<<<<<<<
- *             free(self.iterdata.seq)
- *             self.iterdata.seq = NULL
- */
-  __pyx_t_2 = ((__pyx_v_self->iterdata.seq != NULL) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":1881
- * 
- *         if self.iterdata.seq != NULL:
- *             free(self.iterdata.seq)             # <<<<<<<<<<<<<<
- *             self.iterdata.seq = NULL
- * 
- */
-    free(__pyx_v_self->iterdata.seq);
-
-    /* "pysam/calignmentfile.pyx":1882
- *         if self.iterdata.seq != NULL:
- *             free(self.iterdata.seq)
- *             self.iterdata.seq = NULL             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __pyx_v_self->iterdata.seq = NULL;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1874
- *             self.pileup_iter = <bam_plp_t>NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         # reset in order to avoid memory leak messages for iterators
- *         # that have not been fully consumed
- */
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_WriteUnraisable("pysam.calignmentfile.IteratorColumn.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/calignmentfile.pyx":1888
- *     '''iterates over a region only.
- *     '''
- *     def __cinit__(self, AlignmentFile samfile,             # <<<<<<<<<<<<<<
- *                   int tid = 0,
- *                   int start = 0,
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_20IteratorColumnRegion_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_20IteratorColumnRegion_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  int __pyx_v_tid;
-  int __pyx_v_start;
-  int __pyx_v_end;
-  int __pyx_v_truncate;
-  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
-  __Pyx_GOTREF(__pyx_v_kwargs);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,&__pyx_n_s_tid,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_truncate,0};
-    PyObject* values[5] = {0,0,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  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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tid);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_truncate);
-          if (value) { values[4] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __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);
-        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_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-    if (values[1]) {
-      __pyx_v_tid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_tid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_tid = ((int)0);
-    }
-    if (values[2]) {
-      __pyx_v_start = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_start == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_start = ((int)0);
-    }
-    if (values[3]) {
-      __pyx_v_end = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_end == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_end = __pyx_k__62;
-    }
-    if (values[4]) {
-      __pyx_v_truncate = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_truncate == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-
-      /* "pysam/calignmentfile.pyx":1892
- *                   int start = 0,
- *                   int end = max_pos,
- *                   int truncate = False,             # <<<<<<<<<<<<<<
- *                   **kwargs ):
- * 
- */
-      __pyx_v_truncate = ((int)0);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumnRegion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_20IteratorColumnRegion___cinit__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion *)__pyx_v_self), __pyx_v_samfile, __pyx_v_tid, __pyx_v_start, __pyx_v_end, __pyx_v_truncate, __pyx_v_kwargs);
-
-  /* "pysam/calignmentfile.pyx":1888
- *     '''iterates over a region only.
- *     '''
- *     def __cinit__(self, AlignmentFile samfile,             # <<<<<<<<<<<<<<
- *                   int tid = 0,
- *                   int start = 0,
- */
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_kwargs);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_20IteratorColumnRegion___cinit__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_tid, int __pyx_v_start, int __pyx_v_end, int __pyx_v_truncate, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData __pyx_t_2;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-  __Pyx_TraceCall("__cinit__", __pyx_f[0], 1888);
-
-  /* "pysam/calignmentfile.pyx":1896
- * 
- *         # initialize iterator
- *         self.setupIteratorData( tid, start, end, 1 )             # <<<<<<<<<<<<<<
- *         self.start = start
- *         self.end = end
- */
-  __pyx_t_2.__pyx_n = 1;
-  __pyx_t_2.multiple_iterators = 1;
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.setupIteratorData(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self), __pyx_v_tid, __pyx_v_start, __pyx_v_end, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1897
- *         # initialize iterator
- *         self.setupIteratorData( tid, start, end, 1 )
- *         self.start = start             # <<<<<<<<<<<<<<
- *         self.end = end
- *         self.truncate = truncate
- */
-  __pyx_v_self->start = __pyx_v_start;
-
-  /* "pysam/calignmentfile.pyx":1898
- *         self.setupIteratorData( tid, start, end, 1 )
- *         self.start = start
- *         self.end = end             # <<<<<<<<<<<<<<
- *         self.truncate = truncate
- * 
- */
-  __pyx_v_self->end = __pyx_v_end;
-
-  /* "pysam/calignmentfile.pyx":1899
- *         self.start = start
- *         self.end = end
- *         self.truncate = truncate             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __pyx_v_self->truncate = __pyx_v_truncate;
-
-  /* "pysam/calignmentfile.pyx":1888
- *     '''iterates over a region only.
- *     '''
- *     def __cinit__(self, AlignmentFile samfile,             # <<<<<<<<<<<<<<
- *                   int tid = 0,
- *                   int start = 0,
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumnRegion.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1901
- *         self.truncate = truncate
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_20IteratorColumnRegion_3__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__[] = "python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_20IteratorColumnRegion_3__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 1901);
-
-  /* "pysam/calignmentfile.pyx":1905
- *         """
- * 
- *         while 1:             # <<<<<<<<<<<<<<
- *             self.cnext()
- *             if self.n_plp < 0:
- */
-  while (1) {
-
-    /* "pysam/calignmentfile.pyx":1906
- * 
- *         while 1:
- *             self.cnext()             # <<<<<<<<<<<<<<
- *             if self.n_plp < 0:
- *                 raise ValueError("error during iteration" )
- */
-    ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.cnext(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self));
-
-    /* "pysam/calignmentfile.pyx":1907
- *         while 1:
- *             self.cnext()
- *             if self.n_plp < 0:             # <<<<<<<<<<<<<<
- *                 raise ValueError("error during iteration" )
- * 
- */
-    __pyx_t_1 = ((__pyx_v_self->__pyx_base.n_plp < 0) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1908
- *             self.cnext()
- *             if self.n_plp < 0:
- *                 raise ValueError("error during iteration" )             # <<<<<<<<<<<<<<
- * 
- *             if self.plp == NULL:
- */
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":1910
- *                 raise ValueError("error during iteration" )
- * 
- *             if self.plp == NULL:             # <<<<<<<<<<<<<<
- *                 raise StopIteration
- * 
- */
-    __pyx_t_1 = ((__pyx_v_self->__pyx_base.plp == NULL) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1911
- * 
- *             if self.plp == NULL:
- *                 raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *             if self.truncate:
- */
-      __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":1913
- *                 raise StopIteration
- * 
- *             if self.truncate:             # <<<<<<<<<<<<<<
- *                 if self.start > self.pos: continue
- *                 if self.pos >= self.end: raise StopIteration
- */
-    __pyx_t_1 = (__pyx_v_self->truncate != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1914
- * 
- *             if self.truncate:
- *                 if self.start > self.pos: continue             # <<<<<<<<<<<<<<
- *                 if self.pos >= self.end: raise StopIteration
- * 
- */
-      __pyx_t_1 = ((__pyx_v_self->start > __pyx_v_self->__pyx_base.pos) != 0);
-      if (__pyx_t_1) {
-        goto __pyx_L3_continue;
-      }
-
-      /* "pysam/calignmentfile.pyx":1915
- *             if self.truncate:
- *                 if self.start > self.pos: continue
- *                 if self.pos >= self.end: raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *             return makePileupColumn(&self.plp,
- */
-      __pyx_t_1 = ((__pyx_v_self->__pyx_base.pos >= __pyx_v_self->end) != 0);
-      if (__pyx_t_1) {
-        __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      goto __pyx_L7;
-    }
-    __pyx_L7:;
-
-    /* "pysam/calignmentfile.pyx":1917
- *                 if self.pos >= self.end: raise StopIteration
- * 
- *             return makePileupColumn(&self.plp,             # <<<<<<<<<<<<<<
- *                                    self.tid,
- *                                    self.pos,
- */
-    __Pyx_XDECREF(__pyx_r);
-
-    /* "pysam/calignmentfile.pyx":1920
- *                                    self.tid,
- *                                    self.pos,
- *                                    self.n_plp)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_makePileupColumn((&__pyx_v_self->__pyx_base.plp), __pyx_v_self->__pyx_base.tid, __pyx_v_self->__pyx_base.pos, __pyx_v_self->__pyx_base.n_plp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-    __pyx_L3_continue:;
-  }
-
-  /* "pysam/calignmentfile.pyx":1901
- *         self.truncate = truncate
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumnRegion.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1927
- *     """
- * 
- *     def __cinit__(self,             # <<<<<<<<<<<<<<
- *                   AlignmentFile samfile,
- *                   **kwargs):
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_21IteratorColumnAllRefs_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_21IteratorColumnAllRefs_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
-  __Pyx_GOTREF(__pyx_v_kwargs);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,0};
-    PyObject* values[1] = {0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-    }
-    __pyx_v_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumnAllRefs.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_21IteratorColumnAllRefs___cinit__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs *)__pyx_v_self), __pyx_v_samfile, __pyx_v_kwargs);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_kwargs);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_21IteratorColumnAllRefs___cinit__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-  __Pyx_TraceCall("__cinit__", __pyx_f[0], 1927);
-
-  /* "pysam/calignmentfile.pyx":1932
- * 
- *         # no iteration over empty files
- *         if not samfile.nreferences:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_samfile), __pyx_n_s_nreferences); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = ((!__pyx_t_2) != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":1933
- *         # no iteration over empty files
- *         if not samfile.nreferences:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *         # initialize iterator
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":1936
- * 
- *         # initialize iterator
- *         self.setupIteratorData(self.tid, 0, max_pos, 1)             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __pyx_t_4.__pyx_n = 1;
-  __pyx_t_4.multiple_iterators = 1;
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.setupIteratorData(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self), __pyx_v_self->__pyx_base.tid, 0, __pyx_v_5pysam_14calignmentfile_max_pos, &__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1927
- *     """
- * 
- *     def __cinit__(self,             # <<<<<<<<<<<<<<
- *                   AlignmentFile samfile,
- *                   **kwargs):
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumnAllRefs.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1938
- *         self.setupIteratorData(self.tid, 0, max_pos, 1)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_21IteratorColumnAllRefs_3__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__[] = "python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_21IteratorColumnAllRefs_3__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData __pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 1938);
-
-  /* "pysam/calignmentfile.pyx":1942
- *         """
- * 
- *         while 1:             # <<<<<<<<<<<<<<
- *             self.cnext()
- * 
- */
-  while (1) {
-
-    /* "pysam/calignmentfile.pyx":1943
- * 
- *         while 1:
- *             self.cnext()             # <<<<<<<<<<<<<<
- * 
- *             if self.n_plp < 0:
- */
-    ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.cnext(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self));
-
-    /* "pysam/calignmentfile.pyx":1945
- *             self.cnext()
- * 
- *             if self.n_plp < 0:             # <<<<<<<<<<<<<<
- *                 raise ValueError("error during iteration" )
- * 
- */
-    __pyx_t_1 = ((__pyx_v_self->__pyx_base.n_plp < 0) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1946
- * 
- *             if self.n_plp < 0:
- *                 raise ValueError("error during iteration" )             # <<<<<<<<<<<<<<
- * 
- *             # return result, if within same reference
- */
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/calignmentfile.pyx":1949
- * 
- *             # return result, if within same reference
- *             if self.plp != NULL:             # <<<<<<<<<<<<<<
- *                 return makePileupColumn(&self.plp,
- *                                        self.tid,
- */
-    __pyx_t_1 = ((__pyx_v_self->__pyx_base.plp != NULL) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1950
- *             # return result, if within same reference
- *             if self.plp != NULL:
- *                 return makePileupColumn(&self.plp,             # <<<<<<<<<<<<<<
- *                                        self.tid,
- *                                        self.pos,
- */
-      __Pyx_XDECREF(__pyx_r);
-
-      /* "pysam/calignmentfile.pyx":1953
- *                                        self.tid,
- *                                        self.pos,
- *                                        self.n_plp)             # <<<<<<<<<<<<<<
- * 
- *             # otherwise, proceed to next reference or stop
- */
-      __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_makePileupColumn((&__pyx_v_self->__pyx_base.plp), __pyx_v_self->__pyx_base.tid, __pyx_v_self->__pyx_base.pos, __pyx_v_self->__pyx_base.n_plp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_r = __pyx_t_2;
-      __pyx_t_2 = 0;
-      goto __pyx_L0;
-    }
-
-    /* "pysam/calignmentfile.pyx":1956
- * 
- *             # otherwise, proceed to next reference or stop
- *             self.tid += 1             # <<<<<<<<<<<<<<
- *             if self.tid < self.samfile.nreferences:
- *                 self.setupIteratorData(self.tid, 0, max_pos, 0)
- */
-    __pyx_v_self->__pyx_base.tid = (__pyx_v_self->__pyx_base.tid + 1);
-
-    /* "pysam/calignmentfile.pyx":1957
- *             # otherwise, proceed to next reference or stop
- *             self.tid += 1
- *             if self.tid < self.samfile.nreferences:             # <<<<<<<<<<<<<<
- *                 self.setupIteratorData(self.tid, 0, max_pos, 0)
- *             else:
- */
-    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.tid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.samfile), __pyx_n_s_nreferences); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":1958
- *             self.tid += 1
- *             if self.tid < self.samfile.nreferences:
- *                 self.setupIteratorData(self.tid, 0, max_pos, 0)             # <<<<<<<<<<<<<<
- *             else:
- *                 raise StopIteration
- */
-      __pyx_t_5.__pyx_n = 1;
-      __pyx_t_5.multiple_iterators = 0;
-      __pyx_t_4 = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.setupIteratorData(((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)__pyx_v_self), __pyx_v_self->__pyx_base.tid, 0, __pyx_v_5pysam_14calignmentfile_max_pos, &__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L7;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":1960
- *                 self.setupIteratorData(self.tid, 0, max_pos, 0)
- *             else:
- *                 raise StopIteration             # <<<<<<<<<<<<<<
- * 
- * 
- */
-      __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __pyx_L7:;
-  }
-
-  /* "pysam/calignmentfile.pyx":1938
- *         self.setupIteratorData(self.tid, 0, max_pos, 1)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.IteratorColumnAllRefs.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1963
- * 
- * 
- * cdef inline int32_t _getQueryStart(bam1_t *src) except -1:             # <<<<<<<<<<<<<<
- *     cdef uint32_t * cigar_p
- *     cdef uint32_t k, op
- */
-
-static CYTHON_INLINE int32_t __pyx_f_5pysam_14calignmentfile__getQueryStart(bam1_t *__pyx_v_src) {
-  uint32_t *__pyx_v_cigar_p;
-  uint32_t __pyx_v_k;
-  uint32_t __pyx_v_op;
-  uint32_t __pyx_v_start_offset;
-  int32_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  uint16_t __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_getQueryStart", 0);
-  __Pyx_TraceCall("_getQueryStart", __pyx_f[0], 1963);
-
-  /* "pysam/calignmentfile.pyx":1966
- *     cdef uint32_t * cigar_p
- *     cdef uint32_t k, op
- *     cdef uint32_t start_offset = 0             # <<<<<<<<<<<<<<
- * 
- *     if pysam_get_n_cigar(src):
- */
-  __pyx_v_start_offset = 0;
-
-  /* "pysam/calignmentfile.pyx":1968
- *     cdef uint32_t start_offset = 0
- * 
- *     if pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *         cigar_p = pysam_bam_get_cigar(src);
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- */
-  __pyx_t_1 = (pysam_get_n_cigar(__pyx_v_src) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":1969
- * 
- *     if pysam_get_n_cigar(src):
- *         cigar_p = pysam_bam_get_cigar(src);             # <<<<<<<<<<<<<<
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- */
-    __pyx_v_cigar_p = pysam_bam_get_cigar(__pyx_v_src);
-
-    /* "pysam/calignmentfile.pyx":1970
- *     if pysam_get_n_cigar(src):
- *         cigar_p = pysam_bam_get_cigar(src);
- *         for k from 0 <= k < pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             if op == BAM_CHARD_CLIP:
- */
-    __pyx_t_2 = pysam_get_n_cigar(__pyx_v_src);
-    for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_2; __pyx_v_k++) {
-
-      /* "pysam/calignmentfile.pyx":1971
- *         cigar_p = pysam_bam_get_cigar(src);
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK             # <<<<<<<<<<<<<<
- *             if op == BAM_CHARD_CLIP:
- *                 if start_offset != 0 and start_offset != src.core.l_qseq:
- */
-      __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & BAM_CIGAR_MASK);
-
-      /* "pysam/calignmentfile.pyx":1972
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             if op == BAM_CHARD_CLIP:             # <<<<<<<<<<<<<<
- *                 if start_offset != 0 and start_offset != src.core.l_qseq:
- *                     PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
- */
-      __pyx_t_1 = ((__pyx_v_op == BAM_CHARD_CLIP) != 0);
-      if (__pyx_t_1) {
-
-        /* "pysam/calignmentfile.pyx":1973
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             if op == BAM_CHARD_CLIP:
- *                 if start_offset != 0 and start_offset != src.core.l_qseq:             # <<<<<<<<<<<<<<
- *                     PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
- *                     return -1
- */
-        __pyx_t_1 = ((__pyx_v_start_offset != 0) != 0);
-        if (__pyx_t_1) {
-          __pyx_t_3 = ((__pyx_v_start_offset != __pyx_v_src->core.l_qseq) != 0);
-          __pyx_t_4 = __pyx_t_3;
-        } else {
-          __pyx_t_4 = __pyx_t_1;
-        }
-        if (__pyx_t_4) {
-
-          /* "pysam/calignmentfile.pyx":1974
- *             if op == BAM_CHARD_CLIP:
- *                 if start_offset != 0 and start_offset != src.core.l_qseq:
- *                     PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')             # <<<<<<<<<<<<<<
- *                     return -1
- *             elif op == BAM_CSOFT_CLIP:
- */
-          PyErr_SetString(__pyx_builtin_ValueError, __pyx_k_Invalid_clipping_in_CIGAR_string);
-
-          /* "pysam/calignmentfile.pyx":1975
- *                 if start_offset != 0 and start_offset != src.core.l_qseq:
- *                     PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
- *                     return -1             # <<<<<<<<<<<<<<
- *             elif op == BAM_CSOFT_CLIP:
- *                 start_offset += cigar_p[k] >> BAM_CIGAR_SHIFT
- */
-          __pyx_r = -1;
-          goto __pyx_L0;
-        }
-        goto __pyx_L6;
-      }
-
-      /* "pysam/calignmentfile.pyx":1976
- *                     PyErr_SetString(ValueError, 'Invalid clipping in CIGAR string')
- *                     return -1
- *             elif op == BAM_CSOFT_CLIP:             # <<<<<<<<<<<<<<
- *                 start_offset += cigar_p[k] >> BAM_CIGAR_SHIFT
- *             else:
- */
-      __pyx_t_4 = ((__pyx_v_op == BAM_CSOFT_CLIP) != 0);
-      if (__pyx_t_4) {
-
-        /* "pysam/calignmentfile.pyx":1977
- *                     return -1
- *             elif op == BAM_CSOFT_CLIP:
- *                 start_offset += cigar_p[k] >> BAM_CIGAR_SHIFT             # <<<<<<<<<<<<<<
- *             else:
- *                 break
- */
-        __pyx_v_start_offset = (__pyx_v_start_offset + ((__pyx_v_cigar_p[__pyx_v_k]) >> BAM_CIGAR_SHIFT));
-        goto __pyx_L6;
-      }
-      /*else*/ {
-
-        /* "pysam/calignmentfile.pyx":1979
- *                 start_offset += cigar_p[k] >> BAM_CIGAR_SHIFT
- *             else:
- *                 break             # <<<<<<<<<<<<<<
- * 
- *     return start_offset
- */
-        goto __pyx_L5_break;
-      }
-      __pyx_L6:;
-    }
-    __pyx_L5_break:;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":1981
- *                 break
- * 
- *     return start_offset             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_r = __pyx_v_start_offset;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1963
- * 
- * 
- * cdef inline int32_t _getQueryStart(bam1_t *src) except -1:             # <<<<<<<<<<<<<<
- *     cdef uint32_t * cigar_p
- *     cdef uint32_t k, op
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":1984
- * 
- * 
- * cdef inline int32_t _getQueryEnd(bam1_t *src) except -1:             # <<<<<<<<<<<<<<
- *     cdef uint32_t * cigar_p
- *     cdef uint32_t k, op
- */
-
-static CYTHON_INLINE int32_t __pyx_f_5pysam_14calignmentfile__getQueryEnd(bam1_t *__pyx_v_src) {
-  uint32_t *__pyx_v_cigar_p;
-  uint32_t __pyx_v_k;
-  uint32_t __pyx_v_op;
-  uint32_t __pyx_v_end_offset;
-  int32_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int32_t __pyx_t_1;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_getQueryEnd", 0);
-  __Pyx_TraceCall("_getQueryEnd", __pyx_f[0], 1984);
-
-  /* "pysam/calignmentfile.pyx":1987
- *     cdef uint32_t * cigar_p
- *     cdef uint32_t k, op
- *     cdef uint32_t end_offset = src.core.l_qseq             # <<<<<<<<<<<<<<
- * 
- *     if pysam_get_n_cigar(src) > 1:
- */
-  __pyx_t_1 = __pyx_v_src->core.l_qseq;
-  __pyx_v_end_offset = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":1989
- *     cdef uint32_t end_offset = src.core.l_qseq
- * 
- *     if pysam_get_n_cigar(src) > 1:             # <<<<<<<<<<<<<<
- *         cigar_p = pysam_bam_get_cigar(src);
- *         for k from pysam_get_n_cigar(src) > k >= 1:
- */
-  __pyx_t_2 = ((pysam_get_n_cigar(__pyx_v_src) > 1) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":1990
- * 
- *     if pysam_get_n_cigar(src) > 1:
- *         cigar_p = pysam_bam_get_cigar(src);             # <<<<<<<<<<<<<<
- *         for k from pysam_get_n_cigar(src) > k >= 1:
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- */
-    __pyx_v_cigar_p = pysam_bam_get_cigar(__pyx_v_src);
-
-    /* "pysam/calignmentfile.pyx":1991
- *     if pysam_get_n_cigar(src) > 1:
- *         cigar_p = pysam_bam_get_cigar(src);
- *         for k from pysam_get_n_cigar(src) > k >= 1:             # <<<<<<<<<<<<<<
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             if op == BAM_CHARD_CLIP:
- */
-    for (__pyx_v_k = pysam_get_n_cigar(__pyx_v_src)-1; __pyx_v_k >= 1; __pyx_v_k--) {
-
-      /* "pysam/calignmentfile.pyx":1992
- *         cigar_p = pysam_bam_get_cigar(src);
- *         for k from pysam_get_n_cigar(src) > k >= 1:
- *             op = cigar_p[k] & BAM_CIGAR_MASK             # <<<<<<<<<<<<<<
- *             if op == BAM_CHARD_CLIP:
- *                 if end_offset != 0 and end_offset != src.core.l_qseq:
- */
-      __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & BAM_CIGAR_MASK);
-
-      /* "pysam/calignmentfile.pyx":1993
- *         for k from pysam_get_n_cigar(src) > k >= 1:
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             if op == BAM_CHARD_CLIP:             # <<<<<<<<<<<<<<
- *                 if end_offset != 0 and end_offset != src.core.l_qseq:
- *                     PyErr_SetString(ValueError,
- */
-      __pyx_t_2 = ((__pyx_v_op == BAM_CHARD_CLIP) != 0);
-      if (__pyx_t_2) {
-
-        /* "pysam/calignmentfile.pyx":1994
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             if op == BAM_CHARD_CLIP:
- *                 if end_offset != 0 and end_offset != src.core.l_qseq:             # <<<<<<<<<<<<<<
- *                     PyErr_SetString(ValueError,
- *                                     'Invalid clipping in CIGAR string')
- */
-        __pyx_t_2 = ((__pyx_v_end_offset != 0) != 0);
-        if (__pyx_t_2) {
-          __pyx_t_3 = ((__pyx_v_end_offset != __pyx_v_src->core.l_qseq) != 0);
-          __pyx_t_4 = __pyx_t_3;
-        } else {
-          __pyx_t_4 = __pyx_t_2;
-        }
-        if (__pyx_t_4) {
-
-          /* "pysam/calignmentfile.pyx":1995
- *             if op == BAM_CHARD_CLIP:
- *                 if end_offset != 0 and end_offset != src.core.l_qseq:
- *                     PyErr_SetString(ValueError,             # <<<<<<<<<<<<<<
- *                                     'Invalid clipping in CIGAR string')
- *                     return -1
- */
-          PyErr_SetString(__pyx_builtin_ValueError, __pyx_k_Invalid_clipping_in_CIGAR_string);
-
-          /* "pysam/calignmentfile.pyx":1997
- *                     PyErr_SetString(ValueError,
- *                                     'Invalid clipping in CIGAR string')
- *                     return -1             # <<<<<<<<<<<<<<
- *             elif op == BAM_CSOFT_CLIP:
- *                 end_offset -= cigar_p[k] >> BAM_CIGAR_SHIFT
- */
-          __pyx_r = -1;
-          goto __pyx_L0;
-        }
-        goto __pyx_L6;
-      }
-
-      /* "pysam/calignmentfile.pyx":1998
- *                                     'Invalid clipping in CIGAR string')
- *                     return -1
- *             elif op == BAM_CSOFT_CLIP:             # <<<<<<<<<<<<<<
- *                 end_offset -= cigar_p[k] >> BAM_CIGAR_SHIFT
- *             else:
- */
-      __pyx_t_4 = ((__pyx_v_op == BAM_CSOFT_CLIP) != 0);
-      if (__pyx_t_4) {
-
-        /* "pysam/calignmentfile.pyx":1999
- *                     return -1
- *             elif op == BAM_CSOFT_CLIP:
- *                 end_offset -= cigar_p[k] >> BAM_CIGAR_SHIFT             # <<<<<<<<<<<<<<
- *             else:
- *                 break
- */
-        __pyx_v_end_offset = (__pyx_v_end_offset - ((__pyx_v_cigar_p[__pyx_v_k]) >> BAM_CIGAR_SHIFT));
-        goto __pyx_L6;
-      }
-      /*else*/ {
-
-        /* "pysam/calignmentfile.pyx":2001
- *                 end_offset -= cigar_p[k] >> BAM_CIGAR_SHIFT
- *             else:
- *                 break             # <<<<<<<<<<<<<<
- * 
- *     if end_offset == 0:
- */
-        goto __pyx_L5_break;
-      }
-      __pyx_L6:;
-    }
-    __pyx_L5_break:;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":2003
- *                 break
- * 
- *     if end_offset == 0:             # <<<<<<<<<<<<<<
- *         end_offset = src.core.l_qseq
- * 
- */
-  __pyx_t_4 = ((__pyx_v_end_offset == 0) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":2004
- * 
- *     if end_offset == 0:
- *         end_offset = src.core.l_qseq             # <<<<<<<<<<<<<<
- * 
- *     return end_offset
- */
-    __pyx_t_1 = __pyx_v_src->core.l_qseq;
-    __pyx_v_end_offset = __pyx_t_1;
-    goto __pyx_L8;
-  }
-  __pyx_L8:;
-
-  /* "pysam/calignmentfile.pyx":2006
- *         end_offset = src.core.l_qseq
- * 
- *     return end_offset             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_r = __pyx_v_end_offset;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":1984
- * 
- * 
- * cdef inline int32_t _getQueryEnd(bam1_t *src) except -1:             # <<<<<<<<<<<<<<
- *     cdef uint32_t * cigar_p
- *     cdef uint32_t k, op
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2009
- * 
- * 
- * cdef inline object _getSequenceRange(bam1_t *src,             # <<<<<<<<<<<<<<
- *                                      uint32_t start, uint32_t end):
- *     cdef uint8_t * p
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_14calignmentfile__getSequenceRange(bam1_t *__pyx_v_src, uint32_t __pyx_v_start, uint32_t __pyx_v_end) {
-  uint8_t *__pyx_v_p;
-  uint32_t __pyx_v_k;
-  char *__pyx_v_s;
-  PyObject *__pyx_v_seq = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  char *__pyx_t_3;
-  uint32_t __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_getSequenceRange", 0);
-  __Pyx_TraceCall("_getSequenceRange", __pyx_f[0], 2009);
-
-  /* "pysam/calignmentfile.pyx":2015
- *     cdef char * s
- * 
- *     if not src.core.l_qseq:             # <<<<<<<<<<<<<<
- *         return None
- * 
- */
-  __pyx_t_1 = ((!(__pyx_v_src->core.l_qseq != 0)) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":2016
- * 
- *     if not src.core.l_qseq:
- *         return None             # <<<<<<<<<<<<<<
- * 
- *     seq = PyBytes_FromStringAndSize(NULL, end - start)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2018
- *         return None
- * 
- *     seq = PyBytes_FromStringAndSize(NULL, end - start)             # <<<<<<<<<<<<<<
- *     s   = <char*>seq
- *     p   = pysam_bam_get_seq(src)
- */
-  __pyx_t_2 = PyBytes_FromStringAndSize(NULL, (__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_seq = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":2019
- * 
- *     seq = PyBytes_FromStringAndSize(NULL, end - start)
- *     s   = <char*>seq             # <<<<<<<<<<<<<<
- *     p   = pysam_bam_get_seq(src)
- * 
- */
-  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_seq); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_s = ((char *)__pyx_t_3);
-
-  /* "pysam/calignmentfile.pyx":2020
- *     seq = PyBytes_FromStringAndSize(NULL, end - start)
- *     s   = <char*>seq
- *     p   = pysam_bam_get_seq(src)             # <<<<<<<<<<<<<<
- * 
- *     for k from start <= k < end:
- */
-  __pyx_v_p = pysam_bam_get_seq(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2022
- *     p   = pysam_bam_get_seq(src)
- * 
- *     for k from start <= k < end:             # <<<<<<<<<<<<<<
- *         # equivalent to seq_nt16_str[bam1_seqi(s, i)] (see bam.c)
- *         # note: do not use string literal as it will be a python string
- */
-  __pyx_t_4 = __pyx_v_end;
-  for (__pyx_v_k = __pyx_v_start; __pyx_v_k < __pyx_t_4; __pyx_v_k++) {
-
-    /* "pysam/calignmentfile.pyx":2025
- *         # equivalent to seq_nt16_str[bam1_seqi(s, i)] (see bam.c)
- *         # note: do not use string literal as it will be a python string
- *         s[k-start] = seq_nt16_str[p[k/2] >> 4 * (1 - k%2) & 0xf]             # <<<<<<<<<<<<<<
- * 
- *     return _charptr_to_str(seq)
- */
-    (__pyx_v_s[(__pyx_v_k - __pyx_v_start)]) = (seq_nt16_str[(((__pyx_v_p[__Pyx_div_long(__pyx_v_k, 2)]) >> (4 * (1 - __Pyx_mod_long(__pyx_v_k, 2)))) & 0xf)]);
-  }
-
-  /* "pysam/calignmentfile.pyx":2027
- *         s[k-start] = seq_nt16_str[p[k/2] >> 4 * (1 - k%2) & 0xf]
- * 
- *     return _charptr_to_str(seq)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_seq); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __pyx_f_5pysam_14calignmentfile__charptr_to_str(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2009
- * 
- * 
- * cdef inline object _getSequenceRange(bam1_t *src,             # <<<<<<<<<<<<<<
- *                                      uint32_t start, uint32_t end):
- *     cdef uint8_t * p
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile._getSequenceRange", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_seq);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2030
- * 
- * 
- * cdef inline object _getQualitiesRange(bam1_t *src,             # <<<<<<<<<<<<<<
- *                                       uint32_t start,
- *                                       uint32_t end):
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_14calignmentfile__getQualitiesRange(bam1_t *__pyx_v_src, uint32_t __pyx_v_start, uint32_t __pyx_v_end) {
-  uint8_t *__pyx_v_p;
-  arrayobject *__pyx_v_result = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_getQualitiesRange", 0);
-  __Pyx_TraceCall("_getQualitiesRange", __pyx_f[0], 2030);
-
-  /* "pysam/calignmentfile.pyx":2038
- *     cdef uint32_t k
- * 
- *     p = pysam_bam_get_qual(src)             # <<<<<<<<<<<<<<
- *     if p[0] == 0xff:
- *         return None
- */
-  __pyx_v_p = pysam_bam_get_qual(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2039
- * 
- *     p = pysam_bam_get_qual(src)
- *     if p[0] == 0xff:             # <<<<<<<<<<<<<<
- *         return None
- * 
- */
-  __pyx_t_1 = (((__pyx_v_p[0]) == 0xff) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":2040
- *     p = pysam_bam_get_qual(src)
- *     if p[0] == 0xff:
- *         return None             # <<<<<<<<<<<<<<
- * 
- *     # 'B': unsigned char
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2043
- * 
- *     # 'B': unsigned char
- *     cdef array.array result = array.array('B', [0])             # <<<<<<<<<<<<<<
- *     array.resize(result, end - start)
- * 
- */
-  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_0);
-  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_n_s_B);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_B);
-  __Pyx_GIVEREF(__pyx_n_s_B);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cpython_5array_array)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_v_result = ((arrayobject *)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":2044
- *     # 'B': unsigned char
- *     cdef array.array result = array.array('B', [0])
- *     array.resize(result, end - start)             # <<<<<<<<<<<<<<
- * 
- *     # copy data
- */
-  __pyx_t_4 = resize(__pyx_v_result, (__pyx_v_end - __pyx_v_start)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":2047
- * 
- *     # copy data
- *     memcpy(result.data.as_voidptr, <void*>&p[start], end - start)             # <<<<<<<<<<<<<<
- * 
- *     return result
- */
-  memcpy(__pyx_v_result->data.as_voidptr, ((void *)(&(__pyx_v_p[__pyx_v_start]))), (__pyx_v_end - __pyx_v_start));
-
-  /* "pysam/calignmentfile.pyx":2049
- *     memcpy(result.data.as_voidptr, <void*>&p[start], end - start)
- * 
- *     return result             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_result));
-  __pyx_r = ((PyObject *)__pyx_v_result);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2030
- * 
- * 
- * cdef inline object _getQualitiesRange(bam1_t *src,             # <<<<<<<<<<<<<<
- *                                       uint32_t start,
- *                                       uint32_t end):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile._getQualitiesRange", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_result);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2052
- * 
- * 
- * def toQualityString(qualities):             # <<<<<<<<<<<<<<
- *     '''convert a list of quality score to the string
- *     representation used in the SAM format.'''
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_1toQualityString(PyObject *__pyx_self, PyObject *__pyx_v_qualities); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_toQualityString[] = "toQualityString(qualities)\nconvert a list of quality score to the string\n    representation used in the SAM format.";
-static PyMethodDef __pyx_mdef_5pysam_14calignmentfile_1toQualityString = {__Pyx_NAMESTR("toQualityString"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_1toQualityString, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_toQualityString)};
-static PyObject *__pyx_pw_5pysam_14calignmentfile_1toQualityString(PyObject *__pyx_self, PyObject *__pyx_v_qualities) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("toQualityString (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_toQualityString(__pyx_self, ((PyObject *)__pyx_v_qualities));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_toQualityString(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_qualities) {
-  PyObject *__pyx_v_x = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  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("toQualityString", 0);
-  __Pyx_TraceCall("toQualityString", __pyx_f[0], 2052);
-
-  /* "pysam/calignmentfile.pyx":2055
- *     '''convert a list of quality score to the string
- *     representation used in the SAM format.'''
- *     if qualities is None:             # <<<<<<<<<<<<<<
- *         return None
- *     return "".join([chr(x+33) for x in qualities])
- */
-  __pyx_t_1 = (__pyx_v_qualities == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2056
- *     representation used in the SAM format.'''
- *     if qualities is None:
- *         return None             # <<<<<<<<<<<<<<
- *     return "".join([chr(x+33) for x in qualities])
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2057
- *     if qualities is None:
- *         return None
- *     return "".join([chr(x+33) for x in qualities])             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  if (PyList_CheckExact(__pyx_v_qualities) || PyTuple_CheckExact(__pyx_v_qualities)) {
-    __pyx_t_4 = __pyx_v_qualities; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
-    __pyx_t_6 = NULL;
-  } else {
-    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_qualities); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
-      if (unlikely(!__pyx_t_7)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_7);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Add(__pyx_v_x, __pyx_int_33); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2052
- * 
- * 
- * def toQualityString(qualities):             # <<<<<<<<<<<<<<
- *     '''convert a list of quality score to the string
- *     representation used in the SAM format.'''
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.calignmentfile.toQualityString", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2060
- * 
- * 
- * def fromQualityString(quality_string):             # <<<<<<<<<<<<<<
- *     '''return a list of quality scores from the
- *     stringn representation of quality scores used
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_3fromQualityString(PyObject *__pyx_self, PyObject *__pyx_v_quality_string); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_2fromQualityString[] = "fromQualityString(quality_string)\nreturn a list of quality scores from the\n    stringn representation of quality scores used\n    in the SAM format.";
-static PyMethodDef __pyx_mdef_5pysam_14calignmentfile_3fromQualityString = {__Pyx_NAMESTR("fromQualityString"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_3fromQualityString, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_2fromQualityString)};
-static PyObject *__pyx_pw_5pysam_14calignmentfile_3fromQualityString(PyObject *__pyx_self, PyObject *__pyx_v_quality_string) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("fromQualityString (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_2fromQualityString(__pyx_self, ((PyObject *)__pyx_v_quality_string));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_2fromQualityString(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_quality_string) {
-  PyObject *__pyx_v_x = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  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("fromQualityString", 0);
-  __Pyx_TraceCall("fromQualityString", __pyx_f[0], 2060);
-
-  /* "pysam/calignmentfile.pyx":2064
- *     stringn representation of quality scores used
- *     in the SAM format.'''
- *     if quality_string is None:             # <<<<<<<<<<<<<<
- *         return None
- *     return array.array('B', [ord(x)-33 for x in quality_string])
- */
-  __pyx_t_1 = (__pyx_v_quality_string == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2065
- *     in the SAM format.'''
- *     if quality_string is None:
- *         return None             # <<<<<<<<<<<<<<
- *     return array.array('B', [ord(x)-33 for x in quality_string])
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2066
- *     if quality_string is None:
- *         return None
- *     return array.array('B', [ord(x)-33 for x in quality_string])             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  if (PyList_CheckExact(__pyx_v_quality_string) || PyTuple_CheckExact(__pyx_v_quality_string)) {
-    __pyx_t_4 = __pyx_v_quality_string; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
-    __pyx_t_6 = NULL;
-  } else {
-    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_quality_string); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
-      if (unlikely(!__pyx_t_7)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_7);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_x);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_x);
-    __Pyx_GIVEREF(__pyx_v_x);
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Subtract(__pyx_t_8, __pyx_int_33); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_n_s_B);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_B);
-  __Pyx_GIVEREF(__pyx_n_s_B);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cpython_5array_array)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2060
- * 
- * 
- * def fromQualityString(quality_string):             # <<<<<<<<<<<<<<
- *     '''return a list of quality scores from the
- *     stringn representation of quality scores used
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.calignmentfile.fromQualityString", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2069
- * 
- * 
- * cdef inline uint8_t _getTypeCode(value, value_type = None):             # <<<<<<<<<<<<<<
- *     '''guess type code for a *value*. If *value_type* is None,
- *     the type code will be inferred based on the Python type of
- */
-
-static CYTHON_INLINE uint8_t __pyx_f_5pysam_14calignmentfile__getTypeCode(PyObject *__pyx_v_value, struct __pyx_opt_args_5pysam_14calignmentfile__getTypeCode *__pyx_optional_args) {
-  PyObject *__pyx_v_value_type = ((PyObject *)Py_None);
-  uint8_t __pyx_v_type_code;
-  char *__pyx_v__char_type;
-  uint8_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  char *__pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_getTypeCode", 0);
-  __Pyx_TraceCall("_getTypeCode", __pyx_f[0], 2069);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_value_type = __pyx_optional_args->value_type;
-    }
-  }
-  __Pyx_INCREF(__pyx_v_value_type);
-
-  /* "pysam/calignmentfile.pyx":2076
- *     cdef char * _char_type
- * 
- *     if value_type is None:             # <<<<<<<<<<<<<<
- *         if isinstance(value, int):
- *             type_code = 'i'
- */
-  __pyx_t_1 = (__pyx_v_value_type == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2077
- * 
- *     if value_type is None:
- *         if isinstance(value, int):             # <<<<<<<<<<<<<<
- *             type_code = 'i'
- *         elif isinstance(value, float):
- */
-    __pyx_t_2 = PyInt_Check(__pyx_v_value); 
-    __pyx_t_1 = (__pyx_t_2 != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":2078
- *     if value_type is None:
- *         if isinstance(value, int):
- *             type_code = 'i'             # <<<<<<<<<<<<<<
- *         elif isinstance(value, float):
- *             type_code = 'd'
- */
-      __pyx_v_type_code = 'i';
-      goto __pyx_L4;
-    }
-
-    /* "pysam/calignmentfile.pyx":2079
- *         if isinstance(value, int):
- *             type_code = 'i'
- *         elif isinstance(value, float):             # <<<<<<<<<<<<<<
- *             type_code = 'd'
- *         elif isinstance(value, str):
- */
-    __pyx_t_1 = PyFloat_Check(__pyx_v_value); 
-    __pyx_t_2 = (__pyx_t_1 != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":2080
- *             type_code = 'i'
- *         elif isinstance(value, float):
- *             type_code = 'd'             # <<<<<<<<<<<<<<
- *         elif isinstance(value, str):
- *             type_code = 'Z'
- */
-      __pyx_v_type_code = 'd';
-      goto __pyx_L4;
-    }
-
-    /* "pysam/calignmentfile.pyx":2081
- *         elif isinstance(value, float):
- *             type_code = 'd'
- *         elif isinstance(value, str):             # <<<<<<<<<<<<<<
- *             type_code = 'Z'
- *         elif isinstance(value, bytes):
- */
-    __pyx_t_2 = PyString_Check(__pyx_v_value); 
-    __pyx_t_1 = (__pyx_t_2 != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":2082
- *             type_code = 'd'
- *         elif isinstance(value, str):
- *             type_code = 'Z'             # <<<<<<<<<<<<<<
- *         elif isinstance(value, bytes):
- *             type_code = 'Z'
- */
-      __pyx_v_type_code = 'Z';
-      goto __pyx_L4;
-    }
-
-    /* "pysam/calignmentfile.pyx":2083
- *         elif isinstance(value, str):
- *             type_code = 'Z'
- *         elif isinstance(value, bytes):             # <<<<<<<<<<<<<<
- *             type_code = 'Z'
- *         else:
- */
-    __pyx_t_1 = PyBytes_Check(__pyx_v_value); 
-    __pyx_t_2 = (__pyx_t_1 != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":2084
- *             type_code = 'Z'
- *         elif isinstance(value, bytes):
- *             type_code = 'Z'             # <<<<<<<<<<<<<<
- *         else:
- *             return 0
- */
-      __pyx_v_type_code = 'Z';
-      goto __pyx_L4;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":2086
- *             type_code = 'Z'
- *         else:
- *             return 0             # <<<<<<<<<<<<<<
- *     else:
- *         if value_type not in 'Zidf':
- */
-      __pyx_r = 0;
-      goto __pyx_L0;
-    }
-    __pyx_L4:;
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":2088
- *             return 0
- *     else:
- *         if value_type not in 'Zidf':             # <<<<<<<<<<<<<<
- *             return 0
- *         value_type = _forceBytes( value_type )
- */
-    __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_value_type, __pyx_n_s_Zidf, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = (__pyx_t_2 != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/calignmentfile.pyx":2089
- *     else:
- *         if value_type not in 'Zidf':
- *             return 0             # <<<<<<<<<<<<<<
- *         value_type = _forceBytes( value_type )
- *         _char_type = value_type
- */
-      __pyx_r = 0;
-      goto __pyx_L0;
-    }
-
-    /* "pysam/calignmentfile.pyx":2090
- *         if value_type not in 'Zidf':
- *             return 0
- *         value_type = _forceBytes( value_type )             # <<<<<<<<<<<<<<
- *         _char_type = value_type
- *         type_code = (<uint8_t*>_char_type)[0]
- */
-    __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_value_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF_SET(__pyx_v_value_type, __pyx_t_3);
-    __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2091
- *             return 0
- *         value_type = _forceBytes( value_type )
- *         _char_type = value_type             # <<<<<<<<<<<<<<
- *         type_code = (<uint8_t*>_char_type)[0]
- * 
- */
-    __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_value_type); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v__char_type = __pyx_t_4;
-
-    /* "pysam/calignmentfile.pyx":2092
- *         value_type = _forceBytes( value_type )
- *         _char_type = value_type
- *         type_code = (<uint8_t*>_char_type)[0]             # <<<<<<<<<<<<<<
- * 
- *     return type_code
- */
-    __pyx_v_type_code = (((uint8_t *)__pyx_v__char_type)[0]);
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":2094
- *         type_code = (<uint8_t*>_char_type)[0]
- * 
- *     return type_code             # <<<<<<<<<<<<<<
- * 
- * cdef inline convert_python_tag(pytag, value, fmts, args):
- */
-  __pyx_r = __pyx_v_type_code;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2069
- * 
- * 
- * cdef inline uint8_t _getTypeCode(value, value_type = None):             # <<<<<<<<<<<<<<
- *     '''guess type code for a *value*. If *value_type* is None,
- *     the type code will be inferred based on the Python type of
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_WriteUnraisable("pysam.calignmentfile._getTypeCode", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_value_type);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2096
- *     return type_code
- * 
- * cdef inline convert_python_tag(pytag, value, fmts, args):             # <<<<<<<<<<<<<<
- * 
- *     if not type(pytag) is bytes:
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_14calignmentfile_convert_python_tag(PyObject *__pyx_v_pytag, PyObject *__pyx_v_value, PyObject *__pyx_v_fmts, PyObject *__pyx_v_args) {
-  PyObject *__pyx_v_t = NULL;
-  PyObject *__pyx_v_pytype = NULL;
-  PyObject *__pyx_v_datafmt = NULL;
-  PyObject *__pyx_v_datatype = NULL;
-  PyObject *__pyx_v_mi = NULL;
-  PyObject *__pyx_v_ma = NULL;
-  PyObject *__pyx_v_fmt = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  Py_ssize_t __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  int __pyx_t_11;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("convert_python_tag", 0);
-  __Pyx_TraceCall("convert_python_tag", __pyx_f[0], 2096);
-  __Pyx_INCREF(__pyx_v_pytag);
-  __Pyx_INCREF(__pyx_v_value);
-
-  /* "pysam/calignmentfile.pyx":2098
- * cdef inline convert_python_tag(pytag, value, fmts, args):
- * 
- *     if not type(pytag) is bytes:             # <<<<<<<<<<<<<<
- *         pytag = pytag.encode('ascii')
- *     t = type(value)
- */
-  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_pytag)) != ((PyObject *)((PyObject*)(&PyBytes_Type))));
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2099
- * 
- *     if not type(pytag) is bytes:
- *         pytag = pytag.encode('ascii')             # <<<<<<<<<<<<<<
- *     t = type(value)
- * 
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytag, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF_SET(__pyx_v_pytag, __pyx_t_4);
-    __pyx_t_4 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":2100
- *     if not type(pytag) is bytes:
- *         pytag = pytag.encode('ascii')
- *     t = type(value)             # <<<<<<<<<<<<<<
- * 
- *     if t is tuple or t is list:
- */
-  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_value)));
-  __pyx_v_t = ((PyObject*)((PyObject *)Py_TYPE(__pyx_v_value)));
-
-  /* "pysam/calignmentfile.pyx":2102
- *     t = type(value)
- * 
- *     if t is tuple or t is list:             # <<<<<<<<<<<<<<
- *         # binary tags - treat separately
- *         pytype = 'B'
- */
-  __pyx_t_2 = (__pyx_v_t == ((PyObject*)(&PyTuple_Type)));
-  if (!(__pyx_t_2 != 0)) {
-    __pyx_t_1 = (__pyx_v_t == ((PyObject*)(&PyList_Type)));
-    __pyx_t_5 = (__pyx_t_1 != 0);
-  } else {
-    __pyx_t_5 = (__pyx_t_2 != 0);
-  }
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":2104
- *     if t is tuple or t is list:
- *         # binary tags - treat separately
- *         pytype = 'B'             # <<<<<<<<<<<<<<
- *         # get data type - first value determines type. If there is a
- *         # mix of types, the result is undefined.
- */
-    __Pyx_INCREF(__pyx_n_s_B);
-    __pyx_v_pytype = __pyx_n_s_B;
-
-    /* "pysam/calignmentfile.pyx":2107
- *         # get data type - first value determines type. If there is a
- *         # mix of types, the result is undefined.
- *         if type(value[0]) is float:             # <<<<<<<<<<<<<<
- *             datafmt, datatype = "f", "f"
- *         else:
- */
-    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_value, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = (((PyObject *)Py_TYPE(__pyx_t_4)) == ((PyObject *)((PyObject*)(&PyFloat_Type))));
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_2 = (__pyx_t_5 != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":2108
- *         # mix of types, the result is undefined.
- *         if type(value[0]) is float:
- *             datafmt, datatype = "f", "f"             # <<<<<<<<<<<<<<
- *         else:
- *             mi, ma = min(value), max(value)
- */
-      __pyx_t_4 = __pyx_n_s_f;
-      __Pyx_INCREF(__pyx_t_4);
-      __pyx_t_3 = __pyx_n_s_f;
-      __Pyx_INCREF(__pyx_t_3);
-      __pyx_v_datafmt = __pyx_t_4;
-      __pyx_t_4 = 0;
-      __pyx_v_datatype = __pyx_t_3;
-      __pyx_t_3 = 0;
-      goto __pyx_L5;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":2110
- *             datafmt, datatype = "f", "f"
- *         else:
- *             mi, ma = min(value), max(value)             # <<<<<<<<<<<<<<
- *             # signed ints
- *             if mi < 0:
- */
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_v_value);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
-      __Pyx_GIVEREF(__pyx_v_value);
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __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 = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_v_value);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
-      __Pyx_GIVEREF(__pyx_v_value);
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_v_mi = __pyx_t_4;
-      __pyx_t_4 = 0;
-      __pyx_v_ma = __pyx_t_6;
-      __pyx_t_6 = 0;
-
-      /* "pysam/calignmentfile.pyx":2112
- *             mi, ma = min(value), max(value)
- *             # signed ints
- *             if mi < 0:             # <<<<<<<<<<<<<<
- *                 if mi >= -128 and ma < 128:
- *                     datafmt, datatype = "b", 'c'
- */
-      __pyx_t_6 = PyObject_RichCompare(__pyx_v_mi, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (__pyx_t_2) {
-
-        /* "pysam/calignmentfile.pyx":2113
- *             # signed ints
- *             if mi < 0:
- *                 if mi >= -128 and ma < 128:             # <<<<<<<<<<<<<<
- *                     datafmt, datatype = "b", 'c'
- *                 elif mi >= -32768 and ma < 32768:
- */
-        __pyx_t_6 = PyObject_RichCompare(__pyx_v_mi, __pyx_int_neg_128, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        if (__pyx_t_2) {
-          __pyx_t_6 = PyObject_RichCompare(__pyx_v_ma, __pyx_int_128, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_1 = __pyx_t_5;
-        } else {
-          __pyx_t_1 = __pyx_t_2;
-        }
-        if (__pyx_t_1) {
-
-          /* "pysam/calignmentfile.pyx":2114
- *             if mi < 0:
- *                 if mi >= -128 and ma < 128:
- *                     datafmt, datatype = "b", 'c'             # <<<<<<<<<<<<<<
- *                 elif mi >= -32768 and ma < 32768:
- *                     datafmt, datatype = "h", 's'
- */
-          __pyx_t_6 = __pyx_n_s_b;
-          __Pyx_INCREF(__pyx_t_6);
-          __pyx_t_4 = __pyx_n_s_c;
-          __Pyx_INCREF(__pyx_t_4);
-          __pyx_v_datafmt = __pyx_t_6;
-          __pyx_t_6 = 0;
-          __pyx_v_datatype = __pyx_t_4;
-          __pyx_t_4 = 0;
-          goto __pyx_L7;
-        }
-
-        /* "pysam/calignmentfile.pyx":2115
- *                 if mi >= -128 and ma < 128:
- *                     datafmt, datatype = "b", 'c'
- *                 elif mi >= -32768 and ma < 32768:             # <<<<<<<<<<<<<<
- *                     datafmt, datatype = "h", 's'
- *                 elif mi < -2147483648 or ma >= 2147483648:
- */
-        __pyx_t_4 = PyObject_RichCompare(__pyx_v_mi, __pyx_int_neg_32768, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (__pyx_t_1) {
-          __pyx_t_4 = PyObject_RichCompare(__pyx_v_ma, __pyx_int_32768, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __pyx_t_5 = __pyx_t_2;
-        } else {
-          __pyx_t_5 = __pyx_t_1;
-        }
-        if (__pyx_t_5) {
-
-          /* "pysam/calignmentfile.pyx":2116
- *                     datafmt, datatype = "b", 'c'
- *                 elif mi >= -32768 and ma < 32768:
- *                     datafmt, datatype = "h", 's'             # <<<<<<<<<<<<<<
- *                 elif mi < -2147483648 or ma >= 2147483648:
- *                     raise ValueError(
- */
-          __pyx_t_4 = __pyx_n_s_h;
-          __Pyx_INCREF(__pyx_t_4);
-          __pyx_t_6 = __pyx_n_s_s_2;
-          __Pyx_INCREF(__pyx_t_6);
-          __pyx_v_datafmt = __pyx_t_4;
-          __pyx_t_4 = 0;
-          __pyx_v_datatype = __pyx_t_6;
-          __pyx_t_6 = 0;
-          goto __pyx_L7;
-        }
-
-        /* "pysam/calignmentfile.pyx":2117
- *                 elif mi >= -32768 and ma < 32768:
- *                     datafmt, datatype = "h", 's'
- *                 elif mi < -2147483648 or ma >= 2147483648:             # <<<<<<<<<<<<<<
- *                     raise ValueError(
- *                         "at least one signed integer out of range of "
- */
-        __pyx_t_6 = PyObject_RichCompare(__pyx_v_mi, __pyx_int_neg_2147483648, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        if (!__pyx_t_5) {
-          __pyx_t_6 = PyObject_RichCompare(__pyx_v_ma, __pyx_int_2147483648, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_2 = __pyx_t_1;
-        } else {
-          __pyx_t_2 = __pyx_t_5;
-        }
-        if (__pyx_t_2) {
-
-          /* "pysam/calignmentfile.pyx":2118
- *                     datafmt, datatype = "h", 's'
- *                 elif mi < -2147483648 or ma >= 2147483648:
- *                     raise ValueError(             # <<<<<<<<<<<<<<
- *                         "at least one signed integer out of range of "
- *                         "BAM/SAM specification")
- */
-          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_Raise(__pyx_t_6, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        /*else*/ {
-
-          /* "pysam/calignmentfile.pyx":2121
- *                         "at least one signed integer out of range of "
- *                         "BAM/SAM specification")
- *                 else: datafmt, datatype = "i", 'i'             # <<<<<<<<<<<<<<
- * 
- *             # unsigned ints
- */
-          __pyx_t_6 = __pyx_n_s_i;
-          __Pyx_INCREF(__pyx_t_6);
-          __pyx_t_4 = __pyx_n_s_i;
-          __Pyx_INCREF(__pyx_t_4);
-          __pyx_v_datafmt = __pyx_t_6;
-          __pyx_t_6 = 0;
-          __pyx_v_datatype = __pyx_t_4;
-          __pyx_t_4 = 0;
-        }
-        __pyx_L7:;
-        goto __pyx_L6;
-      }
-      /*else*/ {
-
-        /* "pysam/calignmentfile.pyx":2125
- *             # unsigned ints
- *             else:
- *                 if ma < 256:             # <<<<<<<<<<<<<<
- *                     datafmt, datatype = "B", 'C'
- *                 elif ma < 65536:
- */
-        __pyx_t_4 = PyObject_RichCompare(__pyx_v_ma, __pyx_int_256, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (__pyx_t_2) {
-
-          /* "pysam/calignmentfile.pyx":2126
- *             else:
- *                 if ma < 256:
- *                     datafmt, datatype = "B", 'C'             # <<<<<<<<<<<<<<
- *                 elif ma < 65536:
- *                     datafmt, datatype = "H", 'S'
- */
-          __pyx_t_4 = __pyx_n_s_B;
-          __Pyx_INCREF(__pyx_t_4);
-          __pyx_t_6 = __pyx_n_s_C;
-          __Pyx_INCREF(__pyx_t_6);
-          __pyx_v_datafmt = __pyx_t_4;
-          __pyx_t_4 = 0;
-          __pyx_v_datatype = __pyx_t_6;
-          __pyx_t_6 = 0;
-          goto __pyx_L8;
-        }
-
-        /* "pysam/calignmentfile.pyx":2127
- *                 if ma < 256:
- *                     datafmt, datatype = "B", 'C'
- *                 elif ma < 65536:             # <<<<<<<<<<<<<<
- *                     datafmt, datatype = "H", 'S'
- *                 elif ma >= 4294967296:
- */
-        __pyx_t_6 = PyObject_RichCompare(__pyx_v_ma, __pyx_int_65536, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        if (__pyx_t_2) {
-
-          /* "pysam/calignmentfile.pyx":2128
- *                     datafmt, datatype = "B", 'C'
- *                 elif ma < 65536:
- *                     datafmt, datatype = "H", 'S'             # <<<<<<<<<<<<<<
- *                 elif ma >= 4294967296:
- *                     raise ValueError(
- */
-          __pyx_t_6 = __pyx_n_s_H;
-          __Pyx_INCREF(__pyx_t_6);
-          __pyx_t_4 = __pyx_n_s_S;
-          __Pyx_INCREF(__pyx_t_4);
-          __pyx_v_datafmt = __pyx_t_6;
-          __pyx_t_6 = 0;
-          __pyx_v_datatype = __pyx_t_4;
-          __pyx_t_4 = 0;
-          goto __pyx_L8;
-        }
-
-        /* "pysam/calignmentfile.pyx":2129
- *                 elif ma < 65536:
- *                     datafmt, datatype = "H", 'S'
- *                 elif ma >= 4294967296:             # <<<<<<<<<<<<<<
- *                     raise ValueError(
- *                         "at least one integer out of range of BAM/SAM specification")
- */
-        __pyx_t_4 = PyObject_RichCompare(__pyx_v_ma, __pyx_int_4294967296, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (__pyx_t_2) {
-
-          /* "pysam/calignmentfile.pyx":2130
- *                     datafmt, datatype = "H", 'S'
- *                 elif ma >= 4294967296:
- *                     raise ValueError(             # <<<<<<<<<<<<<<
- *                         "at least one integer out of range of BAM/SAM specification")
- *                 else:
- */
-          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        /*else*/ {
-
-          /* "pysam/calignmentfile.pyx":2133
- *                         "at least one integer out of range of BAM/SAM specification")
- *                 else:
- *                     datafmt, datatype = "I", 'I'             # <<<<<<<<<<<<<<
- * 
- *         datafmt = "2sccI%i%s" % (len(value), datafmt)
- */
-          __pyx_t_4 = __pyx_n_s_I;
-          __Pyx_INCREF(__pyx_t_4);
-          __pyx_t_6 = __pyx_n_s_I;
-          __Pyx_INCREF(__pyx_t_6);
-          __pyx_v_datafmt = __pyx_t_4;
-          __pyx_t_4 = 0;
-          __pyx_v_datatype = __pyx_t_6;
-          __pyx_t_6 = 0;
-        }
-        __pyx_L8:;
-      }
-      __pyx_L6:;
-    }
-    __pyx_L5:;
-
-    /* "pysam/calignmentfile.pyx":2135
- *                     datafmt, datatype = "I", 'I'
- * 
- *         datafmt = "2sccI%i%s" % (len(value), datafmt)             # <<<<<<<<<<<<<<
- *         args.extend([pytag[:2],
- *                      pytype.encode('ascii'),
- */
-    __pyx_t_7 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(__pyx_v_datafmt);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_datafmt);
-    __Pyx_GIVEREF(__pyx_v_datafmt);
-    __pyx_t_6 = 0;
-    __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_2sccI_i_s, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF_SET(__pyx_v_datafmt, __pyx_t_6);
-    __pyx_t_6 = 0;
-
-    /* "pysam/calignmentfile.pyx":2136
- * 
- *         datafmt = "2sccI%i%s" % (len(value), datafmt)
- *         args.extend([pytag[:2],             # <<<<<<<<<<<<<<
- *                      pytype.encode('ascii'),
- *                      datatype.encode('ascii'),
- */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_extend); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_pytag, 0, 2, NULL, NULL, &__pyx_slice__68, 0, 1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-
-    /* "pysam/calignmentfile.pyx":2137
- *         datafmt = "2sccI%i%s" % (len(value), datafmt)
- *         args.extend([pytag[:2],
- *                      pytype.encode('ascii'),             # <<<<<<<<<<<<<<
- *                      datatype.encode('ascii'),
- *                      len(value)] + list(value))
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytype, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2138
- *         args.extend([pytag[:2],
- *                      pytype.encode('ascii'),
- *                      datatype.encode('ascii'),             # <<<<<<<<<<<<<<
- *                      len(value)] + list(value))
- *         fmts.append( datafmt )
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_datatype, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2139
- *                      pytype.encode('ascii'),
- *                      datatype.encode('ascii'),
- *                      len(value)] + list(value))             # <<<<<<<<<<<<<<
- *         fmts.append( datafmt )
- *         return
- */
-    __pyx_t_7 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-
-    /* "pysam/calignmentfile.pyx":2136
- * 
- *         datafmt = "2sccI%i%s" % (len(value), datafmt)
- *         args.extend([pytag[:2],             # <<<<<<<<<<<<<<
- *                      pytype.encode('ascii'),
- *                      datatype.encode('ascii'),
- */
-    __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    PyList_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    PyList_SET_ITEM(__pyx_t_10, 3, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_4 = 0;
-    __pyx_t_8 = 0;
-    __pyx_t_9 = 0;
-    __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2139
- *                      pytype.encode('ascii'),
- *                      datatype.encode('ascii'),
- *                      len(value)] + list(value))             # <<<<<<<<<<<<<<
- *         fmts.append( datafmt )
- *         return
- */
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyNumber_Add(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-    /* "pysam/calignmentfile.pyx":2136
- * 
- *         datafmt = "2sccI%i%s" % (len(value), datafmt)
- *         args.extend([pytag[:2],             # <<<<<<<<<<<<<<
- *                      pytype.encode('ascii'),
- *                      datatype.encode('ascii'),
- */
-    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2140
- *                      datatype.encode('ascii'),
- *                      len(value)] + list(value))
- *         fmts.append( datafmt )             # <<<<<<<<<<<<<<
- *         return
- * 
- */
-    __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_fmts, __pyx_v_datafmt); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":2141
- *                      len(value)] + list(value))
- *         fmts.append( datafmt )
- *         return             # <<<<<<<<<<<<<<
- * 
- *     if t is float:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2143
- *         return
- * 
- *     if t is float:             # <<<<<<<<<<<<<<
- *         fmt, pytype = "2scf", 'f'
- *     elif t is int:
- */
-  __pyx_t_2 = (__pyx_v_t == ((PyObject*)(&PyFloat_Type)));
-  __pyx_t_5 = (__pyx_t_2 != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":2144
- * 
- *     if t is float:
- *         fmt, pytype = "2scf", 'f'             # <<<<<<<<<<<<<<
- *     elif t is int:
- *         # negative values
- */
-    __pyx_t_3 = __pyx_kp_s_2scf;
-    __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_9 = __pyx_n_s_f;
-    __Pyx_INCREF(__pyx_t_9);
-    __pyx_v_fmt = __pyx_t_3;
-    __pyx_t_3 = 0;
-    __pyx_v_pytype = __pyx_t_9;
-    __pyx_t_9 = 0;
-    goto __pyx_L9;
-  }
-
-  /* "pysam/calignmentfile.pyx":2145
- *     if t is float:
- *         fmt, pytype = "2scf", 'f'
- *     elif t is int:             # <<<<<<<<<<<<<<
- *         # negative values
- *         if value < 0:
- */
-  __pyx_t_5 = (__pyx_v_t == ((PyObject*)(&PyInt_Type)));
-  __pyx_t_2 = (__pyx_t_5 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2147
- *     elif t is int:
- *         # negative values
- *         if value < 0:             # <<<<<<<<<<<<<<
- *             if value >= -127: fmt, pytype = "2scb", 'c'
- *             elif value >= -32767: fmt, pytype = "2sch", 's'
- */
-    __pyx_t_9 = PyObject_RichCompare(__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":2148
- *         # negative values
- *         if value < 0:
- *             if value >= -127: fmt, pytype = "2scb", 'c'             # <<<<<<<<<<<<<<
- *             elif value >= -32767: fmt, pytype = "2sch", 's'
- *             elif value < -2147483648: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
- */
-      __pyx_t_9 = PyObject_RichCompare(__pyx_v_value, __pyx_int_neg_127, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (__pyx_t_2) {
-        __pyx_t_9 = __pyx_kp_s_2scb;
-        __Pyx_INCREF(__pyx_t_9);
-        __pyx_t_3 = __pyx_n_s_c;
-        __Pyx_INCREF(__pyx_t_3);
-        __pyx_v_fmt = __pyx_t_9;
-        __pyx_t_9 = 0;
-        __pyx_v_pytype = __pyx_t_3;
-        __pyx_t_3 = 0;
-        goto __pyx_L11;
-      }
-
-      /* "pysam/calignmentfile.pyx":2149
- *         if value < 0:
- *             if value >= -127: fmt, pytype = "2scb", 'c'
- *             elif value >= -32767: fmt, pytype = "2sch", 's'             # <<<<<<<<<<<<<<
- *             elif value < -2147483648: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
- *             else: fmt, pytype = "2sci", 'i'
- */
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_int_neg_32767, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_2) {
-        __pyx_t_3 = __pyx_kp_s_2sch;
-        __Pyx_INCREF(__pyx_t_3);
-        __pyx_t_9 = __pyx_n_s_s_2;
-        __Pyx_INCREF(__pyx_t_9);
-        __pyx_v_fmt = __pyx_t_3;
-        __pyx_t_3 = 0;
-        __pyx_v_pytype = __pyx_t_9;
-        __pyx_t_9 = 0;
-        goto __pyx_L11;
-      }
-
-      /* "pysam/calignmentfile.pyx":2150
- *             if value >= -127: fmt, pytype = "2scb", 'c'
- *             elif value >= -32767: fmt, pytype = "2sch", 's'
- *             elif value < -2147483648: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )             # <<<<<<<<<<<<<<
- *             else: fmt, pytype = "2sci", 'i'
- *         # positive values
- */
-      __pyx_t_9 = PyObject_RichCompare(__pyx_v_value, __pyx_int_neg_2147483648, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (__pyx_t_2) {
-        __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_integer_i_out_of_range_of_BAM_SA, __pyx_v_value); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
-        __Pyx_GIVEREF(__pyx_t_9);
-        __pyx_t_9 = 0;
-        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_Raise(__pyx_t_9, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      /*else*/ {
-
-        /* "pysam/calignmentfile.pyx":2151
- *             elif value >= -32767: fmt, pytype = "2sch", 's'
- *             elif value < -2147483648: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
- *             else: fmt, pytype = "2sci", 'i'             # <<<<<<<<<<<<<<
- *         # positive values
- *         else:
- */
-        __pyx_t_9 = __pyx_kp_s_2sci;
-        __Pyx_INCREF(__pyx_t_9);
-        __pyx_t_3 = __pyx_n_s_i;
-        __Pyx_INCREF(__pyx_t_3);
-        __pyx_v_fmt = __pyx_t_9;
-        __pyx_t_9 = 0;
-        __pyx_v_pytype = __pyx_t_3;
-        __pyx_t_3 = 0;
-      }
-      __pyx_L11:;
-      goto __pyx_L10;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":2154
- *         # positive values
- *         else:
- *             if value <= 255: fmt, pytype = "2scB", 'C'             # <<<<<<<<<<<<<<
- *             elif value <= 65535: fmt, pytype = "2scH", 'S'
- *             elif value > 4294967295: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
- */
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_int_255, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_2) {
-        __pyx_t_3 = __pyx_kp_s_2scB;
-        __Pyx_INCREF(__pyx_t_3);
-        __pyx_t_9 = __pyx_n_s_C;
-        __Pyx_INCREF(__pyx_t_9);
-        __pyx_v_fmt = __pyx_t_3;
-        __pyx_t_3 = 0;
-        __pyx_v_pytype = __pyx_t_9;
-        __pyx_t_9 = 0;
-        goto __pyx_L12;
-      }
-
-      /* "pysam/calignmentfile.pyx":2155
- *         else:
- *             if value <= 255: fmt, pytype = "2scB", 'C'
- *             elif value <= 65535: fmt, pytype = "2scH", 'S'             # <<<<<<<<<<<<<<
- *             elif value > 4294967295: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
- *             else: fmt, pytype = "2scI", 'I'
- */
-      __pyx_t_9 = PyObject_RichCompare(__pyx_v_value, __pyx_int_65535, Py_LE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (__pyx_t_2) {
-        __pyx_t_9 = __pyx_kp_s_2scH;
-        __Pyx_INCREF(__pyx_t_9);
-        __pyx_t_3 = __pyx_n_s_S;
-        __Pyx_INCREF(__pyx_t_3);
-        __pyx_v_fmt = __pyx_t_9;
-        __pyx_t_9 = 0;
-        __pyx_v_pytype = __pyx_t_3;
-        __pyx_t_3 = 0;
-        goto __pyx_L12;
-      }
-
-      /* "pysam/calignmentfile.pyx":2156
- *             if value <= 255: fmt, pytype = "2scB", 'C'
- *             elif value <= 65535: fmt, pytype = "2scH", 'S'
- *             elif value > 4294967295: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )             # <<<<<<<<<<<<<<
- *             else: fmt, pytype = "2scI", 'I'
- *     else:
- */
-      __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_int_4294967295, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (__pyx_t_2) {
-        __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_integer_i_out_of_range_of_BAM_SA, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
-        __Pyx_GIVEREF(__pyx_t_3);
-        __pyx_t_3 = 0;
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      /*else*/ {
-
-        /* "pysam/calignmentfile.pyx":2157
- *             elif value <= 65535: fmt, pytype = "2scH", 'S'
- *             elif value > 4294967295: raise ValueError( "integer %i out of range of BAM/SAM specification" % value )
- *             else: fmt, pytype = "2scI", 'I'             # <<<<<<<<<<<<<<
- *     else:
- *         # Note: hex strings (H) are not supported yet
- */
-        __pyx_t_3 = __pyx_kp_s_2scI;
-        __Pyx_INCREF(__pyx_t_3);
-        __pyx_t_9 = __pyx_n_s_I;
-        __Pyx_INCREF(__pyx_t_9);
-        __pyx_v_fmt = __pyx_t_3;
-        __pyx_t_3 = 0;
-        __pyx_v_pytype = __pyx_t_9;
-        __pyx_t_9 = 0;
-      }
-      __pyx_L12:;
-    }
-    __pyx_L10:;
-    goto __pyx_L9;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":2160
- *     else:
- *         # Note: hex strings (H) are not supported yet
- *         if t is not bytes:             # <<<<<<<<<<<<<<
- *             value = value.encode('ascii')
- *         if len(value) == 1:
- */
-    __pyx_t_2 = (__pyx_v_t != ((PyObject*)(&PyBytes_Type)));
-    __pyx_t_5 = (__pyx_t_2 != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/calignmentfile.pyx":2161
- *         # Note: hex strings (H) are not supported yet
- *         if t is not bytes:
- *             value = value.encode('ascii')             # <<<<<<<<<<<<<<
- *         if len(value) == 1:
- *             fmt, pytype = "2scc", 'A'
- */
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
-      __pyx_t_3 = 0;
-      goto __pyx_L13;
-    }
-    __pyx_L13:;
-
-    /* "pysam/calignmentfile.pyx":2162
- *         if t is not bytes:
- *             value = value.encode('ascii')
- *         if len(value) == 1:             # <<<<<<<<<<<<<<
- *             fmt, pytype = "2scc", 'A'
- *         else:
- */
-    __pyx_t_7 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = ((__pyx_t_7 == 1) != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/calignmentfile.pyx":2163
- *             value = value.encode('ascii')
- *         if len(value) == 1:
- *             fmt, pytype = "2scc", 'A'             # <<<<<<<<<<<<<<
- *         else:
- *             fmt, pytype = "2sc%is" % (len(value)+1), 'Z'
- */
-      __pyx_t_3 = __pyx_kp_s_2scc;
-      __Pyx_INCREF(__pyx_t_3);
-      __pyx_t_9 = __pyx_n_s_A;
-      __Pyx_INCREF(__pyx_t_9);
-      __pyx_v_fmt = __pyx_t_3;
-      __pyx_t_3 = 0;
-      __pyx_v_pytype = __pyx_t_9;
-      __pyx_t_9 = 0;
-      goto __pyx_L14;
-    }
-    /*else*/ {
-
-      /* "pysam/calignmentfile.pyx":2165
- *             fmt, pytype = "2scc", 'A'
- *         else:
- *             fmt, pytype = "2sc%is" % (len(value)+1), 'Z'             # <<<<<<<<<<<<<<
- * 
- *     args.extend([pytag[:2],
- */
-      __pyx_t_7 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_9 = PyInt_FromSsize_t((__pyx_t_7 + 1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_2sc_is, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_9 = __pyx_n_s_Z;
-      __Pyx_INCREF(__pyx_t_9);
-      __pyx_v_fmt = __pyx_t_3;
-      __pyx_t_3 = 0;
-      __pyx_v_pytype = __pyx_t_9;
-      __pyx_t_9 = 0;
-    }
-    __pyx_L14:;
-  }
-  __pyx_L9:;
-
-  /* "pysam/calignmentfile.pyx":2167
- *             fmt, pytype = "2sc%is" % (len(value)+1), 'Z'
- * 
- *     args.extend([pytag[:2],             # <<<<<<<<<<<<<<
- *                  pytype.encode('ascii'),
- *                  value])
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_extend); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_pytag, 0, 2, NULL, NULL, &__pyx_slice__72, 0, 1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-
-  /* "pysam/calignmentfile.pyx":2168
- * 
- *     args.extend([pytag[:2],
- *                  pytype.encode('ascii'),             # <<<<<<<<<<<<<<
- *                  value])
- * 
- */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytype, __pyx_n_s_encode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "pysam/calignmentfile.pyx":2167
- *             fmt, pytype = "2sc%is" % (len(value)+1), 'Z'
- * 
- *     args.extend([pytag[:2],             # <<<<<<<<<<<<<<
- *                  pytype.encode('ascii'),
- *                  value])
- */
-  __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
-  __Pyx_GIVEREF(__pyx_t_10);
-  __Pyx_INCREF(__pyx_v_value);
-  PyList_SET_ITEM(__pyx_t_6, 2, __pyx_v_value);
-  __Pyx_GIVEREF(__pyx_v_value);
-  __pyx_t_3 = 0;
-  __pyx_t_10 = 0;
-  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "pysam/calignmentfile.pyx":2171
- *                  value])
- * 
- *     fmts.append(fmt)             # <<<<<<<<<<<<<<
- * 
- * ###########################################################
- */
-  __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_fmts, __pyx_v_fmt); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":2096
- *     return type_code
- * 
- * cdef inline convert_python_tag(pytag, value, fmts, args):             # <<<<<<<<<<<<<<
- * 
- *     if not type(pytag) is bytes:
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_AddTraceback("pysam.calignmentfile.convert_python_tag", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_t);
-  __Pyx_XDECREF(__pyx_v_pytype);
-  __Pyx_XDECREF(__pyx_v_datafmt);
-  __Pyx_XDECREF(__pyx_v_datatype);
-  __Pyx_XDECREF(__pyx_v_mi);
-  __Pyx_XDECREF(__pyx_v_ma);
-  __Pyx_XDECREF(__pyx_v_fmt);
-  __Pyx_XDECREF(__pyx_v_pytag);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2196
- * 
- *     # Now only called when instances are created from Python
- *     def __init__(self):             # <<<<<<<<<<<<<<
- *         # see bam_init1
- *         self._delegate = <bam1_t*>calloc(1, sizeof(bam1_t))
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
-  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment___init__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment___init__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 2196);
-
-  /* "pysam/calignmentfile.pyx":2198
- *     def __init__(self):
- *         # see bam_init1
- *         self._delegate = <bam1_t*>calloc(1, sizeof(bam1_t))             # <<<<<<<<<<<<<<
- *         # allocate some memory. If size is 0, calloc does not return a
- *         # pointer that can be passed to free() so allocate 40 bytes
- */
-  __pyx_v_self->_delegate = ((bam1_t *)calloc(1, (sizeof(bam1_t))));
-
-  /* "pysam/calignmentfile.pyx":2202
- *         # pointer that can be passed to free() so allocate 40 bytes
- *         # for a new read
- *         self._delegate.m_data = 40             # <<<<<<<<<<<<<<
- *         self._delegate.data = <uint8_t *>calloc(
- *             self._delegate.m_data, 1)
- */
-  __pyx_v_self->_delegate->m_data = 40;
-
-  /* "pysam/calignmentfile.pyx":2203
- *         # for a new read
- *         self._delegate.m_data = 40
- *         self._delegate.data = <uint8_t *>calloc(             # <<<<<<<<<<<<<<
- *             self._delegate.m_data, 1)
- *         self._delegate.l_data = 0
- */
-  __pyx_v_self->_delegate->data = ((uint8_t *)calloc(__pyx_v_self->_delegate->m_data, 1));
-
-  /* "pysam/calignmentfile.pyx":2205
- *         self._delegate.data = <uint8_t *>calloc(
- *             self._delegate.m_data, 1)
- *         self._delegate.l_data = 0             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-  __pyx_v_self->_delegate->l_data = 0;
-
-  /* "pysam/calignmentfile.pyx":2196
- * 
- *     # Now only called when instances are created from Python
- *     def __init__(self):             # <<<<<<<<<<<<<<
- *         # see bam_init1
- *         self._delegate = <bam1_t*>calloc(1, sizeof(bam1_t))
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2207
- *         self._delegate.l_data = 0
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         bam_destroy1(self._delegate)
- * 
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_2__dealloc__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_2__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 2207);
-
-  /* "pysam/calignmentfile.pyx":2208
- * 
- *     def __dealloc__(self):
- *         bam_destroy1(self._delegate)             # <<<<<<<<<<<<<<
- * 
- *     def __str__(self):
- */
-  bam_destroy1(__pyx_v_self->_delegate);
-
-  /* "pysam/calignmentfile.pyx":2207
- *         self._delegate.l_data = 0
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         bam_destroy1(self._delegate)
- * 
- */
-
-  /* function exit code */
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/calignmentfile.pyx":2210
- *         bam_destroy1(self._delegate)
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         """return string representation of alignment.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5__str__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_4__str__[] = "return string representation of alignment.\n\n        The representation is an approximate :term:`sam` format.\n\n        An aligned read might not be associated with a :term:`AlignmentFile`.\n        As a result :term:`tid` is shown instead of the reference name.\n\n        Similarly, the tags field is returned in its parsed state.\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_14calignmentfile_14AlignedSegment_4__str__;
-#endif
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5__str__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4__str__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4__str__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__str__", 0);
-  __Pyx_TraceCall("__str__", __pyx_f[0], 2210);
-
-  /* "pysam/calignmentfile.pyx":2222
- *         # sam-parsing is done in sam.c/bam_format1_core which
- *         # requires a valid header.
- *         return "\t".join(map(str, (self.query_name,             # <<<<<<<<<<<<<<
- *                                    self.flag,
- *                                    self.reference_id,
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/calignmentfile.pyx":2223
- *         # requires a valid header.
- *         return "\t".join(map(str, (self.query_name,
- *                                    self.flag,             # <<<<<<<<<<<<<<
- *                                    self.reference_id,
- *                                    self.reference_start,
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-
-  /* "pysam/calignmentfile.pyx":2224
- *         return "\t".join(map(str, (self.query_name,
- *                                    self.flag,
- *                                    self.reference_id,             # <<<<<<<<<<<<<<
- *                                    self.reference_start,
- *                                    self.mapping_quality,
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_id); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-
-  /* "pysam/calignmentfile.pyx":2225
- *                                    self.flag,
- *                                    self.reference_id,
- *                                    self.reference_start,             # <<<<<<<<<<<<<<
- *                                    self.mapping_quality,
- *                                    self.cigarstring,
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-
-  /* "pysam/calignmentfile.pyx":2226
- *                                    self.reference_id,
- *                                    self.reference_start,
- *                                    self.mapping_quality,             # <<<<<<<<<<<<<<
- *                                    self.cigarstring,
- *                                    self.next_reference_id,
- */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapping_quality); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-
-  /* "pysam/calignmentfile.pyx":2227
- *                                    self.reference_start,
- *                                    self.mapping_quality,
- *                                    self.cigarstring,             # <<<<<<<<<<<<<<
- *                                    self.next_reference_id,
- *                                    self.next_reference_start,
- */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cigarstring); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-
-  /* "pysam/calignmentfile.pyx":2228
- *                                    self.mapping_quality,
- *                                    self.cigarstring,
- *                                    self.next_reference_id,             # <<<<<<<<<<<<<<
- *                                    self.next_reference_start,
- *                                    self.query_alignment_length,
- */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_id); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-
-  /* "pysam/calignmentfile.pyx":2229
- *                                    self.cigarstring,
- *                                    self.next_reference_id,
- *                                    self.next_reference_start,             # <<<<<<<<<<<<<<
- *                                    self.query_alignment_length,
- *                                    self.query_sequence,
- */
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-
-  /* "pysam/calignmentfile.pyx":2230
- *                                    self.next_reference_id,
- *                                    self.next_reference_start,
- *                                    self.query_alignment_length,             # <<<<<<<<<<<<<<
- *                                    self.query_sequence,
- *                                    self.query_qualities,
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_length); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-
-  /* "pysam/calignmentfile.pyx":2231
- *                                    self.next_reference_start,
- *                                    self.query_alignment_length,
- *                                    self.query_sequence,             # <<<<<<<<<<<<<<
- *                                    self.query_qualities,
- *                                    self.tags)))
- */
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_sequence); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-
-  /* "pysam/calignmentfile.pyx":2232
- *                                    self.query_alignment_length,
- *                                    self.query_sequence,
- *                                    self.query_qualities,             # <<<<<<<<<<<<<<
- *                                    self.tags)))
- * 
- */
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_qualities); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-
-  /* "pysam/calignmentfile.pyx":2233
- *                                    self.query_sequence,
- *                                    self.query_qualities,
- *                                    self.tags)))             # <<<<<<<<<<<<<<
- * 
- *     def compare(self, AlignedSegment other):
- */
-  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tags); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-
-  /* "pysam/calignmentfile.pyx":2222
- *         # sam-parsing is done in sam.c/bam_format1_core which
- *         # requires a valid header.
- *         return "\t".join(map(str, (self.query_name,             # <<<<<<<<<<<<<<
- *                                    self.flag,
- *                                    self.reference_id,
- */
-  __pyx_t_13 = PyTuple_New(12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_13);
-  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_9);
-  PyTuple_SET_ITEM(__pyx_t_13, 9, __pyx_t_10);
-  __Pyx_GIVEREF(__pyx_t_10);
-  PyTuple_SET_ITEM(__pyx_t_13, 10, __pyx_t_11);
-  __Pyx_GIVEREF(__pyx_t_11);
-  PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_t_12);
-  __Pyx_GIVEREF(__pyx_t_12);
-  __pyx_t_1 = 0;
-  __pyx_t_2 = 0;
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_5 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
-  __pyx_t_9 = 0;
-  __pyx_t_10 = 0;
-  __pyx_t_11 = 0;
-  __pyx_t_12 = 0;
-  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13);
-  __Pyx_GIVEREF(__pyx_t_13);
-  __pyx_t_13 = 0;
-  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_13);
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __pyx_t_12 = __Pyx_PyString_Join(__pyx_kp_s__43, __pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-  __pyx_r = __pyx_t_12;
-  __pyx_t_12 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2210
- *         bam_destroy1(self._delegate)
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         """return string representation of alignment.
- * 
- */
-
-  /* function exit code */
-  __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);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_XDECREF(__pyx_t_13);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2235
- *                                    self.tags)))
- * 
- *     def compare(self, AlignedSegment other):             # <<<<<<<<<<<<<<
- *         '''return -1,0,1, if contents in this are binary <,=,> to *other*'''
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_7compare(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_6compare[] = "AlignedSegment.compare(self, AlignedSegment other)\nreturn -1,0,1, if contents in this are binary <,=,> to *other*";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_7compare(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
-  CYTHON_UNUSED int __pyx_lineno = 0;
-  CYTHON_UNUSED const char *__pyx_filename = NULL;
-  CYTHON_UNUSED int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("compare (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_5pysam_14calignmentfile_AlignedSegment, 1, "other", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6compare(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_other));
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6compare(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_other) {
-  int __pyx_v_retval;
-  bam1_t *__pyx_v_t;
-  bam1_t *__pyx_v_o;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("compare", 0);
-  __Pyx_TraceCall("compare", __pyx_f[0], 2235);
-
-  /* "pysam/calignmentfile.pyx":2242
- *         cdef bam1_t *o
- * 
- *         t = self._delegate             # <<<<<<<<<<<<<<
- *         o = other._delegate
- * 
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_t = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2243
- * 
- *         t = self._delegate
- *         o = other._delegate             # <<<<<<<<<<<<<<
- * 
- *         # uncomment for debugging purposes
- */
-  __pyx_t_1 = __pyx_v_other->_delegate;
-  __pyx_v_o = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2255
- * 
- *         # Fast-path test for object identity
- *         if t == o:             # <<<<<<<<<<<<<<
- *             return 0
- * 
- */
-  __pyx_t_2 = ((__pyx_v_t == __pyx_v_o) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2256
- *         # Fast-path test for object identity
- *         if t == o:
- *             return 0             # <<<<<<<<<<<<<<
- * 
- *         retval = memcmp(&t.core, &o.core, sizeof(bam1_core_t))
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_int_0);
-    __pyx_r = __pyx_int_0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2258
- *             return 0
- * 
- *         retval = memcmp(&t.core, &o.core, sizeof(bam1_core_t))             # <<<<<<<<<<<<<<
- * 
- *         if retval:
- */
-  __pyx_v_retval = memcmp((&__pyx_v_t->core), (&__pyx_v_o->core), (sizeof(bam1_core_t)));
-
-  /* "pysam/calignmentfile.pyx":2260
- *         retval = memcmp(&t.core, &o.core, sizeof(bam1_core_t))
- * 
- *         if retval:             # <<<<<<<<<<<<<<
- *             return retval
- *         # cmp(t.l_data, o.l_data)
- */
-  __pyx_t_2 = (__pyx_v_retval != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2261
- * 
- *         if retval:
- *             return retval             # <<<<<<<<<<<<<<
- *         # cmp(t.l_data, o.l_data)
- *         retval = (t.l_data > o.l_data) - (t.l_data < o.l_data)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2263
- *             return retval
- *         # cmp(t.l_data, o.l_data)
- *         retval = (t.l_data > o.l_data) - (t.l_data < o.l_data)             # <<<<<<<<<<<<<<
- *         if retval:
- *             return retval
- */
-  __pyx_v_retval = ((__pyx_v_t->l_data > __pyx_v_o->l_data) - (__pyx_v_t->l_data < __pyx_v_o->l_data));
-
-  /* "pysam/calignmentfile.pyx":2264
- *         # cmp(t.l_data, o.l_data)
- *         retval = (t.l_data > o.l_data) - (t.l_data < o.l_data)
- *         if retval:             # <<<<<<<<<<<<<<
- *             return retval
- *         return memcmp(t.data, o.data, t.l_data)
- */
-  __pyx_t_2 = (__pyx_v_retval != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2265
- *         retval = (t.l_data > o.l_data) - (t.l_data < o.l_data)
- *         if retval:
- *             return retval             # <<<<<<<<<<<<<<
- *         return memcmp(t.data, o.data, t.l_data)
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2266
- *         if retval:
- *             return retval
- *         return memcmp(t.data, o.data, t.l_data)             # <<<<<<<<<<<<<<
- * 
- *     # Disabled so long as __cmp__ is a special method
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyInt_From_int(memcmp(__pyx_v_t->data, __pyx_v_o->data, __pyx_v_t->l_data)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2235
- *                                    self.tags)))
- * 
- *     def compare(self, AlignedSegment other):             # <<<<<<<<<<<<<<
- *         '''return -1,0,1, if contents in this are binary <,=,> to *other*'''
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.compare", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2269
- * 
- *     # Disabled so long as __cmp__ is a special method
- *     def __hash__(self):             # <<<<<<<<<<<<<<
- *         return _Py_HashPointer(<void *>self)
- * 
- */
-
-/* Python wrapper */
-static Py_hash_t __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9__hash__(PyObject *__pyx_v_self); /*proto*/
-static Py_hash_t __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9__hash__(PyObject *__pyx_v_self) {
-  Py_hash_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8__hash__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static Py_hash_t __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8__hash__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  Py_hash_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__hash__", 0);
-  __Pyx_TraceCall("__hash__", __pyx_f[0], 2269);
-
-  /* "pysam/calignmentfile.pyx":2270
- *     # Disabled so long as __cmp__ is a special method
- *     def __hash__(self):
- *         return _Py_HashPointer(<void *>self)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_r = _Py_HashPointer(((void *)__pyx_v_self));
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2269
- * 
- *     # Disabled so long as __cmp__ is a special method
- *     def __hash__(self):             # <<<<<<<<<<<<<<
- *         return _Py_HashPointer(<void *>self)
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2279
- *     property query_name:
- *         """the query template name (None if not present)"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             src = self._delegate
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10query_name_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10query_name_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10query_name___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10query_name___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2279);
-
-  /* "pysam/calignmentfile.pyx":2281
- *         def __get__(self):
- *             cdef bam1_t * src
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             if pysam_get_l_qname(src) == 0:
- *                 return None
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2282
- *             cdef bam1_t * src
- *             src = self._delegate
- *             if pysam_get_l_qname(src) == 0:             # <<<<<<<<<<<<<<
- *                 return None
- *             return _charptr_to_str(<char *>pysam_bam_get_qname(src))
- */
-  __pyx_t_2 = ((pysam_get_l_qname(__pyx_v_src) == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2283
- *             src = self._delegate
- *             if pysam_get_l_qname(src) == 0:
- *                 return None             # <<<<<<<<<<<<<<
- *             return _charptr_to_str(<char *>pysam_bam_get_qname(src))
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2284
- *             if pysam_get_l_qname(src) == 0:
- *                 return None
- *             return _charptr_to_str(<char *>pysam_bam_get_qname(src))             # <<<<<<<<<<<<<<
- * 
- *         def __set__(self, qname):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__charptr_to_str(((char *)pysam_bam_get_qname(__pyx_v_src))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2279
- *     property query_name:
- *         """the query template name (None if not present)"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             src = self._delegate
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2286
- *             return _charptr_to_str(<char *>pysam_bam_get_qname(src))
- * 
- *         def __set__(self, qname):             # <<<<<<<<<<<<<<
- *             if qname is None or len(qname) == 0:
- *                 return
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10query_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qname); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10query_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qname) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10query_name_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_qname));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10query_name_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_qname) {
-  bam1_t *__pyx_v_src;
-  int __pyx_v_l;
-  char *__pyx_v_p;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  Py_ssize_t __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  bam1_t *__pyx_t_6;
-  char const *__pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2286);
-  __Pyx_INCREF(__pyx_v_qname);
-
-  /* "pysam/calignmentfile.pyx":2287
- * 
- *         def __set__(self, qname):
- *             if qname is None or len(qname) == 0:             # <<<<<<<<<<<<<<
- *                 return
- *             qname = _forceBytes(qname)
- */
-  __pyx_t_1 = (__pyx_v_qname == Py_None);
-  if (!(__pyx_t_1 != 0)) {
-    __pyx_t_2 = PyObject_Length(__pyx_v_qname); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = ((__pyx_t_2 == 0) != 0);
-    __pyx_t_4 = __pyx_t_3;
-  } else {
-    __pyx_t_4 = (__pyx_t_1 != 0);
-  }
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":2288
- *         def __set__(self, qname):
- *             if qname is None or len(qname) == 0:
- *                 return             # <<<<<<<<<<<<<<
- *             qname = _forceBytes(qname)
- *             cdef bam1_t * src
- */
-    __pyx_r = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2289
- *             if qname is None or len(qname) == 0:
- *                 return
- *             qname = _forceBytes(qname)             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef int l
- */
-  __pyx_t_5 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_qname); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF_SET(__pyx_v_qname, __pyx_t_5);
-  __pyx_t_5 = 0;
-
-  /* "pysam/calignmentfile.pyx":2294
- *             cdef char * p
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             p = pysam_bam_get_qname(src)
- * 
- */
-  __pyx_t_6 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_6;
-
-  /* "pysam/calignmentfile.pyx":2295
- * 
- *             src = self._delegate
- *             p = pysam_bam_get_qname(src)             # <<<<<<<<<<<<<<
- * 
- *             # the qname is \0 terminated
- */
-  __pyx_v_p = pysam_bam_get_qname(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2298
- * 
- *             # the qname is \0 terminated
- *             l = len(qname) + 1             # <<<<<<<<<<<<<<
- *             pysam_bam_update(src,
- *                              pysam_get_l_qname(src),
- */
-  __pyx_t_2 = PyObject_Length(__pyx_v_qname); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_l = (__pyx_t_2 + 1);
-
-  /* "pysam/calignmentfile.pyx":2299
- *             # the qname is \0 terminated
- *             l = len(qname) + 1
- *             pysam_bam_update(src,             # <<<<<<<<<<<<<<
- *                              pysam_get_l_qname(src),
- *                              l,
- */
-  pysam_bam_update(__pyx_v_src, pysam_get_l_qname(__pyx_v_src), __pyx_v_l, ((uint8_t *)__pyx_v_p));
-
-  /* "pysam/calignmentfile.pyx":2305
- * 
- * 
- *             pysam_set_l_qname(src, l)             # <<<<<<<<<<<<<<
- * 
- *             # re-acquire pointer to location in memory
- */
-  pysam_set_l_qname(__pyx_v_src, __pyx_v_l);
-
-  /* "pysam/calignmentfile.pyx":2309
- *             # re-acquire pointer to location in memory
- *             # as it might have moved
- *             p = pysam_bam_get_qname(src)             # <<<<<<<<<<<<<<
- * 
- *             strncpy(p, qname, l)
- */
-  __pyx_v_p = pysam_bam_get_qname(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2311
- *             p = pysam_bam_get_qname(src)
- * 
- *             strncpy(p, qname, l)             # <<<<<<<<<<<<<<
- * 
- *     property flag:
- */
-  __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_qname); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  strncpy(__pyx_v_p, __pyx_t_7, __pyx_v_l);
-
-  /* "pysam/calignmentfile.pyx":2286
- *             return _charptr_to_str(<char *>pysam_bam_get_qname(src))
- * 
- *         def __set__(self, qname):             # <<<<<<<<<<<<<<
- *             if qname is None or len(qname) == 0:
- *                 return
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_qname);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2315
- *     property flag:
- *         """properties flag"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return pysam_get_flag(self._delegate)
- *         def __set__(self, flag):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4flag_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4flag_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4flag___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4flag___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2315);
-
-  /* "pysam/calignmentfile.pyx":2316
- *         """properties flag"""
- *         def __get__(self):
- *             return pysam_get_flag(self._delegate)             # <<<<<<<<<<<<<<
- *         def __set__(self, flag):
- *             pysam_set_flag(self._delegate, flag)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint16_t(pysam_get_flag(__pyx_v_self->_delegate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2315
- *     property flag:
- *         """properties flag"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return pysam_get_flag(self._delegate)
- *         def __set__(self, flag):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.flag.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2317
- *         def __get__(self):
- *             return pysam_get_flag(self._delegate)
- *         def __set__(self, flag):             # <<<<<<<<<<<<<<
- *             pysam_set_flag(self._delegate, flag)
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4flag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4flag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_flag) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4flag_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_flag));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4flag_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_flag) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2317);
-
-  /* "pysam/calignmentfile.pyx":2318
- *             return pysam_get_flag(self._delegate)
- *         def __set__(self, flag):
- *             pysam_set_flag(self._delegate, flag)             # <<<<<<<<<<<<<<
- * 
- *     property reference_id:
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_flag); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_set_flag(__pyx_v_self->_delegate, __pyx_t_1);
-
-  /* "pysam/calignmentfile.pyx":2317
- *         def __get__(self):
- *             return pysam_get_flag(self._delegate)
- *         def __set__(self, flag):             # <<<<<<<<<<<<<<
- *             pysam_set_flag(self._delegate, flag)
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.flag.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2331
- * 
- *         """
- *         def __get__(self): return self._delegate.core.tid             # <<<<<<<<<<<<<<
- *         def __set__(self, tid): self._delegate.core.tid = tid
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12reference_id_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12reference_id_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12reference_id___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12reference_id___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2331);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_delegate->core.tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.reference_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2332
- *         """
- *         def __get__(self): return self._delegate.core.tid
- *         def __set__(self, tid): self._delegate.core.tid = tid             # <<<<<<<<<<<<<<
- * 
- *     property reference_start:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12reference_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tid); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12reference_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tid) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12reference_id_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_tid));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12reference_id_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tid) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int32_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2332);
-  __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_tid); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->_delegate->core.tid = __pyx_t_1;
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.reference_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2336
- *     property reference_start:
- *         """0-based leftmost coordinate"""
- *         def __get__(self): return self._delegate.core.pos             # <<<<<<<<<<<<<<
- *         def __set__(self, pos):
- *             ## setting the position requires updating the "bin" attribute
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15reference_start_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15reference_start_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15reference_start___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15reference_start___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2336);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_delegate->core.pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.reference_start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2337
- *         """0-based leftmost coordinate"""
- *         def __get__(self): return self._delegate.core.pos
- *         def __set__(self, pos):             # <<<<<<<<<<<<<<
- *             ## setting the position requires updating the "bin" attribute
- *             cdef bam1_t * src
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15reference_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15reference_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_pos) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15reference_start_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_pos));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15reference_start_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_pos) {
-  bam1_t *__pyx_v_src;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int32_t __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2337);
-
-  /* "pysam/calignmentfile.pyx":2340
- *             ## setting the position requires updating the "bin" attribute
- *             cdef bam1_t * src
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             src.core.pos = pos
- *             if pysam_get_n_cigar(src):
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2341
- *             cdef bam1_t * src
- *             src = self._delegate
- *             src.core.pos = pos             # <<<<<<<<<<<<<<
- *             if pysam_get_n_cigar(src):
- *                 pysam_set_bin(src,
- */
-  __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_v_pos); if (unlikely((__pyx_t_2 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_src->core.pos = __pyx_t_2;
-
-  /* "pysam/calignmentfile.pyx":2342
- *             src = self._delegate
- *             src.core.pos = pos
- *             if pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *                 pysam_set_bin(src,
- *                               hts_reg2bin(
- */
-  __pyx_t_3 = (pysam_get_n_cigar(__pyx_v_src) != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":2343
- *             src.core.pos = pos
- *             if pysam_get_n_cigar(src):
- *                 pysam_set_bin(src,             # <<<<<<<<<<<<<<
- *                               hts_reg2bin(
- *                                   src.core.pos,
- */
-    pysam_set_bin(__pyx_v_src, hts_reg2bin(__pyx_v_src->core.pos, bam_endpos(__pyx_v_src), 14, 5));
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":2350
- *                                   5))
- *             else:
- *                 pysam_set_bin(src,             # <<<<<<<<<<<<<<
- *                               hts_reg2bin(
- *                                   src.core.pos,
- */
-    pysam_set_bin(__pyx_v_src, hts_reg2bin(__pyx_v_src->core.pos, (__pyx_v_src->core.pos + 1), 14, 5));
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":2337
- *         """0-based leftmost coordinate"""
- *         def __get__(self): return self._delegate.core.pos
- *         def __set__(self, pos):             # <<<<<<<<<<<<<<
- *             ## setting the position requires updating the "bin" attribute
- *             cdef bam1_t * src
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.reference_start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2359
- *     property mapping_quality:
- *         """mapping quality"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return pysam_get_qual(self._delegate)
- *         def __set__(self, qual):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2359);
-
-  /* "pysam/calignmentfile.pyx":2360
- *         """mapping quality"""
- *         def __get__(self):
- *             return pysam_get_qual(self._delegate)             # <<<<<<<<<<<<<<
- *         def __set__(self, qual):
- *             pysam_set_qual(self._delegate, qual)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint8_t(pysam_get_qual(__pyx_v_self->_delegate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2359
- *     property mapping_quality:
- *         """mapping quality"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return pysam_get_qual(self._delegate)
- *         def __set__(self, qual):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mapping_quality.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2361
- *         def __get__(self):
- *             return pysam_get_qual(self._delegate)
- *         def __set__(self, qual):             # <<<<<<<<<<<<<<
- *             pysam_set_qual(self._delegate, qual)
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qual); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qual) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_qual));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_qual) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint8_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2361);
-
-  /* "pysam/calignmentfile.pyx":2362
- *             return pysam_get_qual(self._delegate)
- *         def __set__(self, qual):
- *             pysam_set_qual(self._delegate, qual)             # <<<<<<<<<<<<<<
- * 
- *     property cigarstring:
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint8_t(__pyx_v_qual); if (unlikely((__pyx_t_1 == (uint8_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_set_qual(__pyx_v_self->_delegate, __pyx_t_1);
-
-  /* "pysam/calignmentfile.pyx":2361
- *         def __get__(self):
- *             return pysam_get_qual(self._delegate)
- *         def __set__(self, qual):             # <<<<<<<<<<<<<<
- *             pysam_set_qual(self._delegate, qual)
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mapping_quality.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2381
- *         empty string.
- *         '''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             c = self.cigartuples
- *             if c is None:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigarstring___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigarstring___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_v_c = NULL;
-  PyObject *__pyx_v_x = NULL;
-  PyObject *__pyx_v_y = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  Py_ssize_t __pyx_t_5;
-  PyObject *(*__pyx_t_6)(PyObject *);
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *(*__pyx_t_11)(PyObject *);
-  Py_ssize_t __pyx_t_12;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2381);
-
-  /* "pysam/calignmentfile.pyx":2382
- *         '''
- *         def __get__(self):
- *             c = self.cigartuples             # <<<<<<<<<<<<<<
- *             if c is None:
- *                 return None
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cigartuples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_c = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":2383
- *         def __get__(self):
- *             c = self.cigartuples
- *             if c is None:             # <<<<<<<<<<<<<<
- *                 return None
- *             # reverse order
- */
-  __pyx_t_2 = (__pyx_v_c == Py_None);
-  __pyx_t_3 = (__pyx_t_2 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":2384
- *             c = self.cigartuples
- *             if c is None:
- *                 return None             # <<<<<<<<<<<<<<
- *             # reverse order
- *             else:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":2387
- *             # reverse order
- *             else:
- *                 return "".join([ "%i%c" % (y,CODE2CIGAR[x]) for x,y in c])             # <<<<<<<<<<<<<<
- * 
- *         def __set__(self, cigar):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    if (PyList_CheckExact(__pyx_v_c) || PyTuple_CheckExact(__pyx_v_c)) {
-      __pyx_t_4 = __pyx_v_c; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
-      __pyx_t_6 = NULL;
-    } else {
-      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_c); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
-        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
-        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_7 = __pyx_t_6(__pyx_t_4);
-        if (unlikely(!__pyx_t_7)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_7);
-      }
-      if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-        PyObject* sequence = __pyx_t_7;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        Py_ssize_t size = Py_SIZE(sequence);
-        #else
-        Py_ssize_t size = PySequence_Size(sequence);
-        #endif
-        if (unlikely(size != 2)) {
-          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        #if CYTHON_COMPILING_IN_CPYTHON
-        if (likely(PyTuple_CheckExact(sequence))) {
-          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
-          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
-        } else {
-          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
-          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
-        }
-        __Pyx_INCREF(__pyx_t_8);
-        __Pyx_INCREF(__pyx_t_9);
-        #else
-        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        #endif
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      } else {
-        Py_ssize_t index = -1;
-        __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
-        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_8);
-        index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_9);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_11 = NULL;
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        goto __pyx_L7_unpacking_done;
-        __pyx_L6_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __pyx_t_11 = NULL;
-        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L7_unpacking_done:;
-      }
-      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_8);
-      __pyx_t_8 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_9);
-      __pyx_t_9 = 0;
-      __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_7 = __Pyx_PyInt_From_char((__pyx_v_5pysam_14calignmentfile_CODE2CIGAR[__pyx_t_12])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_v_y);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_y);
-      __Pyx_GIVEREF(__pyx_v_y);
-      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_i_c, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2381
- *         empty string.
- *         '''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             c = self.cigartuples
- *             if c is None:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.cigarstring.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_c);
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XDECREF(__pyx_v_y);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2389
- *                 return "".join([ "%i%c" % (y,CODE2CIGAR[x]) for x,y in c])
- * 
- *         def __set__(self, cigar):             # <<<<<<<<<<<<<<
- *             if cigar is None or len(cigar) == 0:
- *                 self.cigartuples = []
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_cigar); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_cigar) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_cigar));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_cigar) {
-  PyObject *__pyx_v_parts = NULL;
-  PyObject *__pyx_v_x = NULL;
-  PyObject *__pyx_v_y = NULL;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  Py_ssize_t __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *(*__pyx_t_8)(PyObject *);
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *(*__pyx_t_12)(PyObject *);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2389);
-
-  /* "pysam/calignmentfile.pyx":2390
- * 
- *         def __set__(self, cigar):
- *             if cigar is None or len(cigar) == 0:             # <<<<<<<<<<<<<<
- *                 self.cigartuples = []
- *             else:
- */
-  __pyx_t_1 = (__pyx_v_cigar == Py_None);
-  if (!(__pyx_t_1 != 0)) {
-    __pyx_t_2 = PyObject_Length(__pyx_v_cigar); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = ((__pyx_t_2 == 0) != 0);
-    __pyx_t_4 = __pyx_t_3;
-  } else {
-    __pyx_t_4 = (__pyx_t_1 != 0);
-  }
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":2391
- *         def __set__(self, cigar):
- *             if cigar is None or len(cigar) == 0:
- *                 self.cigartuples = []             # <<<<<<<<<<<<<<
- *             else:
- *                 parts = CIGAR_REGEX.findall(cigar)
- */
-    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cigartuples, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":2393
- *                 self.cigartuples = []
- *             else:
- *                 parts = CIGAR_REGEX.findall(cigar)             # <<<<<<<<<<<<<<
- *                 # reverse order
- *                 self.cigartuples = [(CIGAR2CODE[ord(y)], int(x)) for x,y in parts]
- */
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_CIGAR_REGEX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_findall); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_INCREF(__pyx_v_cigar);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cigar);
-    __Pyx_GIVEREF(__pyx_v_cigar);
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_v_parts = __pyx_t_7;
-    __pyx_t_7 = 0;
-
-    /* "pysam/calignmentfile.pyx":2395
- *                 parts = CIGAR_REGEX.findall(cigar)
- *                 # reverse order
- *                 self.cigartuples = [(CIGAR2CODE[ord(y)], int(x)) for x,y in parts]             # <<<<<<<<<<<<<<
- * 
- *     # TODO
- */
-    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    if (PyList_CheckExact(__pyx_v_parts) || PyTuple_CheckExact(__pyx_v_parts)) {
-      __pyx_t_5 = __pyx_v_parts; __Pyx_INCREF(__pyx_t_5); __pyx_t_2 = 0;
-      __pyx_t_8 = NULL;
-    } else {
-      __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_parts); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_5)) {
-        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_5)) {
-        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_6 = __pyx_t_8(__pyx_t_5);
-        if (unlikely(!__pyx_t_6)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_6);
-      }
-      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
-        PyObject* sequence = __pyx_t_6;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        Py_ssize_t size = Py_SIZE(sequence);
-        #else
-        Py_ssize_t size = PySequence_Size(sequence);
-        #endif
-        if (unlikely(size != 2)) {
-          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        #if CYTHON_COMPILING_IN_CPYTHON
-        if (likely(PyTuple_CheckExact(sequence))) {
-          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
-          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
-        } else {
-          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
-          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
-        }
-        __Pyx_INCREF(__pyx_t_9);
-        __Pyx_INCREF(__pyx_t_10);
-        #else
-        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        #endif
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      } else {
-        Py_ssize_t index = -1;
-        __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
-        index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_9);
-        index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_10);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_12 = NULL;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        goto __pyx_L7_unpacking_done;
-        __pyx_L6_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __pyx_t_12 = NULL;
-        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L7_unpacking_done:;
-      }
-      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9);
-      __pyx_t_9 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_10);
-      __pyx_t_10 = 0;
-      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_CIGAR2CODE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_INCREF(__pyx_v_y);
-      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_y);
-      __Pyx_GIVEREF(__pyx_v_y);
-      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_t_10 = PyObject_GetItem(__pyx_t_6, __pyx_t_9); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_9 = PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10);
-      __Pyx_GIVEREF(__pyx_t_10);
-      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      __pyx_t_10 = 0;
-      __pyx_t_9 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cigartuples, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":2389
- *                 return "".join([ "%i%c" % (y,CODE2CIGAR[x]) for x,y in c])
- * 
- *         def __set__(self, cigar):             # <<<<<<<<<<<<<<
- *             if cigar is None or len(cigar) == 0:
- *                 self.cigartuples = []
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.cigarstring.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_parts);
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XDECREF(__pyx_v_y);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2403
- *     property next_reference_id:
- *         """the :term:`reference` id of the mate/next read."""
- *         def __get__(self): return self._delegate.core.mtid             # <<<<<<<<<<<<<<
- *         def __set__(self, mtid):
- *             self._delegate.core.mtid = mtid
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2403);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_delegate->core.mtid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.next_reference_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2404
- *         """the :term:`reference` id of the mate/next read."""
- *         def __get__(self): return self._delegate.core.mtid
- *         def __set__(self, mtid):             # <<<<<<<<<<<<<<
- *             self._delegate.core.mtid = mtid
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mtid); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mtid) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_mtid));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_mtid) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int32_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2404);
-
-  /* "pysam/calignmentfile.pyx":2405
- *         def __get__(self): return self._delegate.core.mtid
- *         def __set__(self, mtid):
- *             self._delegate.core.mtid = mtid             # <<<<<<<<<<<<<<
- * 
- *     property next_reference_start:
- */
-  __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_mtid); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->_delegate->core.mtid = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2404
- *         """the :term:`reference` id of the mate/next read."""
- *         def __get__(self): return self._delegate.core.mtid
- *         def __set__(self, mtid):             # <<<<<<<<<<<<<<
- *             self._delegate.core.mtid = mtid
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.next_reference_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2409
- *     property next_reference_start:
- *         """the position of the mate/next read."""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.core.mpos
- *         def __set__(self, mpos):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2409);
-
-  /* "pysam/calignmentfile.pyx":2410
- *         """the position of the mate/next read."""
- *         def __get__(self):
- *             return self._delegate.core.mpos             # <<<<<<<<<<<<<<
- *         def __set__(self, mpos):
- *             self._delegate.core.mpos = mpos
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_delegate->core.mpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2409
- *     property next_reference_start:
- *         """the position of the mate/next read."""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.core.mpos
- *         def __set__(self, mpos):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.next_reference_start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2411
- *         def __get__(self):
- *             return self._delegate.core.mpos
- *         def __set__(self, mpos):             # <<<<<<<<<<<<<<
- *             self._delegate.core.mpos = mpos
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mpos); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_mpos) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_mpos));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_mpos) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int32_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2411);
-
-  /* "pysam/calignmentfile.pyx":2412
- *             return self._delegate.core.mpos
- *         def __set__(self, mpos):
- *             self._delegate.core.mpos = mpos             # <<<<<<<<<<<<<<
- * 
- *     property query_length:
- */
-  __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_mpos); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->_delegate->core.mpos = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2411
- *         def __get__(self):
- *             return self._delegate.core.mpos
- *         def __set__(self, mpos):             # <<<<<<<<<<<<<<
- *             self._delegate.core.mpos = mpos
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.next_reference_start.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2425
- *         This property can be set by providing a sequence.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.core.l_qseq
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12query_length_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12query_length_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12query_length___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12query_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2425);
-
-  /* "pysam/calignmentfile.pyx":2426
- *         """
- *         def __get__(self):
- *             return self._delegate.core.l_qseq             # <<<<<<<<<<<<<<
- * 
- *     property template_length:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_delegate->core.l_qseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2425
- *         This property can be set by providing a sequence.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.core.l_qseq
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2430
- *     property template_length:
- *         """the observed query template length"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.core.isize
- *         def __set__(self, isize):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15template_length_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15template_length_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15template_length___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15template_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2430);
-
-  /* "pysam/calignmentfile.pyx":2431
- *         """the observed query template length"""
- *         def __get__(self):
- *             return self._delegate.core.isize             # <<<<<<<<<<<<<<
- *         def __set__(self, isize):
- *             self._delegate.core.isize = isize
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_delegate->core.isize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2430
- *     property template_length:
- *         """the observed query template length"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.core.isize
- *         def __set__(self, isize):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.template_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2432
- *         def __get__(self):
- *             return self._delegate.core.isize
- *         def __set__(self, isize):             # <<<<<<<<<<<<<<
- *             self._delegate.core.isize = isize
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15template_length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_isize); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15template_length_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_isize) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15template_length_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_isize));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15template_length_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_isize) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int32_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2432);
-
-  /* "pysam/calignmentfile.pyx":2433
- *             return self._delegate.core.isize
- *         def __set__(self, isize):
- *             self._delegate.core.isize = isize             # <<<<<<<<<<<<<<
- * 
- *     property query_sequence:
- */
-  __pyx_t_1 = __Pyx_PyInt_As_int32_t(__pyx_v_isize); if (unlikely((__pyx_t_1 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->_delegate->core.isize = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2432
- *         def __get__(self):
- *             return self._delegate.core.isize
- *         def __set__(self, isize):             # <<<<<<<<<<<<<<
- *             self._delegate.core.isize = isize
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.template_length.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2451
- *         sequence.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef char * s
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14query_sequence___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14query_sequence___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2451);
-
-  /* "pysam/calignmentfile.pyx":2454
- *             cdef bam1_t * src
- *             cdef char * s
- *             src = self._delegate             # <<<<<<<<<<<<<<
- * 
- *             if src.core.l_qseq == 0: return None
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2456
- *             src = self._delegate
- * 
- *             if src.core.l_qseq == 0: return None             # <<<<<<<<<<<<<<
- * 
- *             return _getSequenceRange(src, 0, src.core.l_qseq)
- */
-  __pyx_t_2 = ((__pyx_v_src->core.l_qseq == 0) != 0);
-  if (__pyx_t_2) {
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2458
- *             if src.core.l_qseq == 0: return None
- * 
- *             return _getSequenceRange(src, 0, src.core.l_qseq)             # <<<<<<<<<<<<<<
- * 
- *         def __set__(self, seq):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__getSequenceRange(__pyx_v_src, 0, __pyx_v_src->core.l_qseq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2451
- *         sequence.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef char * s
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_sequence.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2460
- *             return _getSequenceRange(src, 0, src.core.l_qseq)
- * 
- *         def __set__(self, seq):             # <<<<<<<<<<<<<<
- *             # samtools manages sequence and quality length memory together
- *             # if no quality information is present, the first byte says 0xff.
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_seq); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_seq) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_seq));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_seq) {
-  bam1_t *__pyx_v_src;
-  uint8_t *__pyx_v_p;
-  char *__pyx_v_s;
-  int __pyx_v_l;
-  int __pyx_v_k;
-  int __pyx_v_nbytes_new;
-  int __pyx_v_nbytes_old;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  Py_ssize_t __pyx_t_3;
-  bam1_t *__pyx_t_4;
-  int __pyx_t_5;
-  char *__pyx_t_6;
-  long __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2460);
-  __Pyx_INCREF(__pyx_v_seq);
-
-  /* "pysam/calignmentfile.pyx":2468
- *             cdef int l, k, nbytes_new, nbytes_old
- * 
- *             if seq == None:             # <<<<<<<<<<<<<<
- *                 l = 0
- *             else:
- */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_seq, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2469
- * 
- *             if seq == None:
- *                 l = 0             # <<<<<<<<<<<<<<
- *             else:
- *                 l = len(seq)
- */
-    __pyx_v_l = 0;
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":2471
- *                 l = 0
- *             else:
- *                 l = len(seq)             # <<<<<<<<<<<<<<
- *                 seq = _forceBytes(seq)
- * 
- */
-    __pyx_t_3 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_l = __pyx_t_3;
-
-    /* "pysam/calignmentfile.pyx":2472
- *             else:
- *                 l = len(seq)
- *                 seq = _forceBytes(seq)             # <<<<<<<<<<<<<<
- * 
- *             src = self._delegate
- */
-    __pyx_t_1 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_1);
-    __pyx_t_1 = 0;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":2474
- *                 seq = _forceBytes(seq)
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- * 
- *             # as the sequence is stored in half-bytes, the total length (sequence
- */
-  __pyx_t_4 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":2478
- *             # as the sequence is stored in half-bytes, the total length (sequence
- *             # plus quality scores) is (l+1)/2 + l
- *             nbytes_new = (l + 1) / 2 + l             # <<<<<<<<<<<<<<
- *             nbytes_old = (src.core.l_qseq + 1) / 2 + src.core.l_qseq
- * 
- */
-  __pyx_v_nbytes_new = (__Pyx_div_long((__pyx_v_l + 1), 2) + __pyx_v_l);
-
-  /* "pysam/calignmentfile.pyx":2479
- *             # plus quality scores) is (l+1)/2 + l
- *             nbytes_new = (l + 1) / 2 + l
- *             nbytes_old = (src.core.l_qseq + 1) / 2 + src.core.l_qseq             # <<<<<<<<<<<<<<
- * 
- *             # acquire pointer to location in memory
- */
-  __pyx_v_nbytes_old = (__Pyx_div_long((__pyx_v_src->core.l_qseq + 1), 2) + __pyx_v_src->core.l_qseq);
-
-  /* "pysam/calignmentfile.pyx":2482
- * 
- *             # acquire pointer to location in memory
- *             p = pysam_bam_get_seq(src)             # <<<<<<<<<<<<<<
- *             src.core.l_qseq = l
- * 
- */
-  __pyx_v_p = pysam_bam_get_seq(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2483
- *             # acquire pointer to location in memory
- *             p = pysam_bam_get_seq(src)
- *             src.core.l_qseq = l             # <<<<<<<<<<<<<<
- * 
- *             # change length of data field
- */
-  __pyx_v_src->core.l_qseq = __pyx_v_l;
-
-  /* "pysam/calignmentfile.pyx":2486
- * 
- *             # change length of data field
- *             pysam_bam_update(src,             # <<<<<<<<<<<<<<
- *                              nbytes_old,
- *                              nbytes_new,
- */
-  pysam_bam_update(__pyx_v_src, __pyx_v_nbytes_old, __pyx_v_nbytes_new, __pyx_v_p);
-
-  /* "pysam/calignmentfile.pyx":2491
- *                              p)
- * 
- *             if l > 0:             # <<<<<<<<<<<<<<
- *                 # re-acquire pointer to location in memory
- *                 # as it might have moved
- */
-  __pyx_t_2 = ((__pyx_v_l > 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2494
- *                 # re-acquire pointer to location in memory
- *                 # as it might have moved
- *                 p = pysam_bam_get_seq(src)             # <<<<<<<<<<<<<<
- *                 for k from 0 <= k < nbytes_new:
- *                     p[k] = 0
- */
-    __pyx_v_p = pysam_bam_get_seq(__pyx_v_src);
-
-    /* "pysam/calignmentfile.pyx":2495
- *                 # as it might have moved
- *                 p = pysam_bam_get_seq(src)
- *                 for k from 0 <= k < nbytes_new:             # <<<<<<<<<<<<<<
- *                     p[k] = 0
- *                 # convert to C string
- */
-    __pyx_t_5 = __pyx_v_nbytes_new;
-    for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
-
-      /* "pysam/calignmentfile.pyx":2496
- *                 p = pysam_bam_get_seq(src)
- *                 for k from 0 <= k < nbytes_new:
- *                     p[k] = 0             # <<<<<<<<<<<<<<
- *                 # convert to C string
- *                 s = seq
- */
-      (__pyx_v_p[__pyx_v_k]) = 0;
-    }
-
-    /* "pysam/calignmentfile.pyx":2498
- *                     p[k] = 0
- *                 # convert to C string
- *                 s = seq             # <<<<<<<<<<<<<<
- *                 for k from 0 <= k < l:
- *                     p[k/2] |= seq_nt16_table[<unsigned char>s[k]] << 4 * (1 - k % 2)
- */
-    __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_seq); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_s = __pyx_t_6;
-
-    /* "pysam/calignmentfile.pyx":2499
- *                 # convert to C string
- *                 s = seq
- *                 for k from 0 <= k < l:             # <<<<<<<<<<<<<<
- *                     p[k/2] |= seq_nt16_table[<unsigned char>s[k]] << 4 * (1 - k % 2)
- * 
- */
-    __pyx_t_5 = __pyx_v_l;
-    for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
-
-      /* "pysam/calignmentfile.pyx":2500
- *                 s = seq
- *                 for k from 0 <= k < l:
- *                     p[k/2] |= seq_nt16_table[<unsigned char>s[k]] << 4 * (1 - k % 2)             # <<<<<<<<<<<<<<
- * 
- *                 # erase qualities
- */
-      __pyx_t_7 = __Pyx_div_long(__pyx_v_k, 2);
-      (__pyx_v_p[__pyx_t_7]) = ((__pyx_v_p[__pyx_t_7]) | ((seq_nt16_table[((unsigned char)(__pyx_v_s[__pyx_v_k]))]) << (4 * (1 - __Pyx_mod_long(__pyx_v_k, 2)))));
-    }
-
-    /* "pysam/calignmentfile.pyx":2503
- * 
- *                 # erase qualities
- *                 p = pysam_bam_get_qual(src)             # <<<<<<<<<<<<<<
- *                 p[0] = 0xff
- * 
- */
-    __pyx_v_p = pysam_bam_get_qual(__pyx_v_src);
-
-    /* "pysam/calignmentfile.pyx":2504
- *                 # erase qualities
- *                 p = pysam_bam_get_qual(src)
- *                 p[0] = 0xff             # <<<<<<<<<<<<<<
- * 
- *     property query_qualities:
- */
-    (__pyx_v_p[0]) = 0xff;
-    goto __pyx_L4;
-  }
-  __pyx_L4:;
-
-  /* "pysam/calignmentfile.pyx":2460
- *             return _getSequenceRange(src, 0, src.core.l_qseq)
- * 
- *         def __set__(self, seq):             # <<<<<<<<<<<<<<
- *             # samtools manages sequence and quality length memory together
- *             # if no quality information is present, the first byte says 0xff.
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_sequence.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_seq);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2523
- * 
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- * 
- *             cdef bam1_t * src
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15query_qualities___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15query_qualities___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2523);
-
-  /* "pysam/calignmentfile.pyx":2528
- *             cdef char * q
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- * 
- *             if src.core.l_qseq == 0:
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2530
- *             src = self._delegate
- * 
- *             if src.core.l_qseq == 0:             # <<<<<<<<<<<<<<
- *                 return None
- * 
- */
-  __pyx_t_2 = ((__pyx_v_src->core.l_qseq == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2531
- * 
- *             if src.core.l_qseq == 0:
- *                 return None             # <<<<<<<<<<<<<<
- * 
- *             return _getQualitiesRange(src, 0, src.core.l_qseq)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2533
- *                 return None
- * 
- *             return _getQualitiesRange(src, 0, src.core.l_qseq)             # <<<<<<<<<<<<<<
- * 
- *         def __set__(self, qual):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__getQualitiesRange(__pyx_v_src, 0, __pyx_v_src->core.l_qseq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2523
- * 
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- * 
- *             cdef bam1_t * src
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_qualities.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2535
- *             return _getQualitiesRange(src, 0, src.core.l_qseq)
- * 
- *         def __set__(self, qual):             # <<<<<<<<<<<<<<
- *             # note that memory is already allocated via setting the sequence
- *             # hence length match of sequence and quality needs is checked.
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qual); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_qual) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_qual));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_qual) {
-  bam1_t *__pyx_v_src;
-  uint8_t *__pyx_v_p;
-  int __pyx_v_l;
-  arrayobject *__pyx_v_result = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  Py_ssize_t __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  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("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2535);
-
-  /* "pysam/calignmentfile.pyx":2542
- *             cdef int l
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             p = pysam_bam_get_qual(src)
- *             if qual is None or len(qual) == 0:
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2543
- * 
- *             src = self._delegate
- *             p = pysam_bam_get_qual(src)             # <<<<<<<<<<<<<<
- *             if qual is None or len(qual) == 0:
- *                 # if absent - set to 0xff
- */
-  __pyx_v_p = pysam_bam_get_qual(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2544
- *             src = self._delegate
- *             p = pysam_bam_get_qual(src)
- *             if qual is None or len(qual) == 0:             # <<<<<<<<<<<<<<
- *                 # if absent - set to 0xff
- *                 p[0] = 0xff
- */
-  __pyx_t_2 = (__pyx_v_qual == Py_None);
-  if (!(__pyx_t_2 != 0)) {
-    __pyx_t_3 = PyObject_Length(__pyx_v_qual); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = ((__pyx_t_3 == 0) != 0);
-    __pyx_t_5 = __pyx_t_4;
-  } else {
-    __pyx_t_5 = (__pyx_t_2 != 0);
-  }
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":2546
- *             if qual is None or len(qual) == 0:
- *                 # if absent - set to 0xff
- *                 p[0] = 0xff             # <<<<<<<<<<<<<<
- *                 return
- * 
- */
-    (__pyx_v_p[0]) = 0xff;
-
-    /* "pysam/calignmentfile.pyx":2547
- *                 # if absent - set to 0xff
- *                 p[0] = 0xff
- *                 return             # <<<<<<<<<<<<<<
- * 
- *             # check for length match
- */
-    __pyx_r = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2550
- * 
- *             # check for length match
- *             l = len(qual)             # <<<<<<<<<<<<<<
- *             if src.core.l_qseq != l:
- *                 raise ValueError(
- */
-  __pyx_t_3 = PyObject_Length(__pyx_v_qual); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_l = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":2551
- *             # check for length match
- *             l = len(qual)
- *             if src.core.l_qseq != l:             # <<<<<<<<<<<<<<
- *                 raise ValueError(
- *                     "quality and sequence mismatch: %i != %i" %
- */
-  __pyx_t_5 = ((__pyx_v_src->core.l_qseq != __pyx_v_l) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":2554
- *                 raise ValueError(
- *                     "quality and sequence mismatch: %i != %i" %
- *                     (l, src.core.l_qseq))             # <<<<<<<<<<<<<<
- * 
- *             # create a python array object filling it
- */
-    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_src->core.l_qseq); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_6 = 0;
-    __pyx_t_7 = 0;
-
-    /* "pysam/calignmentfile.pyx":2553
- *             if src.core.l_qseq != l:
- *                 raise ValueError(
- *                     "quality and sequence mismatch: %i != %i" %             # <<<<<<<<<<<<<<
- *                     (l, src.core.l_qseq))
- * 
- */
-    __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_quality_and_sequence_mismatch_i, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-    /* "pysam/calignmentfile.pyx":2552
- *             l = len(qual)
- *             if src.core.l_qseq != l:
- *                 raise ValueError(             # <<<<<<<<<<<<<<
- *                     "quality and sequence mismatch: %i != %i" %
- *                     (l, src.core.l_qseq))
- */
-    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __pyx_t_7 = 0;
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":2561
- *             # NB: should avoid this copying if qual is
- *             # already of the correct type.
- *             cdef array.array result = array.array('B', qual)             # <<<<<<<<<<<<<<
- * 
- *             # copy data
- */
-  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_INCREF(__pyx_n_s_B);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_B);
-  __Pyx_GIVEREF(__pyx_n_s_B);
-  __Pyx_INCREF(__pyx_v_qual);
-  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_qual);
-  __Pyx_GIVEREF(__pyx_v_qual);
-  __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7cpython_5array_array)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_v_result = ((arrayobject *)__pyx_t_8);
-  __pyx_t_8 = 0;
-
-  /* "pysam/calignmentfile.pyx":2564
- * 
- *             # copy data
- *             memcpy(p, result.data.as_voidptr, l)             # <<<<<<<<<<<<<<
- * 
- *     # TODO: opts object with mapping-like interface
- */
-  memcpy(__pyx_v_p, __pyx_v_result->data.as_voidptr, __pyx_v_l);
-
-  /* "pysam/calignmentfile.pyx":2535
- *             return _getQualitiesRange(src, 0, src.core.l_qseq)
- * 
- *         def __set__(self, qual):             # <<<<<<<<<<<<<<
- *             # note that memory is already allocated via setting the sequence
- *             # hence length match of sequence and quality needs is checked.
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_qualities.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_result);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2581
- *         multiple times.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef char * ctag
- *             cdef bam1_t * src
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tags_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tags_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tags___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tags___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  uint8_t *__pyx_v_s;
-  char __pyx_v_auxtag[3];
-  char __pyx_v_auxtype;
-  uint8_t __pyx_v_byte_size;
-  int32_t __pyx_v_nvalues;
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_v_value = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  Py_ssize_t __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *(*__pyx_t_9)(PyObject *);
-  uint8_t __pyx_t_10;
-  int32_t __pyx_t_11;
-  int __pyx_t_12;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2581);
-
-  /* "pysam/calignmentfile.pyx":2590
- *             cdef int32_t nvalues
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             if src.l_data == 0:
- *                 return []
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2591
- * 
- *             src = self._delegate
- *             if src.l_data == 0:             # <<<<<<<<<<<<<<
- *                 return []
- *             s = pysam_bam_get_aux(src)
- */
-  __pyx_t_2 = ((__pyx_v_src->l_data == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2592
- *             src = self._delegate
- *             if src.l_data == 0:
- *                 return []             # <<<<<<<<<<<<<<
- *             s = pysam_bam_get_aux(src)
- *             result = []
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2593
- *             if src.l_data == 0:
- *                 return []
- *             s = pysam_bam_get_aux(src)             # <<<<<<<<<<<<<<
- *             result = []
- *             auxtag[2] = 0
- */
-  __pyx_v_s = pysam_bam_get_aux(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2594
- *                 return []
- *             s = pysam_bam_get_aux(src)
- *             result = []             # <<<<<<<<<<<<<<
- *             auxtag[2] = 0
- *             while s < (src.data + src.l_data):
- */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_v_result = ((PyObject*)__pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":2595
- *             s = pysam_bam_get_aux(src)
- *             result = []
- *             auxtag[2] = 0             # <<<<<<<<<<<<<<
- *             while s < (src.data + src.l_data):
- *                 # get tag
- */
-  (__pyx_v_auxtag[2]) = 0;
-
-  /* "pysam/calignmentfile.pyx":2596
- *             result = []
- *             auxtag[2] = 0
- *             while s < (src.data + src.l_data):             # <<<<<<<<<<<<<<
- *                 # get tag
- *                 auxtag[0] = s[0]
- */
-  while (1) {
-    __pyx_t_2 = ((__pyx_v_s < (__pyx_v_src->data + __pyx_v_src->l_data)) != 0);
-    if (!__pyx_t_2) break;
-
-    /* "pysam/calignmentfile.pyx":2598
- *             while s < (src.data + src.l_data):
- *                 # get tag
- *                 auxtag[0] = s[0]             # <<<<<<<<<<<<<<
- *                 auxtag[1] = s[1]
- *                 s += 2
- */
-    (__pyx_v_auxtag[0]) = (__pyx_v_s[0]);
-
-    /* "pysam/calignmentfile.pyx":2599
- *                 # get tag
- *                 auxtag[0] = s[0]
- *                 auxtag[1] = s[1]             # <<<<<<<<<<<<<<
- *                 s += 2
- *                 auxtype = s[0]
- */
-    (__pyx_v_auxtag[1]) = (__pyx_v_s[1]);
-
-    /* "pysam/calignmentfile.pyx":2600
- *                 auxtag[0] = s[0]
- *                 auxtag[1] = s[1]
- *                 s += 2             # <<<<<<<<<<<<<<
- *                 auxtype = s[0]
- *                 if auxtype in ('c', 'C'):
- */
-    __pyx_v_s = (__pyx_v_s + 2);
-
-    /* "pysam/calignmentfile.pyx":2601
- *                 auxtag[1] = s[1]
- *                 s += 2
- *                 auxtype = s[0]             # <<<<<<<<<<<<<<
- *                 if auxtype in ('c', 'C'):
- *                     value = <int>bam_aux2i(s)
- */
-    __pyx_v_auxtype = (__pyx_v_s[0]);
-
-    /* "pysam/calignmentfile.pyx":2624
- *                     # +1 for NULL terminated string
- *                     s += len(value) + 1
- *                 elif auxtype == 'B':             # <<<<<<<<<<<<<<
- *                     s += 1
- *                     byte_size, nvalues, value = convertBinaryTagToList( s )
- */
-    switch (__pyx_v_auxtype) {
-
-      /* "pysam/calignmentfile.pyx":2602
- *                 s += 2
- *                 auxtype = s[0]
- *                 if auxtype in ('c', 'C'):             # <<<<<<<<<<<<<<
- *                     value = <int>bam_aux2i(s)
- *                     s += 1
- */
-      case 'c':
-      case 'C':
-
-      /* "pysam/calignmentfile.pyx":2603
- *                 auxtype = s[0]
- *                 if auxtype in ('c', 'C'):
- *                     value = <int>bam_aux2i(s)             # <<<<<<<<<<<<<<
- *                     s += 1
- *                 elif auxtype in ('s', 'S'):
- */
-      __pyx_t_3 = __Pyx_PyInt_From_int(((int)bam_aux2i(__pyx_v_s))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
-      __pyx_t_3 = 0;
-
-      /* "pysam/calignmentfile.pyx":2604
- *                 if auxtype in ('c', 'C'):
- *                     value = <int>bam_aux2i(s)
- *                     s += 1             # <<<<<<<<<<<<<<
- *                 elif auxtype in ('s', 'S'):
- *                     value = <int>bam_aux2i(s)
- */
-      __pyx_v_s = (__pyx_v_s + 1);
-      break;
-
-      /* "pysam/calignmentfile.pyx":2605
- *                     value = <int>bam_aux2i(s)
- *                     s += 1
- *                 elif auxtype in ('s', 'S'):             # <<<<<<<<<<<<<<
- *                     value = <int>bam_aux2i(s)
- *                     s += 2
- */
-      case 's':
-      case 'S':
-
-      /* "pysam/calignmentfile.pyx":2606
- *                     s += 1
- *                 elif auxtype in ('s', 'S'):
- *                     value = <int>bam_aux2i(s)             # <<<<<<<<<<<<<<
- *                     s += 2
- *                 elif auxtype in ('i', 'I'):
- */
-      __pyx_t_3 = __Pyx_PyInt_From_int(((int)bam_aux2i(__pyx_v_s))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
-      __pyx_t_3 = 0;
-
-      /* "pysam/calignmentfile.pyx":2607
- *                 elif auxtype in ('s', 'S'):
- *                     value = <int>bam_aux2i(s)
- *                     s += 2             # <<<<<<<<<<<<<<
- *                 elif auxtype in ('i', 'I'):
- *                     value = <int32_t>bam_aux2i(s)
- */
-      __pyx_v_s = (__pyx_v_s + 2);
-      break;
-
-      /* "pysam/calignmentfile.pyx":2608
- *                     value = <int>bam_aux2i(s)
- *                     s += 2
- *                 elif auxtype in ('i', 'I'):             # <<<<<<<<<<<<<<
- *                     value = <int32_t>bam_aux2i(s)
- *                     s += 4
- */
-      case 'i':
-      case 'I':
-
-      /* "pysam/calignmentfile.pyx":2609
- *                     s += 2
- *                 elif auxtype in ('i', 'I'):
- *                     value = <int32_t>bam_aux2i(s)             # <<<<<<<<<<<<<<
- *                     s += 4
- *                 elif auxtype == 'f':
- */
-      __pyx_t_3 = __Pyx_PyInt_From_int32_t(((int32_t)bam_aux2i(__pyx_v_s))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
-      __pyx_t_3 = 0;
-
-      /* "pysam/calignmentfile.pyx":2610
- *                 elif auxtype in ('i', 'I'):
- *                     value = <int32_t>bam_aux2i(s)
- *                     s += 4             # <<<<<<<<<<<<<<
- *                 elif auxtype == 'f':
- *                     value = <float>bam_aux2f(s)
- */
-      __pyx_v_s = (__pyx_v_s + 4);
-      break;
-
-      /* "pysam/calignmentfile.pyx":2611
- *                     value = <int32_t>bam_aux2i(s)
- *                     s += 4
- *                 elif auxtype == 'f':             # <<<<<<<<<<<<<<
- *                     value = <float>bam_aux2f(s)
- *                     s += 4
- */
-      case 'f':
-
-      /* "pysam/calignmentfile.pyx":2612
- *                     s += 4
- *                 elif auxtype == 'f':
- *                     value = <float>bam_aux2f(s)             # <<<<<<<<<<<<<<
- *                     s += 4
- *                 elif auxtype == 'd':
- */
-      __pyx_t_3 = PyFloat_FromDouble(((float)bam_aux2f(__pyx_v_s))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
-      __pyx_t_3 = 0;
-
-      /* "pysam/calignmentfile.pyx":2613
- *                 elif auxtype == 'f':
- *                     value = <float>bam_aux2f(s)
- *                     s += 4             # <<<<<<<<<<<<<<
- *                 elif auxtype == 'd':
- *                     value = <double>bam_aux2f(s)
- */
-      __pyx_v_s = (__pyx_v_s + 4);
-      break;
-
-      /* "pysam/calignmentfile.pyx":2614
- *                     value = <float>bam_aux2f(s)
- *                     s += 4
- *                 elif auxtype == 'd':             # <<<<<<<<<<<<<<
- *                     value = <double>bam_aux2f(s)
- *                     s += 8
- */
-      case 'd':
-
-      /* "pysam/calignmentfile.pyx":2615
- *                     s += 4
- *                 elif auxtype == 'd':
- *                     value = <double>bam_aux2f(s)             # <<<<<<<<<<<<<<
- *                     s += 8
- *                 elif auxtype == 'A':
- */
-      __pyx_t_3 = PyFloat_FromDouble(((double)bam_aux2f(__pyx_v_s))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
-      __pyx_t_3 = 0;
-
-      /* "pysam/calignmentfile.pyx":2616
- *                 elif auxtype == 'd':
- *                     value = <double>bam_aux2f(s)
- *                     s += 8             # <<<<<<<<<<<<<<
- *                 elif auxtype == 'A':
- *                     value = "%c" % <char>bam_aux2A(s)
- */
-      __pyx_v_s = (__pyx_v_s + 8);
-      break;
-
-      /* "pysam/calignmentfile.pyx":2617
- *                     value = <double>bam_aux2f(s)
- *                     s += 8
- *                 elif auxtype == 'A':             # <<<<<<<<<<<<<<
- *                     value = "%c" % <char>bam_aux2A(s)
- *                     s += 1
- */
-      case 'A':
-
-      /* "pysam/calignmentfile.pyx":2618
- *                     s += 8
- *                 elif auxtype == 'A':
- *                     value = "%c" % <char>bam_aux2A(s)             # <<<<<<<<<<<<<<
- *                     s += 1
- *                 elif auxtype in ('Z', 'H'):
- */
-      __pyx_t_3 = __Pyx_PyInt_From_char(((char)bam_aux2A(__pyx_v_s))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_c_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4);
-      __pyx_t_4 = 0;
-
-      /* "pysam/calignmentfile.pyx":2619
- *                 elif auxtype == 'A':
- *                     value = "%c" % <char>bam_aux2A(s)
- *                     s += 1             # <<<<<<<<<<<<<<
- *                 elif auxtype in ('Z', 'H'):
- *                     value = _charptr_to_str(<char*>bam_aux2Z(s))
- */
-      __pyx_v_s = (__pyx_v_s + 1);
-      break;
-
-      /* "pysam/calignmentfile.pyx":2620
- *                     value = "%c" % <char>bam_aux2A(s)
- *                     s += 1
- *                 elif auxtype in ('Z', 'H'):             # <<<<<<<<<<<<<<
- *                     value = _charptr_to_str(<char*>bam_aux2Z(s))
- *                     # +1 for NULL terminated string
- */
-      case 'Z':
-      case 'H':
-
-      /* "pysam/calignmentfile.pyx":2621
- *                     s += 1
- *                 elif auxtype in ('Z', 'H'):
- *                     value = _charptr_to_str(<char*>bam_aux2Z(s))             # <<<<<<<<<<<<<<
- *                     # +1 for NULL terminated string
- *                     s += len(value) + 1
- */
-      __pyx_t_4 = __pyx_f_5pysam_14calignmentfile__charptr_to_str(((char *)bam_aux2Z(__pyx_v_s))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4);
-      __pyx_t_4 = 0;
-
-      /* "pysam/calignmentfile.pyx":2623
- *                     value = _charptr_to_str(<char*>bam_aux2Z(s))
- *                     # +1 for NULL terminated string
- *                     s += len(value) + 1             # <<<<<<<<<<<<<<
- *                 elif auxtype == 'B':
- *                     s += 1
- */
-      __pyx_t_5 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_v_s = (__pyx_v_s + (__pyx_t_5 + 1));
-      break;
-
-      /* "pysam/calignmentfile.pyx":2624
- *                     # +1 for NULL terminated string
- *                     s += len(value) + 1
- *                 elif auxtype == 'B':             # <<<<<<<<<<<<<<
- *                     s += 1
- *                     byte_size, nvalues, value = convertBinaryTagToList( s )
- */
-      case 'B':
-
-      /* "pysam/calignmentfile.pyx":2625
- *                     s += len(value) + 1
- *                 elif auxtype == 'B':
- *                     s += 1             # <<<<<<<<<<<<<<
- *                     byte_size, nvalues, value = convertBinaryTagToList( s )
- *                     # 5 for 1 char and 1 int
- */
-      __pyx_v_s = (__pyx_v_s + 1);
-
-      /* "pysam/calignmentfile.pyx":2626
- *                 elif auxtype == 'B':
- *                     s += 1
- *                     byte_size, nvalues, value = convertBinaryTagToList( s )             # <<<<<<<<<<<<<<
- *                     # 5 for 1 char and 1 int
- *                     s += 5 + ( nvalues * byte_size) - 1
- */
-      __pyx_t_4 = __pyx_f_5pysam_14calignmentfile_convertBinaryTagToList(__pyx_v_s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-        PyObject* sequence = __pyx_t_4;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        Py_ssize_t size = Py_SIZE(sequence);
-        #else
-        Py_ssize_t size = PySequence_Size(sequence);
-        #endif
-        if (unlikely(size != 3)) {
-          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
-          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        #if CYTHON_COMPILING_IN_CPYTHON
-        if (likely(PyTuple_CheckExact(sequence))) {
-          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
-          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
-        } else {
-          __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
-          __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
-        }
-        __Pyx_INCREF(__pyx_t_3);
-        __Pyx_INCREF(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_7);
-        #else
-        __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        #endif
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      } else {
-        Py_ssize_t index = -1;
-        __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
-        index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_3);
-        index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_6);
-        index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_7);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_9 = NULL;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        goto __pyx_L7_unpacking_done;
-        __pyx_L6_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_9 = NULL;
-        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L7_unpacking_done:;
-      }
-      __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_10 == (uint8_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_11 = __Pyx_PyInt_As_int32_t(__pyx_t_6); if (unlikely((__pyx_t_11 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_v_byte_size = __pyx_t_10;
-      __pyx_v_nvalues = __pyx_t_11;
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
-      __pyx_t_7 = 0;
-
-      /* "pysam/calignmentfile.pyx":2628
- *                     byte_size, nvalues, value = convertBinaryTagToList( s )
- *                     # 5 for 1 char and 1 int
- *                     s += 5 + ( nvalues * byte_size) - 1             # <<<<<<<<<<<<<<
- *                 else:
- *                     raise KeyError("unknown type '%s'" % auxtype)
- */
-      __pyx_v_s = (__pyx_v_s + ((5 + (__pyx_v_nvalues * __pyx_v_byte_size)) - 1));
-      break;
-      default:
-
-      /* "pysam/calignmentfile.pyx":2630
- *                     s += 5 + ( nvalues * byte_size) - 1
- *                 else:
- *                     raise KeyError("unknown type '%s'" % auxtype)             # <<<<<<<<<<<<<<
- * 
- *                 s += 1
- */
-      __pyx_t_4 = __Pyx_PyInt_From_char(__pyx_v_auxtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_unknown_type_s, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __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 = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      break;
-    }
-
-    /* "pysam/calignmentfile.pyx":2632
- *                     raise KeyError("unknown type '%s'" % auxtype)
- * 
- *                 s += 1             # <<<<<<<<<<<<<<
- * 
- *                 result.append((_charptr_to_str(auxtag), value))
- */
-    __pyx_v_s = (__pyx_v_s + 1);
-
-    /* "pysam/calignmentfile.pyx":2634
- *                 s += 1
- * 
- *                 result.append((_charptr_to_str(auxtag), value))             # <<<<<<<<<<<<<<
- * 
- *             return result
- */
-    __pyx_t_7 = __pyx_f_5pysam_14calignmentfile__charptr_to_str(__pyx_v_auxtag); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    __pyx_t_7 = 0;
-    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2636
- *                 result.append((_charptr_to_str(auxtag), value))
- * 
- *             return result             # <<<<<<<<<<<<<<
- * 
- *         def __set__(self, tags):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2581
- *         multiple times.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef char * ctag
- *             cdef bam1_t * src
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.tags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2638
- *             return result
- * 
- *         def __set__(self, tags):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef uint8_t * s
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tags_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tags); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tags_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_tags) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tags_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_tags));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tags_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tags) {
-  bam1_t *__pyx_v_src;
-  uint8_t *__pyx_v_s;
-  char *__pyx_v_temp;
-  int __pyx_v_new_size;
-  int __pyx_v_old_size;
-  PyObject *__pyx_v_fmts = NULL;
-  PyObject *__pyx_v_args = NULL;
-  PyObject *__pyx_v_pytag = NULL;
-  PyObject *__pyx_v_value = NULL;
-  PyObject *__pyx_v_fmt = NULL;
-  PyObject *__pyx_v_buffer = NULL;
-  PyObject *__pyx_v_p = NULL;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  Py_ssize_t __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *(*__pyx_t_8)(PyObject *);
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *(*__pyx_t_12)(PyObject *);
-  int __pyx_t_13;
-  char *__pyx_t_14;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2638);
-
-  /* "pysam/calignmentfile.pyx":2642
- *             cdef uint8_t * s
- *             cdef char * temp
- *             cdef int new_size = 0             # <<<<<<<<<<<<<<
- *             cdef int old_size
- *             src = self._delegate
- */
-  __pyx_v_new_size = 0;
-
-  /* "pysam/calignmentfile.pyx":2644
- *             cdef int new_size = 0
- *             cdef int old_size
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             fmts, args = ["<"], []
- * 
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2645
- *             cdef int old_size
- *             src = self._delegate
- *             fmts, args = ["<"], []             # <<<<<<<<<<<<<<
- * 
- *             if tags is not None and len(tags) > 0:
- */
-  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_kp_s__74);
-  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s__74);
-  __Pyx_GIVEREF(__pyx_kp_s__74);
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_v_fmts = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_v_args = ((PyObject*)__pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":2647
- *             fmts, args = ["<"], []
- * 
- *             if tags is not None and len(tags) > 0:             # <<<<<<<<<<<<<<
- *                 for pytag, value in tags:
- *                     convert_python_tag(pytag, value, fmts, args)
- */
-  __pyx_t_4 = (__pyx_v_tags != Py_None);
-  if ((__pyx_t_4 != 0)) {
-    __pyx_t_5 = PyObject_Length(__pyx_v_tags); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = ((__pyx_t_5 > 0) != 0);
-    __pyx_t_7 = __pyx_t_6;
-  } else {
-    __pyx_t_7 = (__pyx_t_4 != 0);
-  }
-  if (__pyx_t_7) {
-
-    /* "pysam/calignmentfile.pyx":2648
- * 
- *             if tags is not None and len(tags) > 0:
- *                 for pytag, value in tags:             # <<<<<<<<<<<<<<
- *                     convert_python_tag(pytag, value, fmts, args)
- *                 fmt = "".join(fmts)
- */
-    if (PyList_CheckExact(__pyx_v_tags) || PyTuple_CheckExact(__pyx_v_tags)) {
-      __pyx_t_3 = __pyx_v_tags; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
-      __pyx_t_8 = NULL;
-    } else {
-      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_tags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_3)) {
-        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_3)) {
-        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_2 = __pyx_t_8(__pyx_t_3);
-        if (unlikely(!__pyx_t_2)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_2);
-      }
-      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
-        PyObject* sequence = __pyx_t_2;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        Py_ssize_t size = Py_SIZE(sequence);
-        #else
-        Py_ssize_t size = PySequence_Size(sequence);
-        #endif
-        if (unlikely(size != 2)) {
-          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        #if CYTHON_COMPILING_IN_CPYTHON
-        if (likely(PyTuple_CheckExact(sequence))) {
-          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
-          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
-        } else {
-          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
-          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
-        }
-        __Pyx_INCREF(__pyx_t_9);
-        __Pyx_INCREF(__pyx_t_10);
-        #else
-        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        #endif
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      } else {
-        Py_ssize_t index = -1;
-        __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
-        index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_9);
-        index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L6_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_10);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_12 = NULL;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        goto __pyx_L7_unpacking_done;
-        __pyx_L6_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __pyx_t_12 = NULL;
-        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L7_unpacking_done:;
-      }
-      __Pyx_XDECREF_SET(__pyx_v_pytag, __pyx_t_9);
-      __pyx_t_9 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
-      __pyx_t_10 = 0;
-
-      /* "pysam/calignmentfile.pyx":2649
- *             if tags is not None and len(tags) > 0:
- *                 for pytag, value in tags:
- *                     convert_python_tag(pytag, value, fmts, args)             # <<<<<<<<<<<<<<
- *                 fmt = "".join(fmts)
- *                 new_size = struct.calcsize(fmt)
- */
-      __pyx_t_2 = __pyx_f_5pysam_14calignmentfile_convert_python_tag(__pyx_v_pytag, __pyx_v_value, __pyx_v_fmts, __pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2650
- *                 for pytag, value in tags:
- *                     convert_python_tag(pytag, value, fmts, args)
- *                 fmt = "".join(fmts)             # <<<<<<<<<<<<<<
- *                 new_size = struct.calcsize(fmt)
- *                 buffer = ctypes.create_string_buffer(new_size)
- */
-    __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_fmts); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_v_fmt = ((PyObject*)__pyx_t_3);
-    __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2651
- *                     convert_python_tag(pytag, value, fmts, args)
- *                 fmt = "".join(fmts)
- *                 new_size = struct.calcsize(fmt)             # <<<<<<<<<<<<<<
- *                 buffer = ctypes.create_string_buffer(new_size)
- *                 struct.pack_into(fmt,
- */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_calcsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __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 = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_fmt);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fmt);
-    __Pyx_GIVEREF(__pyx_v_fmt);
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_v_new_size = __pyx_t_13;
-
-    /* "pysam/calignmentfile.pyx":2652
- *                 fmt = "".join(fmts)
- *                 new_size = struct.calcsize(fmt)
- *                 buffer = ctypes.create_string_buffer(new_size)             # <<<<<<<<<<<<<<
- *                 struct.pack_into(fmt,
- *                                  buffer,
- */
-    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctypes); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_create_string_buffer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_new_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
-    __Pyx_GIVEREF(__pyx_t_10);
-    __pyx_t_10 = 0;
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_buffer = __pyx_t_10;
-    __pyx_t_10 = 0;
-
-    /* "pysam/calignmentfile.pyx":2653
- *                 new_size = struct.calcsize(fmt)
- *                 buffer = ctypes.create_string_buffer(new_size)
- *                 struct.pack_into(fmt,             # <<<<<<<<<<<<<<
- *                                  buffer,
- *                                  0,
- */
-    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_pack_into); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
-    /* "pysam/calignmentfile.pyx":2654
- *                 buffer = ctypes.create_string_buffer(new_size)
- *                 struct.pack_into(fmt,
- *                                  buffer,             # <<<<<<<<<<<<<<
- *                                  0,
- *                                  *args)
- */
-    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_INCREF(__pyx_v_fmt);
-    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_fmt);
-    __Pyx_GIVEREF(__pyx_v_fmt);
-    __Pyx_INCREF(__pyx_v_buffer);
-    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_buffer);
-    __Pyx_GIVEREF(__pyx_v_buffer);
-    __Pyx_INCREF(__pyx_int_0);
-    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_0);
-    __Pyx_GIVEREF(__pyx_int_0);
-
-    /* "pysam/calignmentfile.pyx":2653
- *                 new_size = struct.calcsize(fmt)
- *                 buffer = ctypes.create_string_buffer(new_size)
- *                 struct.pack_into(fmt,             # <<<<<<<<<<<<<<
- *                                  buffer,
- *                                  0,
- */
-    __pyx_t_3 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":2661
- *             # If total_size == 0, the aux field will be
- *             # empty
- *             old_size = pysam_bam_get_l_aux(src)             # <<<<<<<<<<<<<<
- *             pysam_bam_update(src,
- *                              old_size,
- */
-  __pyx_v_old_size = pysam_bam_get_l_aux(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2662
- *             # empty
- *             old_size = pysam_bam_get_l_aux(src)
- *             pysam_bam_update(src,             # <<<<<<<<<<<<<<
- *                              old_size,
- *                              new_size,
- */
-  pysam_bam_update(__pyx_v_src, __pyx_v_old_size, __pyx_v_new_size, pysam_bam_get_aux(__pyx_v_src));
-
-  /* "pysam/calignmentfile.pyx":2668
- * 
- *             # copy data only if there is any
- *             if new_size > 0:             # <<<<<<<<<<<<<<
- * 
- *                 # get location of new data
- */
-  __pyx_t_7 = ((__pyx_v_new_size > 0) != 0);
-  if (__pyx_t_7) {
-
-    /* "pysam/calignmentfile.pyx":2671
- * 
- *                 # get location of new data
- *                 s = pysam_bam_get_aux(src)             # <<<<<<<<<<<<<<
- * 
- *                 # check if there is direct path from buffer.raw to tmp
- */
-    __pyx_v_s = pysam_bam_get_aux(__pyx_v_src);
-
-    /* "pysam/calignmentfile.pyx":2674
- * 
- *                 # check if there is direct path from buffer.raw to tmp
- *                 p = buffer.raw             # <<<<<<<<<<<<<<
- *                 # create handle to make sure buffer stays alive long
- *                 # enough for memcpy, see issue 129
- */
-    if (unlikely(!__pyx_v_buffer)) { __Pyx_RaiseUnboundLocalError("buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_buffer, __pyx_n_s_raw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_v_p = __pyx_t_3;
-    __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2677
- *                 # create handle to make sure buffer stays alive long
- *                 # enough for memcpy, see issue 129
- *                 temp = p             # <<<<<<<<<<<<<<
- *                 memcpy(s, temp, new_size)
- * 
- */
-    __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_p); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_temp = __pyx_t_14;
-
-    /* "pysam/calignmentfile.pyx":2678
- *                 # enough for memcpy, see issue 129
- *                 temp = p
- *                 memcpy(s, temp, new_size)             # <<<<<<<<<<<<<<
- * 
- *     property bin:
- */
-    memcpy(__pyx_v_s, __pyx_v_temp, __pyx_v_new_size);
-    goto __pyx_L8;
-  }
-  __pyx_L8:;
-
-  /* "pysam/calignmentfile.pyx":2638
- *             return result
- * 
- *         def __set__(self, tags):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef uint8_t * s
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.tags.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_fmts);
-  __Pyx_XDECREF(__pyx_v_args);
-  __Pyx_XDECREF(__pyx_v_pytag);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XDECREF(__pyx_v_fmt);
-  __Pyx_XDECREF(__pyx_v_buffer);
-  __Pyx_XDECREF(__pyx_v_p);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2682
- *     property bin:
- *         """properties bin"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return pysam_get_bin(self._delegate)
- *         def __set__(self, bin):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3bin_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3bin_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3bin___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3bin___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2682);
-
-  /* "pysam/calignmentfile.pyx":2683
- *         """properties bin"""
- *         def __get__(self):
- *             return pysam_get_bin(self._delegate)             # <<<<<<<<<<<<<<
- *         def __set__(self, bin):
- *             pysam_set_bin(self._delegate, bin)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint16_t(pysam_get_bin(__pyx_v_self->_delegate)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2682
- *     property bin:
- *         """properties bin"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return pysam_get_bin(self._delegate)
- *         def __set__(self, bin):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.bin.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2684
- *         def __get__(self):
- *             return pysam_get_bin(self._delegate)
- *         def __set__(self, bin):             # <<<<<<<<<<<<<<
- *             pysam_set_bin(self._delegate, bin)
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3bin_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_bin); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3bin_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_bin) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3bin_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_bin));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3bin_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_bin) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2684);
-
-  /* "pysam/calignmentfile.pyx":2685
- *             return pysam_get_bin(self._delegate)
- *         def __set__(self, bin):
- *             pysam_set_bin(self._delegate, bin)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_bin); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_set_bin(__pyx_v_self->_delegate, __pyx_t_1);
-
-  /* "pysam/calignmentfile.pyx":2684
- *         def __get__(self):
- *             return pysam_get_bin(self._delegate)
- *         def __set__(self, bin):             # <<<<<<<<<<<<<<
- *             pysam_set_bin(self._delegate, bin)
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.bin.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2696
- *     property is_paired:
- *         """true if read is paired in sequencing"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FPAIRED) != 0
- *         def __set__(self,val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_paired_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_paired_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_paired___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_paired___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2696);
-
-  /* "pysam/calignmentfile.pyx":2697
- *         """true if read is paired in sequencing"""
- *         def __get__(self):
- *             return (self.flag & BAM_FPAIRED) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FPAIRED)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FPAIRED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2696
- *     property is_paired:
- *         """true if read is paired in sequencing"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FPAIRED) != 0
- *         def __set__(self,val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_paired.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2698
- *         def __get__(self):
- *             return (self.flag & BAM_FPAIRED) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FPAIRED)
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_paired_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_paired_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_paired_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_paired_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2698);
-
-  /* "pysam/calignmentfile.pyx":2699
- *             return (self.flag & BAM_FPAIRED) != 0
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FPAIRED)             # <<<<<<<<<<<<<<
- * 
- *     property is_proper_pair:
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FPAIRED);
-
-  /* "pysam/calignmentfile.pyx":2698
- *         def __get__(self):
- *             return (self.flag & BAM_FPAIRED) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FPAIRED)
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_paired.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2703
- *     property is_proper_pair:
- *         """true if read is mapped in a proper pair"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FPROPER_PAIR) != 0
- *         def __set__(self,val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2703);
-
-  /* "pysam/calignmentfile.pyx":2704
- *         """true if read is mapped in a proper pair"""
- *         def __get__(self):
- *             return (self.flag & BAM_FPROPER_PAIR) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FPROPER_PAIR)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FPROPER_PAIR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2703
- *     property is_proper_pair:
- *         """true if read is mapped in a proper pair"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FPROPER_PAIR) != 0
- *         def __set__(self,val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_proper_pair.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2705
- *         def __get__(self):
- *             return (self.flag & BAM_FPROPER_PAIR) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FPROPER_PAIR)
- *     property is_unmapped:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2705);
-
-  /* "pysam/calignmentfile.pyx":2706
- *             return (self.flag & BAM_FPROPER_PAIR) != 0
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FPROPER_PAIR)             # <<<<<<<<<<<<<<
- *     property is_unmapped:
- *         """true if read itself is unmapped"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FPROPER_PAIR);
-
-  /* "pysam/calignmentfile.pyx":2705
- *         def __get__(self):
- *             return (self.flag & BAM_FPROPER_PAIR) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FPROPER_PAIR)
- *     property is_unmapped:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_proper_pair.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2709
- *     property is_unmapped:
- *         """true if read itself is unmapped"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FUNMAP) != 0
- *         def __set__(self, val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2709);
-
-  /* "pysam/calignmentfile.pyx":2710
- *         """true if read itself is unmapped"""
- *         def __get__(self):
- *             return (self.flag & BAM_FUNMAP) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FUNMAP)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FUNMAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2709
- *     property is_unmapped:
- *         """true if read itself is unmapped"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FUNMAP) != 0
- *         def __set__(self, val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_unmapped.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2711
- *         def __get__(self):
- *             return (self.flag & BAM_FUNMAP) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FUNMAP)
- *     property mate_is_unmapped:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2711);
-
-  /* "pysam/calignmentfile.pyx":2712
- *             return (self.flag & BAM_FUNMAP) != 0
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FUNMAP)             # <<<<<<<<<<<<<<
- *     property mate_is_unmapped:
- *         """true if the mate is unmapped"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FUNMAP);
-
-  /* "pysam/calignmentfile.pyx":2711
- *         def __get__(self):
- *             return (self.flag & BAM_FUNMAP) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FUNMAP)
- *     property mate_is_unmapped:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_unmapped.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2715
- *     property mate_is_unmapped:
- *         """true if the mate is unmapped"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FMUNMAP) != 0
- *         def __set__(self,val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2715);
-
-  /* "pysam/calignmentfile.pyx":2716
- *         """true if the mate is unmapped"""
- *         def __get__(self):
- *             return (self.flag & BAM_FMUNMAP) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FMUNMAP)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FMUNMAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2715
- *     property mate_is_unmapped:
- *         """true if the mate is unmapped"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FMUNMAP) != 0
- *         def __set__(self,val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mate_is_unmapped.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2717
- *         def __get__(self):
- *             return (self.flag & BAM_FMUNMAP) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FMUNMAP)
- *     property is_reverse:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2717);
-
-  /* "pysam/calignmentfile.pyx":2718
- *             return (self.flag & BAM_FMUNMAP) != 0
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FMUNMAP)             # <<<<<<<<<<<<<<
- *     property is_reverse:
- *         """true if read is mapped to reverse strand"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FMUNMAP);
-
-  /* "pysam/calignmentfile.pyx":2717
- *         def __get__(self):
- *             return (self.flag & BAM_FMUNMAP) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FMUNMAP)
- *     property is_reverse:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mate_is_unmapped.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2721
- *     property is_reverse:
- *         """true if read is mapped to reverse strand"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FREVERSE) != 0
- *         def __set__(self,val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10is_reverse___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10is_reverse___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2721);
-
-  /* "pysam/calignmentfile.pyx":2722
- *         """true if read is mapped to reverse strand"""
- *         def __get__(self):
- *             return (self.flag & BAM_FREVERSE) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FREVERSE)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FREVERSE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2721
- *     property is_reverse:
- *         """true if read is mapped to reverse strand"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FREVERSE) != 0
- *         def __set__(self,val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_reverse.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2723
- *         def __get__(self):
- *             return (self.flag & BAM_FREVERSE) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FREVERSE)
- *     property mate_is_reverse:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2723);
-
-  /* "pysam/calignmentfile.pyx":2724
- *             return (self.flag & BAM_FREVERSE) != 0
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FREVERSE)             # <<<<<<<<<<<<<<
- *     property mate_is_reverse:
- *         """true is read is mapped to reverse strand"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FREVERSE);
-
-  /* "pysam/calignmentfile.pyx":2723
- *         def __get__(self):
- *             return (self.flag & BAM_FREVERSE) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FREVERSE)
- *     property mate_is_reverse:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_reverse.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2727
- *     property mate_is_reverse:
- *         """true is read is mapped to reverse strand"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FMREVERSE) != 0
- *         def __set__(self,val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2727);
-
-  /* "pysam/calignmentfile.pyx":2728
- *         """true is read is mapped to reverse strand"""
- *         def __get__(self):
- *             return (self.flag & BAM_FMREVERSE) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FMREVERSE)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FMREVERSE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2727
- *     property mate_is_reverse:
- *         """true is read is mapped to reverse strand"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FMREVERSE) != 0
- *         def __set__(self,val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mate_is_reverse.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2729
- *         def __get__(self):
- *             return (self.flag & BAM_FMREVERSE) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FMREVERSE)
- *     property is_read1:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2729);
-
-  /* "pysam/calignmentfile.pyx":2730
- *             return (self.flag & BAM_FMREVERSE) != 0
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FMREVERSE)             # <<<<<<<<<<<<<<
- *     property is_read1:
- *         """true if this is read1"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FMREVERSE);
-
-  /* "pysam/calignmentfile.pyx":2729
- *         def __get__(self):
- *             return (self.flag & BAM_FMREVERSE) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FMREVERSE)
- *     property is_read1:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mate_is_reverse.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2733
- *     property is_read1:
- *         """true if this is read1"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FREAD1) != 0
- *         def __set__(self,val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read1_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read1_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read1___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read1___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2733);
-
-  /* "pysam/calignmentfile.pyx":2734
- *         """true if this is read1"""
- *         def __get__(self):
- *             return (self.flag & BAM_FREAD1) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FREAD1)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FREAD1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2733
- *     property is_read1:
- *         """true if this is read1"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FREAD1) != 0
- *         def __set__(self,val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_read1.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2735
- *         def __get__(self):
- *             return (self.flag & BAM_FREAD1) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FREAD1)
- *     property is_read2:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read1_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read1_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read1_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2735);
-
-  /* "pysam/calignmentfile.pyx":2736
- *             return (self.flag & BAM_FREAD1) != 0
- *         def __set__(self,val):
- *             pysam_update_flag(self._delegate, val, BAM_FREAD1)             # <<<<<<<<<<<<<<
- *     property is_read2:
- *         """true if this is read2"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FREAD1);
-
-  /* "pysam/calignmentfile.pyx":2735
- *         def __get__(self):
- *             return (self.flag & BAM_FREAD1) != 0
- *         def __set__(self,val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FREAD1)
- *     property is_read2:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_read1.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2739
- *     property is_read2:
- *         """true if this is read2"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FREAD2) != 0
- *         def __set__(self, val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read2_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read2_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read2___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read2___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2739);
-
-  /* "pysam/calignmentfile.pyx":2740
- *         """true if this is read2"""
- *         def __get__(self):
- *             return (self.flag & BAM_FREAD2) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FREAD2)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FREAD2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2739
- *     property is_read2:
- *         """true if this is read2"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FREAD2) != 0
- *         def __set__(self, val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_read2.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2741
- *         def __get__(self):
- *             return (self.flag & BAM_FREAD2) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FREAD2)
- *     property is_secondary:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read2_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read2_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read2_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_8is_read2_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2741);
-
-  /* "pysam/calignmentfile.pyx":2742
- *             return (self.flag & BAM_FREAD2) != 0
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FREAD2)             # <<<<<<<<<<<<<<
- *     property is_secondary:
- *         """true if not primary alignment"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FREAD2);
-
-  /* "pysam/calignmentfile.pyx":2741
- *         def __get__(self):
- *             return (self.flag & BAM_FREAD2) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FREAD2)
- *     property is_secondary:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_read2.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2745
- *     property is_secondary:
- *         """true if not primary alignment"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FSECONDARY) != 0
- *         def __set__(self, val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_secondary___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_secondary___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2745);
-
-  /* "pysam/calignmentfile.pyx":2746
- *         """true if not primary alignment"""
- *         def __get__(self):
- *             return (self.flag & BAM_FSECONDARY) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FSECONDARY)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FSECONDARY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2745
- *     property is_secondary:
- *         """true if not primary alignment"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FSECONDARY) != 0
- *         def __set__(self, val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_secondary.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2747
- *         def __get__(self):
- *             return (self.flag & BAM_FSECONDARY) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FSECONDARY)
- *     property is_qcfail:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2747);
-
-  /* "pysam/calignmentfile.pyx":2748
- *             return (self.flag & BAM_FSECONDARY) != 0
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FSECONDARY)             # <<<<<<<<<<<<<<
- *     property is_qcfail:
- *         """true if QC failure"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FSECONDARY);
-
-  /* "pysam/calignmentfile.pyx":2747
- *         def __get__(self):
- *             return (self.flag & BAM_FSECONDARY) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FSECONDARY)
- *     property is_qcfail:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_secondary.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2751
- *     property is_qcfail:
- *         """true if QC failure"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FQCFAIL) != 0
- *         def __set__(self, val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2751);
-
-  /* "pysam/calignmentfile.pyx":2752
- *         """true if QC failure"""
- *         def __get__(self):
- *             return (self.flag & BAM_FQCFAIL) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FQCFAIL)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FQCFAIL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2751
- *     property is_qcfail:
- *         """true if QC failure"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FQCFAIL) != 0
- *         def __set__(self, val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_qcfail.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2753
- *         def __get__(self):
- *             return (self.flag & BAM_FQCFAIL) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FQCFAIL)
- *     property is_duplicate:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2753);
-
-  /* "pysam/calignmentfile.pyx":2754
- *             return (self.flag & BAM_FQCFAIL) != 0
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FQCFAIL)             # <<<<<<<<<<<<<<
- *     property is_duplicate:
- *         """true if optical or PCR duplicate"""
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FQCFAIL);
-
-  /* "pysam/calignmentfile.pyx":2753
- *         def __get__(self):
- *             return (self.flag & BAM_FQCFAIL) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FQCFAIL)
- *     property is_duplicate:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_qcfail.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2757
- *     property is_duplicate:
- *         """true if optical or PCR duplicate"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FDUP) != 0
- *         def __set__(self, val):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2757);
-
-  /* "pysam/calignmentfile.pyx":2758
- *         """true if optical or PCR duplicate"""
- *         def __get__(self):
- *             return (self.flag & BAM_FDUP) != 0             # <<<<<<<<<<<<<<
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FDUP)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int(BAM_FDUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2757
- *     property is_duplicate:
- *         """true if optical or PCR duplicate"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return (self.flag & BAM_FDUP) != 0
- *         def __set__(self, val):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_duplicate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2759
- *         def __get__(self):
- *             return (self.flag & BAM_FDUP) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FDUP)
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_val));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_val) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  uint16_t __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 2759);
-
-  /* "pysam/calignmentfile.pyx":2760
- *             return (self.flag & BAM_FDUP) != 0
- *         def __set__(self, val):
- *             pysam_update_flag(self._delegate, val, BAM_FDUP)             # <<<<<<<<<<<<<<
- * 
- *     # 2. Coordinates and lengths
- */
-  __pyx_t_1 = __Pyx_PyInt_As_uint16_t(__pyx_v_val); if (unlikely((__pyx_t_1 == (uint16_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_update_flag(__pyx_v_self->_delegate, __pyx_t_1, BAM_FDUP);
-
-  /* "pysam/calignmentfile.pyx":2759
- *         def __get__(self):
- *             return (self.flag & BAM_FDUP) != 0
- *         def __set__(self, val):             # <<<<<<<<<<<<<<
- *             pysam_update_flag(self._delegate, val, BAM_FDUP)
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.is_duplicate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2768
- *         aend points to one past the last aligned residue.
- *         Returns None if not available.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             src = self._delegate
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13reference_end_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13reference_end_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_13reference_end___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_13reference_end___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2768);
-
-  /* "pysam/calignmentfile.pyx":2770
- *         def __get__(self):
- *             cdef bam1_t * src
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             if (self.flag & BAM_FUNMAP) or pysam_get_n_cigar(src) == 0:
- *                 return None
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2771
- *             cdef bam1_t * src
- *             src = self._delegate
- *             if (self.flag & BAM_FUNMAP) or pysam_get_n_cigar(src) == 0:             # <<<<<<<<<<<<<<
- *                 return None
- *             return bam_endpos(src)
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyInt_From_int(BAM_FUNMAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (!__pyx_t_5) {
-    __pyx_t_6 = (pysam_get_n_cigar(__pyx_v_src) == 0);
-    __pyx_t_7 = __pyx_t_6;
-  } else {
-    __pyx_t_7 = __pyx_t_5;
-  }
-  if (__pyx_t_7) {
-
-    /* "pysam/calignmentfile.pyx":2772
- *             src = self._delegate
- *             if (self.flag & BAM_FUNMAP) or pysam_get_n_cigar(src) == 0:
- *                 return None             # <<<<<<<<<<<<<<
- *             return bam_endpos(src)
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2773
- *             if (self.flag & BAM_FUNMAP) or pysam_get_n_cigar(src) == 0:
- *                 return None
- *             return bam_endpos(src)             # <<<<<<<<<<<<<<
- * 
- *     property reference_length:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyInt_From_int32_t(bam_endpos(__pyx_v_src)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2768
- *         aend points to one past the last aligned residue.
- *         Returns None if not available.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             src = self._delegate
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.reference_end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2779
- * 
- *         This is equal to `aend - pos`. Returns None if not available.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             src = self._delegate
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16reference_length_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16reference_length_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16reference_length___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16reference_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2779);
-
-  /* "pysam/calignmentfile.pyx":2781
- *         def __get__(self):
- *             cdef bam1_t * src
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             if (self.flag & BAM_FUNMAP) or pysam_get_n_cigar(src) == 0:
- *                 return None
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2782
- *             cdef bam1_t * src
- *             src = self._delegate
- *             if (self.flag & BAM_FUNMAP) or pysam_get_n_cigar(src) == 0:             # <<<<<<<<<<<<<<
- *                 return None
- *             return bam_endpos(src) - \
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyInt_From_int(BAM_FUNMAP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (!__pyx_t_5) {
-    __pyx_t_6 = (pysam_get_n_cigar(__pyx_v_src) == 0);
-    __pyx_t_7 = __pyx_t_6;
-  } else {
-    __pyx_t_7 = __pyx_t_5;
-  }
-  if (__pyx_t_7) {
-
-    /* "pysam/calignmentfile.pyx":2783
- *             src = self._delegate
- *             if (self.flag & BAM_FUNMAP) or pysam_get_n_cigar(src) == 0:
- *                 return None             # <<<<<<<<<<<<<<
- *             return bam_endpos(src) - \
- *                 self._delegate.core.pos
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2784
- *             if (self.flag & BAM_FUNMAP) or pysam_get_n_cigar(src) == 0:
- *                 return None
- *             return bam_endpos(src) - \             # <<<<<<<<<<<<<<
- *                 self._delegate.core.pos
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-
-  /* "pysam/calignmentfile.pyx":2785
- *                 return None
- *             return bam_endpos(src) - \
- *                 self._delegate.core.pos             # <<<<<<<<<<<<<<
- * 
- *     property query_alignment_length:
- */
-  __pyx_t_4 = __Pyx_PyInt_From_int((bam_endpos(__pyx_v_src) - __pyx_v_self->_delegate->core.pos)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2779
- * 
- *         This is equal to `aend - pos`. Returns None if not available.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             src = self._delegate
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.reference_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2794
- * 
- *         Returns 0 if not available."""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.core.l_qseq
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_22query_alignment_length_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_22query_alignment_length_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_22query_alignment_length___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_22query_alignment_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2794);
-
-  /* "pysam/calignmentfile.pyx":2795
- *         Returns 0 if not available."""
- *         def __get__(self):
- *             return self._delegate.core.l_qseq             # <<<<<<<<<<<<<<
- * 
- *     property query_alignment_sequence:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_delegate->core.l_qseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2794
- * 
- *         Returns 0 if not available."""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.core.l_qseq
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_alignment_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2814
- *         """
- * 
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef uint32_t start, end
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_24query_alignment_sequence_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_24query_alignment_sequence_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_24query_alignment_sequence___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_24query_alignment_sequence___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  uint32_t __pyx_v_start;
-  uint32_t __pyx_v_end;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  int32_t __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2814);
-
-  /* "pysam/calignmentfile.pyx":2818
- *             cdef uint32_t start, end
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- * 
- *             if src.core.l_qseq == 0:
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2820
- *             src = self._delegate
- * 
- *             if src.core.l_qseq == 0:             # <<<<<<<<<<<<<<
- *                 return None
- * 
- */
-  __pyx_t_2 = ((__pyx_v_src->core.l_qseq == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2821
- * 
- *             if src.core.l_qseq == 0:
- *                 return None             # <<<<<<<<<<<<<<
- * 
- *             start = _getQueryStart(src)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2823
- *                 return None
- * 
- *             start = _getQueryStart(src)             # <<<<<<<<<<<<<<
- *             end   = _getQueryEnd(src)
- * 
- */
-  __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__getQueryStart(__pyx_v_src); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_start = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":2824
- * 
- *             start = _getQueryStart(src)
- *             end   = _getQueryEnd(src)             # <<<<<<<<<<<<<<
- * 
- *             return _getSequenceRange(src, start, end)
- */
-  __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__getQueryEnd(__pyx_v_src); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_end = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":2826
- *             end   = _getQueryEnd(src)
- * 
- *             return _getSequenceRange(src, start, end)             # <<<<<<<<<<<<<<
- * 
- *     property query_alignment_qualities:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __pyx_f_5pysam_14calignmentfile__getSequenceRange(__pyx_v_src, __pyx_v_start, __pyx_v_end); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2814
- *         """
- * 
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef uint32_t start, end
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_alignment_sequence.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2842
- * 
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef uint32_t start, end
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_25query_alignment_qualities_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_25query_alignment_qualities_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_25query_alignment_qualities___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_25query_alignment_qualities___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  uint32_t __pyx_v_start;
-  uint32_t __pyx_v_end;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  int32_t __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2842);
-
-  /* "pysam/calignmentfile.pyx":2846
- *             cdef uint32_t start, end
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- * 
- *             if src.core.l_qseq == 0:
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2848
- *             src = self._delegate
- * 
- *             if src.core.l_qseq == 0:             # <<<<<<<<<<<<<<
- *                 return None
- * 
- */
-  __pyx_t_2 = ((__pyx_v_src->core.l_qseq == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2849
- * 
- *             if src.core.l_qseq == 0:
- *                 return None             # <<<<<<<<<<<<<<
- * 
- *             start = _getQueryStart(src)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2851
- *                 return None
- * 
- *             start = _getQueryStart(src)             # <<<<<<<<<<<<<<
- *             end   = _getQueryEnd(src)
- * 
- */
-  __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__getQueryStart(__pyx_v_src); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_start = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":2852
- * 
- *             start = _getQueryStart(src)
- *             end   = _getQueryEnd(src)             # <<<<<<<<<<<<<<
- * 
- *             return _getQualitiesRange(src, start, end)
- */
-  __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__getQueryEnd(__pyx_v_src); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_end = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":2854
- *             end   = _getQueryEnd(src)
- * 
- *             return _getQualitiesRange(src, start, end)             # <<<<<<<<<<<<<<
- * 
- *     property query_alignment_start:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __pyx_f_5pysam_14calignmentfile__getQualitiesRange(__pyx_v_src, __pyx_v_start, __pyx_v_end); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2842
- * 
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             cdef uint32_t start, end
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_alignment_qualities.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2864
- * 
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return _getQueryStart(self._delegate)
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21query_alignment_start_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21query_alignment_start_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_21query_alignment_start___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_21query_alignment_start___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int32_t __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2864);
-
-  /* "pysam/calignmentfile.pyx":2865
- *         """
- *         def __get__(self):
- *             return _getQueryStart(self._delegate)             # <<<<<<<<<<<<<<
- * 
- *     property query_alignment_end:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_5pysam_14calignmentfile__getQueryStart(__pyx_v_self->_delegate); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2864
- * 
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return _getQueryStart(self._delegate)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_alignment_start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2870
- *         """end index of the aligned query portion of the sequence (0-based,
- *         exclusive)"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return _getQueryEnd(self._delegate)
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_19query_alignment_end_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_19query_alignment_end_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_19query_alignment_end___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_19query_alignment_end___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int32_t __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2870);
-
-  /* "pysam/calignmentfile.pyx":2871
- *         exclusive)"""
- *         def __get__(self):
- *             return _getQueryEnd(self._delegate)             # <<<<<<<<<<<<<<
- * 
- *     property query_aligment_length:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_5pysam_14calignmentfile__getQueryEnd(__pyx_v_self->_delegate); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2870
- *         """end index of the aligned query portion of the sequence (0-based,
- *         exclusive)"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return _getQueryEnd(self._delegate)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_alignment_end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2877
- * 
- *         This is equal to :attr:`qend` - :attr:`qstart`"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             src = self._delegate
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21query_aligment_length_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21query_aligment_length_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_21query_aligment_length___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_21query_aligment_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int32_t __pyx_t_2;
-  int32_t __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 2877);
-
-  /* "pysam/calignmentfile.pyx":2879
- *         def __get__(self):
- *             cdef bam1_t * src
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             return _getQueryEnd(src) - _getQueryStart(src)
- * 
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2880
- *             cdef bam1_t * src
- *             src = self._delegate
- *             return _getQueryEnd(src) - _getQueryStart(src)             # <<<<<<<<<<<<<<
- * 
- *     #####################################################
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_5pysam_14calignmentfile__getQueryEnd(__pyx_v_src); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__getQueryStart(__pyx_v_src); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_t_2 - __pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2877
- * 
- *         This is equal to :attr:`qend` - :attr:`qstart`"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef bam1_t * src
- *             src = self._delegate
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query_aligment_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2885
- *     # Computed properties
- * 
- *     def get_reference_positions(self, full_length=False):             # <<<<<<<<<<<<<<
- *         """a list of reference positions that this read aligns to.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11get_reference_positions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_10get_reference_positions[] = "AlignedSegment.get_reference_positions(self, full_length=False)\na list of reference positions that this read aligns to.\n\n        By default, this method only returns positions in the\n        reference that are within the alignment. If *full_length* is\n        set, None values will be included for any soft-clipped or\n        unaligned positions within the read. The returned list will\n      [...]
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11get_reference_positions(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_full_length = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_reference_positions (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_full_length,0};
-    PyObject* values[1] = {0};
-    values[0] = ((PyObject *)Py_False);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_full_length);
-          if (value) { values[0] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_reference_positions") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_full_length = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get_reference_positions", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.get_reference_positions", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10get_reference_positions(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), __pyx_v_full_length);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_10get_reference_positions(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_full_length) {
-  uint32_t __pyx_v_k;
-  uint32_t __pyx_v_i;
-  uint32_t __pyx_v_pos;
-  int __pyx_v_op;
-  uint32_t *__pyx_v_cigar_p;
-  bam1_t *__pyx_v_src;
-  int __pyx_v__full;
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_v_l = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  bam1_t *__pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int32_t __pyx_t_4;
-  uint16_t __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  uint32_t __pyx_t_8;
-  int __pyx_t_9;
-  PyObject *__pyx_t_10 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("get_reference_positions", 0);
-  __Pyx_TraceCall("get_reference_positions", __pyx_f[0], 2885);
-
-  /* "pysam/calignmentfile.pyx":2899
- *         cdef uint32_t * cigar_p
- *         cdef bam1_t * src
- *         cdef bint _full = full_length             # <<<<<<<<<<<<<<
- * 
- *         src = self._delegate
- */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_full_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v__full = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2901
- *         cdef bint _full = full_length
- * 
- *         src = self._delegate             # <<<<<<<<<<<<<<
- *         if pysam_get_n_cigar(src) == 0:
- *             return []
- */
-  __pyx_t_2 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_2;
-
-  /* "pysam/calignmentfile.pyx":2902
- * 
- *         src = self._delegate
- *         if pysam_get_n_cigar(src) == 0:             # <<<<<<<<<<<<<<
- *             return []
- * 
- */
-  __pyx_t_1 = ((pysam_get_n_cigar(__pyx_v_src) == 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":2903
- *         src = self._delegate
- *         if pysam_get_n_cigar(src) == 0:
- *             return []             # <<<<<<<<<<<<<<
- * 
- *         result = []
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2905
- *             return []
- * 
- *         result = []             # <<<<<<<<<<<<<<
- *         pos = src.core.pos
- *         cigar_p = pysam_bam_get_cigar(src)
- */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_v_result = ((PyObject*)__pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":2906
- * 
- *         result = []
- *         pos = src.core.pos             # <<<<<<<<<<<<<<
- *         cigar_p = pysam_bam_get_cigar(src)
- * 
- */
-  __pyx_t_4 = __pyx_v_src->core.pos;
-  __pyx_v_pos = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":2907
- *         result = []
- *         pos = src.core.pos
- *         cigar_p = pysam_bam_get_cigar(src)             # <<<<<<<<<<<<<<
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- */
-  __pyx_v_cigar_p = pysam_bam_get_cigar(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2909
- *         cigar_p = pysam_bam_get_cigar(src)
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- */
-  __pyx_t_5 = pysam_get_n_cigar(__pyx_v_src);
-  for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
-
-    /* "pysam/calignmentfile.pyx":2910
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK             # <<<<<<<<<<<<<<
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- * 
- */
-    __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & BAM_CIGAR_MASK);
-
-    /* "pysam/calignmentfile.pyx":2911
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT             # <<<<<<<<<<<<<<
- * 
- *             if op == BAM_CSOFT_CLIP or op == BAM_CINS:
- */
-    __pyx_t_3 = __Pyx_PyInt_From_uint32_t(((__pyx_v_cigar_p[__pyx_v_k]) >> BAM_CIGAR_SHIFT)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_3);
-    __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2913
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- * 
- *             if op == BAM_CSOFT_CLIP or op == BAM_CINS:             # <<<<<<<<<<<<<<
- *                 if _full:
- *                     for i from 0 <= i < l:
- */
-    __pyx_t_1 = ((__pyx_v_op == BAM_CSOFT_CLIP) != 0);
-    if (!__pyx_t_1) {
-      __pyx_t_6 = ((__pyx_v_op == BAM_CINS) != 0);
-      __pyx_t_7 = __pyx_t_6;
-    } else {
-      __pyx_t_7 = __pyx_t_1;
-    }
-    if (__pyx_t_7) {
-
-      /* "pysam/calignmentfile.pyx":2914
- * 
- *             if op == BAM_CSOFT_CLIP or op == BAM_CINS:
- *                 if _full:             # <<<<<<<<<<<<<<
- *                     for i from 0 <= i < l:
- *                         result.append(None)
- */
-      __pyx_t_7 = (__pyx_v__full != 0);
-      if (__pyx_t_7) {
-
-        /* "pysam/calignmentfile.pyx":2915
- *             if op == BAM_CSOFT_CLIP or op == BAM_CINS:
- *                 if _full:
- *                     for i from 0 <= i < l:             # <<<<<<<<<<<<<<
- *                         result.append(None)
- *             elif op == BAM_CMATCH:
- */
-        __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_v_l); if (unlikely((__pyx_t_8 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {
-
-          /* "pysam/calignmentfile.pyx":2916
- *                 if _full:
- *                     for i from 0 <= i < l:
- *                         result.append(None)             # <<<<<<<<<<<<<<
- *             elif op == BAM_CMATCH:
- *                 for i from pos <= i < pos + l:
- */
-          __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, Py_None); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        goto __pyx_L7;
-      }
-      __pyx_L7:;
-      goto __pyx_L6;
-    }
-
-    /* "pysam/calignmentfile.pyx":2917
- *                     for i from 0 <= i < l:
- *                         result.append(None)
- *             elif op == BAM_CMATCH:             # <<<<<<<<<<<<<<
- *                 for i from pos <= i < pos + l:
- *                     result.append(i)
- */
-    __pyx_t_7 = ((__pyx_v_op == BAM_CMATCH) != 0);
-    if (__pyx_t_7) {
-
-      /* "pysam/calignmentfile.pyx":2918
- *                         result.append(None)
- *             elif op == BAM_CMATCH:
- *                 for i from pos <= i < pos + l:             # <<<<<<<<<<<<<<
- *                     result.append(i)
- *                 pos += l
- */
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_v_l); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_10); if (unlikely((__pyx_t_8 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      for (__pyx_v_i = __pyx_v_pos; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {
-
-        /* "pysam/calignmentfile.pyx":2919
- *             elif op == BAM_CMATCH:
- *                 for i from pos <= i < pos + l:
- *                     result.append(i)             # <<<<<<<<<<<<<<
- *                 pos += l
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- */
-        __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_10); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      }
-
-      /* "pysam/calignmentfile.pyx":2920
- *                 for i from pos <= i < pos + l:
- *                     result.append(i)
- *                 pos += l             # <<<<<<<<<<<<<<
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- *                 pos += l
- */
-      __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_10, __pyx_v_l); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_v_pos = __pyx_t_8;
-      goto __pyx_L6;
-    }
-
-    /* "pysam/calignmentfile.pyx":2921
- *                     result.append(i)
- *                 pos += l
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:             # <<<<<<<<<<<<<<
- *                 pos += l
- * 
- */
-    __pyx_t_7 = ((__pyx_v_op == BAM_CDEL) != 0);
-    if (!__pyx_t_7) {
-      __pyx_t_1 = ((__pyx_v_op == BAM_CREF_SKIP) != 0);
-      __pyx_t_6 = __pyx_t_1;
-    } else {
-      __pyx_t_6 = __pyx_t_7;
-    }
-    if (__pyx_t_6) {
-
-      /* "pysam/calignmentfile.pyx":2922
- *                 pos += l
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- *                 pos += l             # <<<<<<<<<<<<<<
- * 
- *         return result
- */
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_l); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_t_10); if (unlikely((__pyx_t_8 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_v_pos = __pyx_t_8;
-      goto __pyx_L6;
-    }
-    __pyx_L6:;
-  }
-
-  /* "pysam/calignmentfile.pyx":2924
- *                 pos += l
- * 
- *         return result             # <<<<<<<<<<<<<<
- * 
- *     def infer_query_length(self, always=True):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2885
- *     # Computed properties
- * 
- *     def get_reference_positions(self, full_length=False):             # <<<<<<<<<<<<<<
- *         """a list of reference positions that this read aligns to.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.get_reference_positions", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_l);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2926
- *         return result
- * 
- *     def infer_query_length(self, always=True):             # <<<<<<<<<<<<<<
- *         """inferred read length from CIGAR string.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13infer_query_length(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_12infer_query_length[] = "AlignedSegment.infer_query_length(self, always=True)\ninferred read length from CIGAR string.\n\n        If *always* is set to True, the read length\n        will be always inferred. If set to False, the length\n        of the read sequence will be returned if it is\n        available.\n\n        Returns None if CIGAR string is not present.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13infer_query_length(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_always = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("infer_query_length (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_always,0};
-    PyObject* values[1] = {0};
-    values[0] = ((PyObject *)Py_True);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_always);
-          if (value) { values[0] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "infer_query_length") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_always = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("infer_query_length", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2926; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.infer_query_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12infer_query_length(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), __pyx_v_always);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_12infer_query_length(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_always) {
-  uint32_t __pyx_v_k;
-  uint32_t __pyx_v_qpos;
-  int __pyx_v_op;
-  uint32_t *__pyx_v_cigar_p;
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  uint16_t __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("infer_query_length", 0);
-  __Pyx_TraceCall("infer_query_length", __pyx_f[0], 2926);
-
-  /* "pysam/calignmentfile.pyx":2941
- *         cdef bam1_t * src
- * 
- *         src = self._delegate             # <<<<<<<<<<<<<<
- * 
- *         if not always and src.core.l_qseq:
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2943
- *         src = self._delegate
- * 
- *         if not always and src.core.l_qseq:             # <<<<<<<<<<<<<<
- *             return src.core.l_qseq
- * 
- */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_always); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = (!__pyx_t_2);
-  if (__pyx_t_3) {
-    __pyx_t_2 = (__pyx_v_src->core.l_qseq != 0);
-  } else {
-    __pyx_t_2 = __pyx_t_3;
-  }
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2944
- * 
- *         if not always and src.core.l_qseq:
- *             return src.core.l_qseq             # <<<<<<<<<<<<<<
- * 
- *         if pysam_get_n_cigar(src) == 0:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_src->core.l_qseq); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2946
- *             return src.core.l_qseq
- * 
- *         if pysam_get_n_cigar(src) == 0:             # <<<<<<<<<<<<<<
- *             return None
- * 
- */
-  __pyx_t_2 = ((pysam_get_n_cigar(__pyx_v_src) == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2947
- * 
- *         if pysam_get_n_cigar(src) == 0:
- *             return None             # <<<<<<<<<<<<<<
- * 
- *         qpos = 0
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2949
- *             return None
- * 
- *         qpos = 0             # <<<<<<<<<<<<<<
- *         cigar_p = pysam_bam_get_cigar(src)
- * 
- */
-  __pyx_v_qpos = 0;
-
-  /* "pysam/calignmentfile.pyx":2950
- * 
- *         qpos = 0
- *         cigar_p = pysam_bam_get_cigar(src)             # <<<<<<<<<<<<<<
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- */
-  __pyx_v_cigar_p = pysam_bam_get_cigar(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2952
- *         cigar_p = pysam_bam_get_cigar(src)
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- * 
- */
-  __pyx_t_5 = pysam_get_n_cigar(__pyx_v_src);
-  for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
-
-    /* "pysam/calignmentfile.pyx":2953
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK             # <<<<<<<<<<<<<<
- * 
- *             if op == BAM_CMATCH or op == BAM_CINS or \
- */
-    __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & BAM_CIGAR_MASK);
-
-    /* "pysam/calignmentfile.pyx":2955
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- * 
- *             if op == BAM_CMATCH or op == BAM_CINS or \             # <<<<<<<<<<<<<<
- *                op == BAM_CSOFT_CLIP or \
- *                op == BAM_CEQUAL or op == BAM_CDIFF:
- */
-    __pyx_t_2 = ((__pyx_v_op == BAM_CMATCH) != 0);
-    if (!__pyx_t_2) {
-      __pyx_t_3 = ((__pyx_v_op == BAM_CINS) != 0);
-      if (!__pyx_t_3) {
-
-        /* "pysam/calignmentfile.pyx":2956
- * 
- *             if op == BAM_CMATCH or op == BAM_CINS or \
- *                op == BAM_CSOFT_CLIP or \             # <<<<<<<<<<<<<<
- *                op == BAM_CEQUAL or op == BAM_CDIFF:
- *                 qpos += cigar_p[k] >> BAM_CIGAR_SHIFT
- */
-        __pyx_t_6 = ((__pyx_v_op == BAM_CSOFT_CLIP) != 0);
-        if (!__pyx_t_6) {
-
-          /* "pysam/calignmentfile.pyx":2957
- *             if op == BAM_CMATCH or op == BAM_CINS or \
- *                op == BAM_CSOFT_CLIP or \
- *                op == BAM_CEQUAL or op == BAM_CDIFF:             # <<<<<<<<<<<<<<
- *                 qpos += cigar_p[k] >> BAM_CIGAR_SHIFT
- * 
- */
-          __pyx_t_7 = ((__pyx_v_op == BAM_CEQUAL) != 0);
-          if (!__pyx_t_7) {
-            __pyx_t_8 = ((__pyx_v_op == BAM_CDIFF) != 0);
-            __pyx_t_9 = __pyx_t_8;
-          } else {
-            __pyx_t_9 = __pyx_t_7;
-          }
-          __pyx_t_7 = __pyx_t_9;
-        } else {
-          __pyx_t_7 = __pyx_t_6;
-        }
-        __pyx_t_6 = __pyx_t_7;
-      } else {
-        __pyx_t_6 = __pyx_t_3;
-      }
-      __pyx_t_3 = __pyx_t_6;
-    } else {
-      __pyx_t_3 = __pyx_t_2;
-    }
-    if (__pyx_t_3) {
-
-      /* "pysam/calignmentfile.pyx":2958
- *                op == BAM_CSOFT_CLIP or \
- *                op == BAM_CEQUAL or op == BAM_CDIFF:
- *                 qpos += cigar_p[k] >> BAM_CIGAR_SHIFT             # <<<<<<<<<<<<<<
- * 
- *         return qpos
- */
-      __pyx_v_qpos = (__pyx_v_qpos + ((__pyx_v_cigar_p[__pyx_v_k]) >> BAM_CIGAR_SHIFT));
-      goto __pyx_L7;
-    }
-    __pyx_L7:;
-  }
-
-  /* "pysam/calignmentfile.pyx":2960
- *                 qpos += cigar_p[k] >> BAM_CIGAR_SHIFT
- * 
- *         return qpos             # <<<<<<<<<<<<<<
- * 
- *     def get_aligned_pairs(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_qpos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2926
- *         return result
- * 
- *     def infer_query_length(self, always=True):             # <<<<<<<<<<<<<<
- *         """inferred read length from CIGAR string.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.infer_query_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":2962
- *         return qpos
- * 
- *     def get_aligned_pairs(self):             # <<<<<<<<<<<<<<
- *         """a list of aligned read and reference positions.
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15get_aligned_pairs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_14get_aligned_pairs[] = "AlignedSegment.get_aligned_pairs(self)\na list of aligned read and reference positions.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15get_aligned_pairs(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_aligned_pairs (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14get_aligned_pairs(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_14get_aligned_pairs(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  uint32_t __pyx_v_k;
-  uint32_t __pyx_v_i;
-  uint32_t __pyx_v_pos;
-  uint32_t __pyx_v_qpos;
-  int __pyx_v_op;
-  uint32_t *__pyx_v_cigar_p;
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_v_l = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int32_t __pyx_t_4;
-  uint16_t __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  uint32_t __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  int __pyx_t_11;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("get_aligned_pairs", 0);
-  __Pyx_TraceCall("get_aligned_pairs", __pyx_f[0], 2962);
-
-  /* "pysam/calignmentfile.pyx":2970
- *         cdef bam1_t * src
- * 
- *         src = self._delegate             # <<<<<<<<<<<<<<
- *         if pysam_get_n_cigar(src) == 0:
- *             return []
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":2971
- * 
- *         src = self._delegate
- *         if pysam_get_n_cigar(src) == 0:             # <<<<<<<<<<<<<<
- *             return []
- * 
- */
-  __pyx_t_2 = ((pysam_get_n_cigar(__pyx_v_src) == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":2972
- *         src = self._delegate
- *         if pysam_get_n_cigar(src) == 0:
- *             return []             # <<<<<<<<<<<<<<
- * 
- *         result = []
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":2974
- *             return []
- * 
- *         result = []             # <<<<<<<<<<<<<<
- *         pos = src.core.pos
- *         qpos = 0
- */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_v_result = ((PyObject*)__pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":2975
- * 
- *         result = []
- *         pos = src.core.pos             # <<<<<<<<<<<<<<
- *         qpos = 0
- *         cigar_p = pysam_bam_get_cigar(src)
- */
-  __pyx_t_4 = __pyx_v_src->core.pos;
-  __pyx_v_pos = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":2976
- *         result = []
- *         pos = src.core.pos
- *         qpos = 0             # <<<<<<<<<<<<<<
- *         cigar_p = pysam_bam_get_cigar(src)
- * 
- */
-  __pyx_v_qpos = 0;
-
-  /* "pysam/calignmentfile.pyx":2977
- *         pos = src.core.pos
- *         qpos = 0
- *         cigar_p = pysam_bam_get_cigar(src)             # <<<<<<<<<<<<<<
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- */
-  __pyx_v_cigar_p = pysam_bam_get_cigar(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":2979
- *         cigar_p = pysam_bam_get_cigar(src)
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- */
-  __pyx_t_5 = pysam_get_n_cigar(__pyx_v_src);
-  for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
-
-    /* "pysam/calignmentfile.pyx":2980
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK             # <<<<<<<<<<<<<<
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- * 
- */
-    __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & BAM_CIGAR_MASK);
-
-    /* "pysam/calignmentfile.pyx":2981
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT             # <<<<<<<<<<<<<<
- * 
- *             if op == BAM_CMATCH:
- */
-    __pyx_t_3 = __Pyx_PyInt_From_uint32_t(((__pyx_v_cigar_p[__pyx_v_k]) >> BAM_CIGAR_SHIFT)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_3);
-    __pyx_t_3 = 0;
-
-    /* "pysam/calignmentfile.pyx":2983
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- * 
- *             if op == BAM_CMATCH:             # <<<<<<<<<<<<<<
- *                 for i from pos <= i < pos + l:
- *                     result.append((qpos, i))
- */
-    __pyx_t_2 = ((__pyx_v_op == BAM_CMATCH) != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":2984
- * 
- *             if op == BAM_CMATCH:
- *                 for i from pos <= i < pos + l:             # <<<<<<<<<<<<<<
- *                     result.append((qpos, i))
- *                     qpos += 1
- */
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      for (__pyx_v_i = __pyx_v_pos; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
-
-        /* "pysam/calignmentfile.pyx":2985
- *             if op == BAM_CMATCH:
- *                 for i from pos <= i < pos + l:
- *                     result.append((qpos, i))             # <<<<<<<<<<<<<<
- *                     qpos += 1
- *                 pos += l
- */
-        __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_qpos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
-        __Pyx_GIVEREF(__pyx_t_6);
-        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
-        __Pyx_GIVEREF(__pyx_t_3);
-        __pyx_t_6 = 0;
-        __pyx_t_3 = 0;
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-        /* "pysam/calignmentfile.pyx":2986
- *                 for i from pos <= i < pos + l:
- *                     result.append((qpos, i))
- *                     qpos += 1             # <<<<<<<<<<<<<<
- *                 pos += l
- * 
- */
-        __pyx_v_qpos = (__pyx_v_qpos + 1);
-      }
-
-      /* "pysam/calignmentfile.pyx":2987
- *                     result.append((qpos, i))
- *                     qpos += 1
- *                 pos += l             # <<<<<<<<<<<<<<
- * 
- *             elif op == BAM_CINS:
- */
-      __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_v_l); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_7 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_v_pos = __pyx_t_7;
-      goto __pyx_L6;
-    }
-
-    /* "pysam/calignmentfile.pyx":2989
- *                 pos += l
- * 
- *             elif op == BAM_CINS:             # <<<<<<<<<<<<<<
- *                 for i from pos <= i < pos + l:
- *                     result.append((qpos, None))
- */
-    __pyx_t_2 = ((__pyx_v_op == BAM_CINS) != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":2990
- * 
- *             elif op == BAM_CINS:
- *                 for i from pos <= i < pos + l:             # <<<<<<<<<<<<<<
- *                     result.append((qpos, None))
- *                     qpos += 1
- */
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      for (__pyx_v_i = __pyx_v_pos; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
-
-        /* "pysam/calignmentfile.pyx":2991
- *             elif op == BAM_CINS:
- *                 for i from pos <= i < pos + l:
- *                     result.append((qpos, None))             # <<<<<<<<<<<<<<
- *                     qpos += 1
- * 
- */
-        __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_qpos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
-        __Pyx_GIVEREF(__pyx_t_8);
-        __Pyx_INCREF(Py_None);
-        PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
-        __Pyx_GIVEREF(Py_None);
-        __pyx_t_8 = 0;
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-        /* "pysam/calignmentfile.pyx":2992
- *                 for i from pos <= i < pos + l:
- *                     result.append((qpos, None))
- *                     qpos += 1             # <<<<<<<<<<<<<<
- * 
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- */
-        __pyx_v_qpos = (__pyx_v_qpos + 1);
-      }
-      goto __pyx_L6;
-    }
-
-    /* "pysam/calignmentfile.pyx":2994
- *                     qpos += 1
- * 
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:             # <<<<<<<<<<<<<<
- *                 for i from pos <= i < pos + l:
- *                     result.append((None, i))
- */
-    __pyx_t_2 = ((__pyx_v_op == BAM_CDEL) != 0);
-    if (!__pyx_t_2) {
-      __pyx_t_10 = ((__pyx_v_op == BAM_CREF_SKIP) != 0);
-      __pyx_t_11 = __pyx_t_10;
-    } else {
-      __pyx_t_11 = __pyx_t_2;
-    }
-    if (__pyx_t_11) {
-
-      /* "pysam/calignmentfile.pyx":2995
- * 
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- *                 for i from pos <= i < pos + l:             # <<<<<<<<<<<<<<
- *                     result.append((None, i))
- *                 pos += l
- */
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      for (__pyx_v_i = __pyx_v_pos; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
-
-        /* "pysam/calignmentfile.pyx":2996
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- *                 for i from pos <= i < pos + l:
- *                     result.append((None, i))             # <<<<<<<<<<<<<<
- *                 pos += l
- * 
- */
-        __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_INCREF(Py_None);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
-        __Pyx_GIVEREF(Py_None);
-        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
-        __Pyx_GIVEREF(__pyx_t_8);
-        __pyx_t_8 = 0;
-        __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      }
-
-      /* "pysam/calignmentfile.pyx":2997
- *                 for i from pos <= i < pos + l:
- *                     result.append((None, i))
- *                 pos += l             # <<<<<<<<<<<<<<
- * 
- *         return result
- */
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_l); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_v_pos = __pyx_t_7;
-      goto __pyx_L6;
-    }
-    __pyx_L6:;
-  }
-
-  /* "pysam/calignmentfile.pyx":2999
- *                 pos += l
- * 
- *         return result             # <<<<<<<<<<<<<<
- * 
- *     def get_blocks(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":2962
- *         return qpos
- * 
- *     def get_aligned_pairs(self):             # <<<<<<<<<<<<<<
- *         """a list of aligned read and reference positions.
- *         """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.get_aligned_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_l);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3001
- *         return result
- * 
- *     def get_blocks(self):             # <<<<<<<<<<<<<<
- *         """ a list of start and end positions of
- *         aligned gapless blocks.
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17get_blocks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_16get_blocks[] = "AlignedSegment.get_blocks(self)\n a list of start and end positions of\n        aligned gapless blocks.\n\n        The start and end positions are in genomic \n        coordinates. \n      \n        Blocks are not normalized, i.e. two blocks \n        might be directly adjacent. This happens if\n        the two blocks are separated by an insertion \n        in the read.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17get_blocks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_blocks (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16get_blocks(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_16get_blocks(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  uint32_t __pyx_v_k;
-  uint32_t __pyx_v_pos;
-  uint32_t __pyx_v_l;
-  int __pyx_v_op;
-  uint32_t *__pyx_v_cigar_p;
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int32_t __pyx_t_4;
-  uint16_t __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("get_blocks", 0);
-  __Pyx_TraceCall("get_blocks", __pyx_f[0], 3001);
-
-  /* "pysam/calignmentfile.pyx":3019
- *         cdef bam1_t * src
- * 
- *         src = self._delegate             # <<<<<<<<<<<<<<
- *         if pysam_get_n_cigar(src) == 0:
- *             return []
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":3020
- * 
- *         src = self._delegate
- *         if pysam_get_n_cigar(src) == 0:             # <<<<<<<<<<<<<<
- *             return []
- * 
- */
-  __pyx_t_2 = ((pysam_get_n_cigar(__pyx_v_src) == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":3021
- *         src = self._delegate
- *         if pysam_get_n_cigar(src) == 0:
- *             return []             # <<<<<<<<<<<<<<
- * 
- *         result = []
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3023
- *             return []
- * 
- *         result = []             # <<<<<<<<<<<<<<
- *         pos = src.core.pos
- *         cigar_p = pysam_bam_get_cigar(src)
- */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_v_result = ((PyObject*)__pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":3024
- * 
- *         result = []
- *         pos = src.core.pos             # <<<<<<<<<<<<<<
- *         cigar_p = pysam_bam_get_cigar(src)
- *         l = 0
- */
-  __pyx_t_4 = __pyx_v_src->core.pos;
-  __pyx_v_pos = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":3025
- *         result = []
- *         pos = src.core.pos
- *         cigar_p = pysam_bam_get_cigar(src)             # <<<<<<<<<<<<<<
- *         l = 0
- * 
- */
-  __pyx_v_cigar_p = pysam_bam_get_cigar(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":3026
- *         pos = src.core.pos
- *         cigar_p = pysam_bam_get_cigar(src)
- *         l = 0             # <<<<<<<<<<<<<<
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- */
-  __pyx_v_l = 0;
-
-  /* "pysam/calignmentfile.pyx":3028
- *         l = 0
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- */
-  __pyx_t_5 = pysam_get_n_cigar(__pyx_v_src);
-  for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
-
-    /* "pysam/calignmentfile.pyx":3029
- * 
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK             # <<<<<<<<<<<<<<
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- *             if op == BAM_CMATCH:
- */
-    __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & BAM_CIGAR_MASK);
-
-    /* "pysam/calignmentfile.pyx":3030
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT             # <<<<<<<<<<<<<<
- *             if op == BAM_CMATCH:
- *                 result.append((pos, pos + l))
- */
-    __pyx_v_l = ((__pyx_v_cigar_p[__pyx_v_k]) >> BAM_CIGAR_SHIFT);
-
-    /* "pysam/calignmentfile.pyx":3031
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- *             if op == BAM_CMATCH:             # <<<<<<<<<<<<<<
- *                 result.append((pos, pos + l))
- *                 pos += l
- */
-    __pyx_t_2 = ((__pyx_v_op == BAM_CMATCH) != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":3032
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- *             if op == BAM_CMATCH:
- *                 result.append((pos, pos + l))             # <<<<<<<<<<<<<<
- *                 pos += l
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- */
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_6 = __Pyx_PyInt_From_uint32_t((__pyx_v_pos + __pyx_v_l)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
-      __Pyx_GIVEREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_3 = 0;
-      __pyx_t_6 = 0;
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-      /* "pysam/calignmentfile.pyx":3033
- *             if op == BAM_CMATCH:
- *                 result.append((pos, pos + l))
- *                 pos += l             # <<<<<<<<<<<<<<
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- *                 pos += l
- */
-      __pyx_v_pos = (__pyx_v_pos + __pyx_v_l);
-      goto __pyx_L6;
-    }
-
-    /* "pysam/calignmentfile.pyx":3034
- *                 result.append((pos, pos + l))
- *                 pos += l
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:             # <<<<<<<<<<<<<<
- *                 pos += l
- * 
- */
-    __pyx_t_2 = ((__pyx_v_op == BAM_CDEL) != 0);
-    if (!__pyx_t_2) {
-      __pyx_t_9 = ((__pyx_v_op == BAM_CREF_SKIP) != 0);
-      __pyx_t_10 = __pyx_t_9;
-    } else {
-      __pyx_t_10 = __pyx_t_2;
-    }
-    if (__pyx_t_10) {
-
-      /* "pysam/calignmentfile.pyx":3035
- *                 pos += l
- *             elif op == BAM_CDEL or op == BAM_CREF_SKIP:
- *                 pos += l             # <<<<<<<<<<<<<<
- * 
- *         return result
- */
-      __pyx_v_pos = (__pyx_v_pos + __pyx_v_l);
-      goto __pyx_L6;
-    }
-    __pyx_L6:;
-  }
-
-  /* "pysam/calignmentfile.pyx":3037
- *                 pos += l
- * 
- *         return result             # <<<<<<<<<<<<<<
- * 
- *     def get_overlap(self, uint32_t start, uint32_t end):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3001
- *         return result
- * 
- *     def get_blocks(self):             # <<<<<<<<<<<<<<
- *         """ a list of start and end positions of
- *         aligned gapless blocks.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.get_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3039
- *         return result
- * 
- *     def get_overlap(self, uint32_t start, uint32_t end):             # <<<<<<<<<<<<<<
- *         """return number of aligned bases of read overlapping the interval
- *         *start* and *end* on the reference sequence.
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_19get_overlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_18get_overlap[] = "AlignedSegment.get_overlap(self, uint32_t start, uint32_t end)\nreturn number of aligned bases of read overlapping the interval\n        *start* and *end* on the reference sequence.\n\n        Return None if cigar alignment is not available.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_19get_overlap(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  uint32_t __pyx_v_start;
-  uint32_t __pyx_v_end;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_overlap (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_end,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("get_overlap", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_overlap") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __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_start = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_start == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_end = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_end == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get_overlap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.get_overlap", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_18get_overlap(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), __pyx_v_start, __pyx_v_end);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_18get_overlap(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, uint32_t __pyx_v_start, uint32_t __pyx_v_end) {
-  uint32_t __pyx_v_k;
-  uint32_t __pyx_v_pos;
-  uint32_t __pyx_v_overlap;
-  int __pyx_v_op;
-  int __pyx_v_o;
-  uint32_t *__pyx_v_cigar_p;
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_v_l = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  int32_t __pyx_t_3;
-  uint16_t __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  uint32_t __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  uint32_t __pyx_t_10;
-  uint32_t __pyx_t_11;
-  int __pyx_t_12;
-  int __pyx_t_13;
-  int __pyx_t_14;
-  int __pyx_t_15;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("get_overlap", 0);
-  __Pyx_TraceCall("get_overlap", __pyx_f[0], 3039);
-
-  /* "pysam/calignmentfile.pyx":3050
- *         cdef bam1_t * src
- * 
- *         overlap = 0             # <<<<<<<<<<<<<<
- * 
- *         src = self._delegate
- */
-  __pyx_v_overlap = 0;
-
-  /* "pysam/calignmentfile.pyx":3052
- *         overlap = 0
- * 
- *         src = self._delegate             # <<<<<<<<<<<<<<
- *         if pysam_get_n_cigar(src) == 0:
- *             return None
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":3053
- * 
- *         src = self._delegate
- *         if pysam_get_n_cigar(src) == 0:             # <<<<<<<<<<<<<<
- *             return None
- *         pos = src.core.pos
- */
-  __pyx_t_2 = ((pysam_get_n_cigar(__pyx_v_src) == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":3054
- *         src = self._delegate
- *         if pysam_get_n_cigar(src) == 0:
- *             return None             # <<<<<<<<<<<<<<
- *         pos = src.core.pos
- *         o = 0
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3055
- *         if pysam_get_n_cigar(src) == 0:
- *             return None
- *         pos = src.core.pos             # <<<<<<<<<<<<<<
- *         o = 0
- * 
- */
-  __pyx_t_3 = __pyx_v_src->core.pos;
-  __pyx_v_pos = __pyx_t_3;
-
-  /* "pysam/calignmentfile.pyx":3056
- *             return None
- *         pos = src.core.pos
- *         o = 0             # <<<<<<<<<<<<<<
- * 
- *         cigar_p = pysam_bam_get_cigar(src)
- */
-  __pyx_v_o = 0;
-
-  /* "pysam/calignmentfile.pyx":3058
- *         o = 0
- * 
- *         cigar_p = pysam_bam_get_cigar(src)             # <<<<<<<<<<<<<<
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- */
-  __pyx_v_cigar_p = pysam_bam_get_cigar(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":3059
- * 
- *         cigar_p = pysam_bam_get_cigar(src)
- *         for k from 0 <= k < pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- */
-  __pyx_t_4 = pysam_get_n_cigar(__pyx_v_src);
-  for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_4; __pyx_v_k++) {
-
-    /* "pysam/calignmentfile.pyx":3060
- *         cigar_p = pysam_bam_get_cigar(src)
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK             # <<<<<<<<<<<<<<
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- * 
- */
-    __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & BAM_CIGAR_MASK);
-
-    /* "pysam/calignmentfile.pyx":3061
- *         for k from 0 <= k < pysam_get_n_cigar(src):
- *             op = cigar_p[k] & BAM_CIGAR_MASK
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT             # <<<<<<<<<<<<<<
- * 
- *             if op == BAM_CMATCH:
- */
-    __pyx_t_5 = __Pyx_PyInt_From_uint32_t(((__pyx_v_cigar_p[__pyx_v_k]) >> BAM_CIGAR_SHIFT)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_5);
-    __pyx_t_5 = 0;
-
-    /* "pysam/calignmentfile.pyx":3063
- *             l = cigar_p[k] >> BAM_CIGAR_SHIFT
- * 
- *             if op == BAM_CMATCH:             # <<<<<<<<<<<<<<
- *                 o = min( pos + l, end) - max( pos, start )
- *                 if o > 0: overlap += o
- */
-    __pyx_t_2 = ((__pyx_v_op == BAM_CMATCH) != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/calignmentfile.pyx":3064
- * 
- *             if op == BAM_CMATCH:
- *                 o = min( pos + l, end) - max( pos, start )             # <<<<<<<<<<<<<<
- *                 if o > 0: overlap += o
- * 
- */
-      __pyx_t_6 = __pyx_v_end;
-      __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_l); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (__pyx_t_2) {
-        __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_5 = __pyx_t_9;
-        __pyx_t_9 = 0;
-      } else {
-        __Pyx_INCREF(__pyx_t_7);
-        __pyx_t_5 = __pyx_t_7;
-      }
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_6 = __pyx_v_start;
-      __pyx_t_10 = __pyx_v_pos;
-      if (((__pyx_t_6 > __pyx_t_10) != 0)) {
-        __pyx_t_11 = __pyx_t_6;
-      } else {
-        __pyx_t_11 = __pyx_t_10;
-      }
-      __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_9 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_v_o = __pyx_t_12;
-
-      /* "pysam/calignmentfile.pyx":3065
- *             if op == BAM_CMATCH:
- *                 o = min( pos + l, end) - max( pos, start )
- *                 if o > 0: overlap += o             # <<<<<<<<<<<<<<
- * 
- *             if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP:
- */
-      __pyx_t_2 = ((__pyx_v_o > 0) != 0);
-      if (__pyx_t_2) {
-        __pyx_v_overlap = (__pyx_v_overlap + __pyx_v_o);
-        goto __pyx_L7;
-      }
-      __pyx_L7:;
-      goto __pyx_L6;
-    }
-    __pyx_L6:;
-
-    /* "pysam/calignmentfile.pyx":3067
- *                 if o > 0: overlap += o
- * 
- *             if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP:             # <<<<<<<<<<<<<<
- *                 pos += l
- * 
- */
-    __pyx_t_2 = ((__pyx_v_op == BAM_CMATCH) != 0);
-    if (!__pyx_t_2) {
-      __pyx_t_13 = ((__pyx_v_op == BAM_CDEL) != 0);
-      if (!__pyx_t_13) {
-        __pyx_t_14 = ((__pyx_v_op == BAM_CREF_SKIP) != 0);
-        __pyx_t_15 = __pyx_t_14;
-      } else {
-        __pyx_t_15 = __pyx_t_13;
-      }
-      __pyx_t_13 = __pyx_t_15;
-    } else {
-      __pyx_t_13 = __pyx_t_2;
-    }
-    if (__pyx_t_13) {
-
-      /* "pysam/calignmentfile.pyx":3068
- * 
- *             if op == BAM_CMATCH or op == BAM_CDEL or op == BAM_CREF_SKIP:
- *                 pos += l             # <<<<<<<<<<<<<<
- * 
- *         return overlap
- */
-      __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_v_l); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_11 = __Pyx_PyInt_As_uint32_t(__pyx_t_7); if (unlikely((__pyx_t_11 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_v_pos = __pyx_t_11;
-      goto __pyx_L8;
-    }
-    __pyx_L8:;
-  }
-
-  /* "pysam/calignmentfile.pyx":3070
- *                 pos += l
- * 
- *         return overlap             # <<<<<<<<<<<<<<
- * 
- *     #####################################################
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_7 = __Pyx_PyInt_From_uint32_t(__pyx_v_overlap); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_r = __pyx_t_7;
-  __pyx_t_7 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3039
- *         return result
- * 
- *     def get_overlap(self, uint32_t start, uint32_t end):             # <<<<<<<<<<<<<<
- *         """return number of aligned bases of read overlapping the interval
- *         *start* and *end* on the reference sequence.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.get_overlap", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_l);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3115
- *         or None.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef uint32_t * cigar_p
- *             cdef bam1_t * src
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigartuples___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigartuples___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  uint32_t *__pyx_v_cigar_p;
-  bam1_t *__pyx_v_src;
-  uint32_t __pyx_v_op;
-  uint32_t __pyx_v_l;
-  int __pyx_v_k;
-  PyObject *__pyx_v_cigar = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  uint16_t __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3115);
-
-  /* "pysam/calignmentfile.pyx":3121
- *             cdef int k
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- *             if pysam_get_n_cigar(src) == 0:
- *                 return None
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":3122
- * 
- *             src = self._delegate
- *             if pysam_get_n_cigar(src) == 0:             # <<<<<<<<<<<<<<
- *                 return None
- * 
- */
-  __pyx_t_2 = ((pysam_get_n_cigar(__pyx_v_src) == 0) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":3123
- *             src = self._delegate
- *             if pysam_get_n_cigar(src) == 0:
- *                 return None             # <<<<<<<<<<<<<<
- * 
- *             cigar = []
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3125
- *                 return None
- * 
- *             cigar = []             # <<<<<<<<<<<<<<
- * 
- *             cigar_p = pysam_bam_get_cigar(src);
- */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_v_cigar = ((PyObject*)__pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":3127
- *             cigar = []
- * 
- *             cigar_p = pysam_bam_get_cigar(src);             # <<<<<<<<<<<<<<
- *             for k from 0 <= k < pysam_get_n_cigar(src):
- *                 op = cigar_p[k] & BAM_CIGAR_MASK
- */
-  __pyx_v_cigar_p = pysam_bam_get_cigar(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":3128
- * 
- *             cigar_p = pysam_bam_get_cigar(src);
- *             for k from 0 <= k < pysam_get_n_cigar(src):             # <<<<<<<<<<<<<<
- *                 op = cigar_p[k] & BAM_CIGAR_MASK
- *                 l = cigar_p[k] >> BAM_CIGAR_SHIFT
- */
-  __pyx_t_4 = pysam_get_n_cigar(__pyx_v_src);
-  for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_4; __pyx_v_k++) {
-
-    /* "pysam/calignmentfile.pyx":3129
- *             cigar_p = pysam_bam_get_cigar(src);
- *             for k from 0 <= k < pysam_get_n_cigar(src):
- *                 op = cigar_p[k] & BAM_CIGAR_MASK             # <<<<<<<<<<<<<<
- *                 l = cigar_p[k] >> BAM_CIGAR_SHIFT
- *                 cigar.append((op, l))
- */
-    __pyx_v_op = ((__pyx_v_cigar_p[__pyx_v_k]) & BAM_CIGAR_MASK);
-
-    /* "pysam/calignmentfile.pyx":3130
- *             for k from 0 <= k < pysam_get_n_cigar(src):
- *                 op = cigar_p[k] & BAM_CIGAR_MASK
- *                 l = cigar_p[k] >> BAM_CIGAR_SHIFT             # <<<<<<<<<<<<<<
- *                 cigar.append((op, l))
- *             return cigar
- */
-    __pyx_v_l = ((__pyx_v_cigar_p[__pyx_v_k]) >> BAM_CIGAR_SHIFT);
-
-    /* "pysam/calignmentfile.pyx":3131
- *                 op = cigar_p[k] & BAM_CIGAR_MASK
- *                 l = cigar_p[k] >> BAM_CIGAR_SHIFT
- *                 cigar.append((op, l))             # <<<<<<<<<<<<<<
- *             return cigar
- * 
- */
-    __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_l); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_3 = 0;
-    __pyx_t_5 = 0;
-    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_cigar, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3132
- *                 l = cigar_p[k] >> BAM_CIGAR_SHIFT
- *                 cigar.append((op, l))
- *             return cigar             # <<<<<<<<<<<<<<
- * 
- *         def __set__(self, values):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_cigar);
-  __pyx_r = __pyx_v_cigar;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3115
- *         or None.
- *         """
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef uint32_t * cigar_p
- *             cdef bam1_t * src
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.cigartuples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_cigar);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3134
- *             return cigar
- * 
- *         def __set__(self, values):             # <<<<<<<<<<<<<<
- *             cdef uint32_t * p
- *             cdef bam1_t * src
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_values); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_values));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_values) {
-  uint32_t *__pyx_v_p;
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_v_op = 0;
-  PyObject *__pyx_v_l = 0;
-  int __pyx_v_k;
-  int __pyx_v_ncigar;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  bam1_t *__pyx_t_1;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  Py_ssize_t __pyx_t_5;
-  PyObject *(*__pyx_t_6)(PyObject *);
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *(*__pyx_t_11)(PyObject *);
-  uint32_t __pyx_t_12;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3134);
-  __Pyx_INCREF(__pyx_v_values);
-
-  /* "pysam/calignmentfile.pyx":3140
- *             cdef int k, ncigar
- * 
- *             k = 0             # <<<<<<<<<<<<<<
- * 
- *             src = self._delegate
- */
-  __pyx_v_k = 0;
-
-  /* "pysam/calignmentfile.pyx":3142
- *             k = 0
- * 
- *             src = self._delegate             # <<<<<<<<<<<<<<
- * 
- *             # get location of cigar string
- */
-  __pyx_t_1 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":3145
- * 
- *             # get location of cigar string
- *             p = pysam_bam_get_cigar(src)             # <<<<<<<<<<<<<<
- * 
- *             # empty values for cigar string
- */
-  __pyx_v_p = pysam_bam_get_cigar(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":3148
- * 
- *             # empty values for cigar string
- *             if values is None:             # <<<<<<<<<<<<<<
- *                 values = []
- * 
- */
-  __pyx_t_2 = (__pyx_v_values == Py_None);
-  __pyx_t_3 = (__pyx_t_2 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":3149
- *             # empty values for cigar string
- *             if values is None:
- *                 values = []             # <<<<<<<<<<<<<<
- * 
- *             ncigar = len(values)
- */
-    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4);
-    __pyx_t_4 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":3151
- *                 values = []
- * 
- *             ncigar = len(values)             # <<<<<<<<<<<<<<
- *             # create space for cigar data within src.data
- *             pysam_bam_update(src,
- */
-  __pyx_t_5 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_ncigar = __pyx_t_5;
-
-  /* "pysam/calignmentfile.pyx":3153
- *             ncigar = len(values)
- *             # create space for cigar data within src.data
- *             pysam_bam_update(src,             # <<<<<<<<<<<<<<
- *                              pysam_get_n_cigar(src) * 4,
- *                              ncigar * 4,
- */
-  pysam_bam_update(__pyx_v_src, (pysam_get_n_cigar(__pyx_v_src) * 4), (__pyx_v_ncigar * 4), ((uint8_t *)__pyx_v_p));
-
-  /* "pysam/calignmentfile.pyx":3159
- * 
- *             # length is number of cigar operations, not bytes
- *             pysam_set_n_cigar(src, ncigar)             # <<<<<<<<<<<<<<
- * 
- *             # re-acquire pointer to location in memory
- */
-  pysam_set_n_cigar(__pyx_v_src, __pyx_v_ncigar);
-
-  /* "pysam/calignmentfile.pyx":3163
- *             # re-acquire pointer to location in memory
- *             # as it might have moved
- *             p = pysam_bam_get_cigar(src)             # <<<<<<<<<<<<<<
- * 
- *             # insert cigar operations
- */
-  __pyx_v_p = pysam_bam_get_cigar(__pyx_v_src);
-
-  /* "pysam/calignmentfile.pyx":3166
- * 
- *             # insert cigar operations
- *             for op, l in values:             # <<<<<<<<<<<<<<
- *                 p[k] = l << BAM_CIGAR_SHIFT | op
- *                 k += 1
- */
-  if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
-    __pyx_t_4 = __pyx_v_values; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
-    __pyx_t_6 = NULL;
-  } else {
-    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_7 = __pyx_t_6(__pyx_t_4);
-      if (unlikely(!__pyx_t_7)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_7);
-    }
-    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
-      PyObject* sequence = __pyx_t_7;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 2)) {
-        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
-      } else {
-        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
-      }
-      __Pyx_INCREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_t_9);
-      #else
-      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      #endif
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
-      index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_8);
-      index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_9);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_11 = NULL;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      goto __pyx_L7_unpacking_done;
-      __pyx_L6_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_t_11 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L7_unpacking_done:;
-    }
-    __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_8);
-    __pyx_t_8 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_9);
-    __pyx_t_9 = 0;
-
-    /* "pysam/calignmentfile.pyx":3167
- *             # insert cigar operations
- *             for op, l in values:
- *                 p[k] = l << BAM_CIGAR_SHIFT | op             # <<<<<<<<<<<<<<
- *                 k += 1
- * 
- */
-    __pyx_t_7 = __Pyx_PyInt_From_int(BAM_CIGAR_SHIFT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_9 = PyNumber_Lshift(__pyx_v_l, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PyNumber_Or(__pyx_t_9, __pyx_v_op); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_t_7); if (unlikely((__pyx_t_12 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    (__pyx_v_p[__pyx_v_k]) = __pyx_t_12;
-
-    /* "pysam/calignmentfile.pyx":3168
- *             for op, l in values:
- *                 p[k] = l << BAM_CIGAR_SHIFT | op
- *                 k += 1             # <<<<<<<<<<<<<<
- * 
- *             ## setting the cigar string requires updating the bin
- */
-    __pyx_v_k = (__pyx_v_k + 1);
-  }
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":3171
- * 
- *             ## setting the cigar string requires updating the bin
- *             pysam_set_bin(src,             # <<<<<<<<<<<<<<
- *                           hts_reg2bin(
- *                               src.core.pos,
- */
-  pysam_set_bin(__pyx_v_src, hts_reg2bin(__pyx_v_src->core.pos, bam_endpos(__pyx_v_src), 14, 5));
-
-  /* "pysam/calignmentfile.pyx":3134
- *             return cigar
- * 
- *         def __set__(self, values):             # <<<<<<<<<<<<<<
- *             cdef uint32_t * p
- *             cdef bam1_t * src
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.cigartuples.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_op);
-  __Pyx_XDECREF(__pyx_v_l);
-  __Pyx_XDECREF(__pyx_v_values);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3180
- * 
- * 
- *     cpdef setTag(self, tag, value,             # <<<<<<<<<<<<<<
- *                  value_type = None,
- *                  replace = True):
- */
-
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21setTag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_5pysam_14calignmentfile_14AlignedSegment_setTag(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag *__pyx_optional_args) {
-
-  /* "pysam/calignmentfile.pyx":3181
- * 
- *     cpdef setTag(self, tag, value,
- *                  value_type = None,             # <<<<<<<<<<<<<<
- *                  replace = True):
- *         '''
- */
-  PyObject *__pyx_v_value_type = ((PyObject *)Py_None);
-
-  /* "pysam/calignmentfile.pyx":3182
- *     cpdef setTag(self, tag, value,
- *                  value_type = None,
- *                  replace = True):             # <<<<<<<<<<<<<<
- *         '''
- *         Set optional field of alignment *tag* to *value*.  *value_type* may be specified,
- */
-  PyObject *__pyx_v_replace = ((PyObject *)Py_True);
-  int __pyx_v_value_size;
-  uint8_t *__pyx_v_value_ptr;
-  uint8_t *__pyx_v_existing_ptr;
-  uint8_t __pyx_v_type_code;
-  float __pyx_v_float_value;
-  double __pyx_v_double_value;
-  int32_t __pyx_v_int_value;
-  bam1_t *__pyx_v_src;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  bam1_t *__pyx_t_4;
-  Py_ssize_t __pyx_t_5;
-  int __pyx_t_6;
-  uint8_t __pyx_t_7;
-  struct __pyx_opt_args_5pysam_14calignmentfile__getTypeCode __pyx_t_8;
-  char *__pyx_t_9;
-  int32_t __pyx_t_10;
-  double __pyx_t_11;
-  float __pyx_t_12;
-  char const *__pyx_t_13;
-  char const *__pyx_t_14;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("setTag", 0);
-  __Pyx_TraceCall("setTag", __pyx_f[0], 3180);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_value_type = __pyx_optional_args->value_type;
-      if (__pyx_optional_args->__pyx_n > 1) {
-        __pyx_v_replace = __pyx_optional_args->replace;
-      }
-    }
-  }
-  __Pyx_INCREF(__pyx_v_tag);
-  __Pyx_INCREF(__pyx_v_value);
-
-  /* "pysam/calignmentfile.pyx":3180
- * 
- * 
- *     cpdef setTag(self, tag, value,             # <<<<<<<<<<<<<<
- *                  value_type = None,
- *                  replace = True):
- */
-  /* Check if called by wrapper */
-  if (unlikely(__pyx_skip_dispatch)) ;
-  /* Check if overridden in Python */
-  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setTag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21setTag)) {
-      __Pyx_XDECREF(__pyx_r);
-      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_tag);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tag);
-      __Pyx_GIVEREF(__pyx_v_tag);
-      __Pyx_INCREF(__pyx_v_value);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
-      __Pyx_GIVEREF(__pyx_v_value);
-      __Pyx_INCREF(__pyx_v_value_type);
-      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value_type);
-      __Pyx_GIVEREF(__pyx_v_value_type);
-      __Pyx_INCREF(__pyx_v_replace);
-      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_replace);
-      __Pyx_GIVEREF(__pyx_v_replace);
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_r = __pyx_t_3;
-      __pyx_t_3 = 0;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L0;
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3198
- *         cdef double   double_value
- *         cdef int32_t  int_value
- *         cdef bam1_t * src = self._delegate             # <<<<<<<<<<<<<<
- *         cdef char * _value_type
- * 
- */
-  __pyx_t_4 = __pyx_v_self->_delegate;
-  __pyx_v_src = __pyx_t_4;
-
-  /* "pysam/calignmentfile.pyx":3201
- *         cdef char * _value_type
- * 
- *         if len(tag) != 2:             # <<<<<<<<<<<<<<
- *             raise ValueError('Invalid tag: %s' % tag)
- * 
- */
-  __pyx_t_5 = PyObject_Length(__pyx_v_tag); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_6 = ((__pyx_t_5 != 2) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/calignmentfile.pyx":3202
- * 
- *         if len(tag) != 2:
- *             raise ValueError('Invalid tag: %s' % tag)             # <<<<<<<<<<<<<<
- * 
- *         type_code = _getTypeCode(value, value_type)
- */
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_tag_s, __pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __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 = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":3204
- *             raise ValueError('Invalid tag: %s' % tag)
- * 
- *         type_code = _getTypeCode(value, value_type)             # <<<<<<<<<<<<<<
- *         if type_code == 0:
- *             raise ValueError("can't guess type or invalid type code specified")
- */
-  __pyx_t_8.__pyx_n = 1;
-  __pyx_t_8.value_type = __pyx_v_value_type;
-  __pyx_t_7 = __pyx_f_5pysam_14calignmentfile__getTypeCode(__pyx_v_value, &__pyx_t_8); 
-  __pyx_v_type_code = __pyx_t_7;
-
-  /* "pysam/calignmentfile.pyx":3205
- * 
- *         type_code = _getTypeCode(value, value_type)
- *         if type_code == 0:             # <<<<<<<<<<<<<<
- *             raise ValueError("can't guess type or invalid type code specified")
- * 
- */
-  __pyx_t_6 = ((__pyx_v_type_code == 0) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/calignmentfile.pyx":3206
- *         type_code = _getTypeCode(value, value_type)
- *         if type_code == 0:
- *             raise ValueError("can't guess type or invalid type code specified")             # <<<<<<<<<<<<<<
- * 
- *         # Not Endian-safe, but then again neither is samtools!
- */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":3221
- *             value_ptr    = <uint8_t*>&double_value
- *             value_size   = sizeof(double)
- *         elif type_code == 'f':             # <<<<<<<<<<<<<<
- *             float_value  = value
- *             value_ptr    = <uint8_t*>&float_value
- */
-  switch (__pyx_v_type_code) {
-
-    /* "pysam/calignmentfile.pyx":3209
- * 
- *         # Not Endian-safe, but then again neither is samtools!
- *         if type_code == 'Z':             # <<<<<<<<<<<<<<
- *             value = _forceBytes( value )
- *             value_ptr    = <uint8_t*><char*>value
- */
-    case 'Z':
-
-    /* "pysam/calignmentfile.pyx":3210
- *         # Not Endian-safe, but then again neither is samtools!
- *         if type_code == 'Z':
- *             value = _forceBytes( value )             # <<<<<<<<<<<<<<
- *             value_ptr    = <uint8_t*><char*>value
- *             value_size   = len(value)+1
- */
-    __pyx_t_1 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/calignmentfile.pyx":3211
- *         if type_code == 'Z':
- *             value = _forceBytes( value )
- *             value_ptr    = <uint8_t*><char*>value             # <<<<<<<<<<<<<<
- *             value_size   = len(value)+1
- *         elif type_code == 'i':
- */
-    __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_value_ptr = ((uint8_t *)((char *)__pyx_t_9));
-
-    /* "pysam/calignmentfile.pyx":3212
- *             value = _forceBytes( value )
- *             value_ptr    = <uint8_t*><char*>value
- *             value_size   = len(value)+1             # <<<<<<<<<<<<<<
- *         elif type_code == 'i':
- *             int_value    = value
- */
-    __pyx_t_5 = PyObject_Length(__pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_value_size = (__pyx_t_5 + 1);
-    break;
-
-    /* "pysam/calignmentfile.pyx":3213
- *             value_ptr    = <uint8_t*><char*>value
- *             value_size   = len(value)+1
- *         elif type_code == 'i':             # <<<<<<<<<<<<<<
- *             int_value    = value
- *             value_ptr    = <uint8_t*>&int_value
- */
-    case 'i':
-
-    /* "pysam/calignmentfile.pyx":3214
- *             value_size   = len(value)+1
- *         elif type_code == 'i':
- *             int_value    = value             # <<<<<<<<<<<<<<
- *             value_ptr    = <uint8_t*>&int_value
- *             value_size   = sizeof(int32_t)
- */
-    __pyx_t_10 = __Pyx_PyInt_As_int32_t(__pyx_v_value); if (unlikely((__pyx_t_10 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_int_value = __pyx_t_10;
-
-    /* "pysam/calignmentfile.pyx":3215
- *         elif type_code == 'i':
- *             int_value    = value
- *             value_ptr    = <uint8_t*>&int_value             # <<<<<<<<<<<<<<
- *             value_size   = sizeof(int32_t)
- *         elif type_code == 'd':
- */
-    __pyx_v_value_ptr = ((uint8_t *)(&__pyx_v_int_value));
-
-    /* "pysam/calignmentfile.pyx":3216
- *             int_value    = value
- *             value_ptr    = <uint8_t*>&int_value
- *             value_size   = sizeof(int32_t)             # <<<<<<<<<<<<<<
- *         elif type_code == 'd':
- *             double_value = value
- */
-    __pyx_v_value_size = (sizeof(int32_t));
-    break;
-
-    /* "pysam/calignmentfile.pyx":3217
- *             value_ptr    = <uint8_t*>&int_value
- *             value_size   = sizeof(int32_t)
- *         elif type_code == 'd':             # <<<<<<<<<<<<<<
- *             double_value = value
- *             value_ptr    = <uint8_t*>&double_value
- */
-    case 'd':
-
-    /* "pysam/calignmentfile.pyx":3218
- *             value_size   = sizeof(int32_t)
- *         elif type_code == 'd':
- *             double_value = value             # <<<<<<<<<<<<<<
- *             value_ptr    = <uint8_t*>&double_value
- *             value_size   = sizeof(double)
- */
-    __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_double_value = __pyx_t_11;
-
-    /* "pysam/calignmentfile.pyx":3219
- *         elif type_code == 'd':
- *             double_value = value
- *             value_ptr    = <uint8_t*>&double_value             # <<<<<<<<<<<<<<
- *             value_size   = sizeof(double)
- *         elif type_code == 'f':
- */
-    __pyx_v_value_ptr = ((uint8_t *)(&__pyx_v_double_value));
-
-    /* "pysam/calignmentfile.pyx":3220
- *             double_value = value
- *             value_ptr    = <uint8_t*>&double_value
- *             value_size   = sizeof(double)             # <<<<<<<<<<<<<<
- *         elif type_code == 'f':
- *             float_value  = value
- */
-    __pyx_v_value_size = (sizeof(double));
-    break;
-
-    /* "pysam/calignmentfile.pyx":3221
- *             value_ptr    = <uint8_t*>&double_value
- *             value_size   = sizeof(double)
- *         elif type_code == 'f':             # <<<<<<<<<<<<<<
- *             float_value  = value
- *             value_ptr    = <uint8_t*>&float_value
- */
-    case 'f':
-
-    /* "pysam/calignmentfile.pyx":3222
- *             value_size   = sizeof(double)
- *         elif type_code == 'f':
- *             float_value  = value             # <<<<<<<<<<<<<<
- *             value_ptr    = <uint8_t*>&float_value
- *             value_size   = sizeof(float)
- */
-    __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_float_value = __pyx_t_12;
-
-    /* "pysam/calignmentfile.pyx":3223
- *         elif type_code == 'f':
- *             float_value  = value
- *             value_ptr    = <uint8_t*>&float_value             # <<<<<<<<<<<<<<
- *             value_size   = sizeof(float)
- *         else:
- */
-    __pyx_v_value_ptr = ((uint8_t *)(&__pyx_v_float_value));
-
-    /* "pysam/calignmentfile.pyx":3224
- *             float_value  = value
- *             value_ptr    = <uint8_t*>&float_value
- *             value_size   = sizeof(float)             # <<<<<<<<<<<<<<
- *         else:
- *             raise ValueError('Unsupported value_type in set_option')
- */
-    __pyx_v_value_size = (sizeof(float));
-    break;
-    default:
-
-    /* "pysam/calignmentfile.pyx":3226
- *             value_size   = sizeof(float)
- *         else:
- *             raise ValueError('Unsupported value_type in set_option')             # <<<<<<<<<<<<<<
- * 
- *         tag = _forceBytes( tag )
- */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    break;
-  }
-
-  /* "pysam/calignmentfile.pyx":3228
- *             raise ValueError('Unsupported value_type in set_option')
- * 
- *         tag = _forceBytes( tag )             # <<<<<<<<<<<<<<
- *         if replace:
- *             existing_ptr = bam_aux_get(src, tag)
- */
-  __pyx_t_1 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":3229
- * 
- *         tag = _forceBytes( tag )
- *         if replace:             # <<<<<<<<<<<<<<
- *             existing_ptr = bam_aux_get(src, tag)
- *             if existing_ptr:
- */
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_replace); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_6) {
-
-    /* "pysam/calignmentfile.pyx":3230
- *         tag = _forceBytes( tag )
- *         if replace:
- *             existing_ptr = bam_aux_get(src, tag)             # <<<<<<<<<<<<<<
- *             if existing_ptr:
- *                 bam_aux_del(src, existing_ptr)
- */
-    __pyx_t_13 = __Pyx_PyObject_AsString(__pyx_v_tag); if (unlikely((!__pyx_t_13) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_existing_ptr = bam_aux_get(__pyx_v_src, __pyx_t_13);
-
-    /* "pysam/calignmentfile.pyx":3231
- *         if replace:
- *             existing_ptr = bam_aux_get(src, tag)
- *             if existing_ptr:             # <<<<<<<<<<<<<<
- *                 bam_aux_del(src, existing_ptr)
- * 
- */
-    __pyx_t_6 = (__pyx_v_existing_ptr != 0);
-    if (__pyx_t_6) {
-
-      /* "pysam/calignmentfile.pyx":3232
- *             existing_ptr = bam_aux_get(src, tag)
- *             if existing_ptr:
- *                 bam_aux_del(src, existing_ptr)             # <<<<<<<<<<<<<<
- * 
- *         bam_aux_append(src,
- */
-      bam_aux_del(__pyx_v_src, __pyx_v_existing_ptr);
-      goto __pyx_L6;
-    }
-    __pyx_L6:;
-    goto __pyx_L5;
-  }
-  __pyx_L5:;
-
-  /* "pysam/calignmentfile.pyx":3235
- * 
- *         bam_aux_append(src,
- *                        tag,             # <<<<<<<<<<<<<<
- *                        type_code,
- *                        value_size,
- */
-  __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_tag); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3234
- *                 bam_aux_del(src, existing_ptr)
- * 
- *         bam_aux_append(src,             # <<<<<<<<<<<<<<
- *                        tag,
- *                        type_code,
- */
-  bam_aux_append(__pyx_v_src, __pyx_t_14, __pyx_v_type_code, __pyx_v_value_size, __pyx_v_value_ptr);
-
-  /* "pysam/calignmentfile.pyx":3180
- * 
- * 
- *     cpdef setTag(self, tag, value,             # <<<<<<<<<<<<<<
- *                  value_type = None,
- *                  replace = True):
- */
-
-  /* function exit code */
-  __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("pysam.calignmentfile.AlignedSegment.setTag", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_tag);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21setTag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_20setTag[] = "AlignedSegment.setTag(self, tag, value, value_type=None, replace=True)\n\n        Set optional field of alignment *tag* to *value*.  *value_type* may be specified,\n        but if not the type will be inferred based on the Python type of *value*\n\n        An existing value of the same tag will be overwritten unless\n        *replace* is set to False.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21setTag(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_tag = 0;
-  PyObject *__pyx_v_value = 0;
-  PyObject *__pyx_v_value_type = 0;
-  PyObject *__pyx_v_replace = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setTag (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tag,&__pyx_n_s_value,&__pyx_n_s_value_type,&__pyx_n_s_replace,0};
-    PyObject* values[4] = {0,0,0,0};
-
-    /* "pysam/calignmentfile.pyx":3181
- * 
- *     cpdef setTag(self, tag, value,
- *                  value_type = None,             # <<<<<<<<<<<<<<
- *                  replace = True):
- *         '''
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/calignmentfile.pyx":3182
- *     cpdef setTag(self, tag, value,
- *                  value_type = None,
- *                  replace = True):             # <<<<<<<<<<<<<<
- *         '''
- *         Set optional field of alignment *tag* to *value*.  *value_type* may be specified,
- */
-    values[3] = ((PyObject *)Py_True);
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setTag", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value_type);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_replace);
-          if (value) { values[3] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setTag") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_tag = values[0];
-    __pyx_v_value = values[1];
-    __pyx_v_value_type = values[2];
-    __pyx_v_replace = values[3];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setTag", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.setTag", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20setTag(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), __pyx_v_tag, __pyx_v_value, __pyx_v_value_type, __pyx_v_replace);
-
-  /* "pysam/calignmentfile.pyx":3180
- * 
- * 
- *     cpdef setTag(self, tag, value,             # <<<<<<<<<<<<<<
- *                  value_type = None,
- *                  replace = True):
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_20setTag(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value, PyObject *__pyx_v_value_type, PyObject *__pyx_v_replace) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag __pyx_t_2;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("setTag", 0);
-  __Pyx_TraceCall("setTag", __pyx_f[0], 3180);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2.__pyx_n = 2;
-  __pyx_t_2.value_type = __pyx_v_value_type;
-  __pyx_t_2.replace = __pyx_v_replace;
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self->__pyx_vtab)->setTag(__pyx_v_self, __pyx_v_tag, __pyx_v_value, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.setTag", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3246
- *     #######################################################################
- * 
- *     def opt(self, tag):             # <<<<<<<<<<<<<<
- *         """retrieves optional data given a two-letter *tag*"""
- *         #see bam_aux.c: bam_aux_get() and bam_aux2i() etc
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_23opt(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_22opt[] = "AlignedSegment.opt(self, tag)\nretrieves optional data given a two-letter *tag*";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_23opt(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("opt (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_22opt(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_tag));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_22opt(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_tag) {
-  uint8_t *__pyx_v_v;
-  CYTHON_UNUSED int __pyx_v_nvalues;
-  PyObject *__pyx_v_btag = NULL;
-  PyObject *__pyx_v_auxtype = NULL;
-  CYTHON_UNUSED PyObject *__pyx_v_bytesize = NULL;
-  PyObject *__pyx_v_values = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  char const *__pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  int __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *(*__pyx_t_12)(PyObject *);
-  int __pyx_t_13;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("opt", 0);
-  __Pyx_TraceCall("opt", __pyx_f[0], 3246);
-
-  /* "pysam/calignmentfile.pyx":3251
- *         cdef uint8_t * v
- *         cdef int nvalues
- *         btag = _forceBytes(tag)             # <<<<<<<<<<<<<<
- *         v = bam_aux_get(self._delegate, btag)
- *         if v == NULL: raise KeyError( "tag '%s' not present" % tag )
- */
-  __pyx_t_1 = __pyx_f_5pysam_14calignmentfile__forceBytes(__pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_btag = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":3252
- *         cdef int nvalues
- *         btag = _forceBytes(tag)
- *         v = bam_aux_get(self._delegate, btag)             # <<<<<<<<<<<<<<
- *         if v == NULL: raise KeyError( "tag '%s' not present" % tag )
- *         auxtype = chr(v[0])
- */
-  __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_btag); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_v = bam_aux_get(__pyx_v_self->_delegate, __pyx_t_2);
-
-  /* "pysam/calignmentfile.pyx":3253
- *         btag = _forceBytes(tag)
- *         v = bam_aux_get(self._delegate, btag)
- *         if v == NULL: raise KeyError( "tag '%s' not present" % tag )             # <<<<<<<<<<<<<<
- *         auxtype = chr(v[0])
- *         if auxtype == 'c' or auxtype == 'C' or auxtype == 's' or auxtype == 'S':
- */
-  __pyx_t_3 = ((__pyx_v_v == NULL) != 0);
-  if (__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_tag_s_not_present, __pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":3254
- *         v = bam_aux_get(self._delegate, btag)
- *         if v == NULL: raise KeyError( "tag '%s' not present" % tag )
- *         auxtype = chr(v[0])             # <<<<<<<<<<<<<<
- *         if auxtype == 'c' or auxtype == 'C' or auxtype == 's' or auxtype == 'S':
- *             return <int>bam_aux2i(v)
- */
-  __pyx_t_1 = __Pyx_PyInt_From_uint8_t((__pyx_v_v[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_v_auxtype = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":3255
- *         if v == NULL: raise KeyError( "tag '%s' not present" % tag )
- *         auxtype = chr(v[0])
- *         if auxtype == 'c' or auxtype == 'C' or auxtype == 's' or auxtype == 'S':             # <<<<<<<<<<<<<<
- *             return <int>bam_aux2i(v)
- *         elif auxtype == 'i' or auxtype == 'I':
- */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_3) {
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!__pyx_t_5) {
-      __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_s_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (!__pyx_t_6) {
-        __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_8 = __pyx_t_7;
-      } else {
-        __pyx_t_8 = __pyx_t_6;
-      }
-      __pyx_t_6 = __pyx_t_8;
-    } else {
-      __pyx_t_6 = __pyx_t_5;
-    }
-    __pyx_t_5 = __pyx_t_6;
-  } else {
-    __pyx_t_5 = __pyx_t_3;
-  }
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":3256
- *         auxtype = chr(v[0])
- *         if auxtype == 'c' or auxtype == 'C' or auxtype == 's' or auxtype == 'S':
- *             return <int>bam_aux2i(v)             # <<<<<<<<<<<<<<
- *         elif auxtype == 'i' or auxtype == 'I':
- *             return <int32_t>bam_aux2i(v)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyInt_From_int(((int)bam_aux2i(__pyx_v_v))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3257
- *         if auxtype == 'c' or auxtype == 'C' or auxtype == 's' or auxtype == 'S':
- *             return <int>bam_aux2i(v)
- *         elif auxtype == 'i' or auxtype == 'I':             # <<<<<<<<<<<<<<
- *             return <int32_t>bam_aux2i(v)
- *         elif auxtype == 'f' or auxtype == 'F':
- */
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_i, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_5) {
-    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_I, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = __pyx_t_3;
-  } else {
-    __pyx_t_6 = __pyx_t_5;
-  }
-  if (__pyx_t_6) {
-
-    /* "pysam/calignmentfile.pyx":3258
- *             return <int>bam_aux2i(v)
- *         elif auxtype == 'i' or auxtype == 'I':
- *             return <int32_t>bam_aux2i(v)             # <<<<<<<<<<<<<<
- *         elif auxtype == 'f' or auxtype == 'F':
- *             return <float>bam_aux2f(v)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyInt_From_int32_t(((int32_t)bam_aux2i(__pyx_v_v))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3259
- *         elif auxtype == 'i' or auxtype == 'I':
- *             return <int32_t>bam_aux2i(v)
- *         elif auxtype == 'f' or auxtype == 'F':             # <<<<<<<<<<<<<<
- *             return <float>bam_aux2f(v)
- *         elif auxtype == 'd' or auxtype == 'D':
- */
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_6) {
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_F, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __pyx_t_5;
-  } else {
-    __pyx_t_3 = __pyx_t_6;
-  }
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":3260
- *             return <int32_t>bam_aux2i(v)
- *         elif auxtype == 'f' or auxtype == 'F':
- *             return <float>bam_aux2f(v)             # <<<<<<<<<<<<<<
- *         elif auxtype == 'd' or auxtype == 'D':
- *             return <double>bam_aux2f(v)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = PyFloat_FromDouble(((float)bam_aux2f(__pyx_v_v))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3261
- *         elif auxtype == 'f' or auxtype == 'F':
- *             return <float>bam_aux2f(v)
- *         elif auxtype == 'd' or auxtype == 'D':             # <<<<<<<<<<<<<<
- *             return <double>bam_aux2f(v)
- *         elif auxtype == 'A':
- */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_d, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_3) {
-    __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_D, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __pyx_t_6;
-  } else {
-    __pyx_t_5 = __pyx_t_3;
-  }
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":3262
- *             return <float>bam_aux2f(v)
- *         elif auxtype == 'd' or auxtype == 'D':
- *             return <double>bam_aux2f(v)             # <<<<<<<<<<<<<<
- *         elif auxtype == 'A':
- *             # there might a more efficient way
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = PyFloat_FromDouble(((double)bam_aux2f(__pyx_v_v))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3263
- *         elif auxtype == 'd' or auxtype == 'D':
- *             return <double>bam_aux2f(v)
- *         elif auxtype == 'A':             # <<<<<<<<<<<<<<
- *             # there might a more efficient way
- *             # to convert a char into a string
- */
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_A, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":3266
- *             # there might a more efficient way
- *             # to convert a char into a string
- *             return '%c' % <char>bam_aux2A(v)             # <<<<<<<<<<<<<<
- *         elif auxtype == 'Z':
- *             return _charptr_to_str(<char*>bam_aux2Z(v))
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyInt_From_char(((char)bam_aux2A(__pyx_v_v))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_c_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3267
- *             # to convert a char into a string
- *             return '%c' % <char>bam_aux2A(v)
- *         elif auxtype == 'Z':             # <<<<<<<<<<<<<<
- *             return _charptr_to_str(<char*>bam_aux2Z(v))
- *         elif auxtype == 'B':
- */
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_Z, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":3268
- *             return '%c' % <char>bam_aux2A(v)
- *         elif auxtype == 'Z':
- *             return _charptr_to_str(<char*>bam_aux2Z(v))             # <<<<<<<<<<<<<<
- *         elif auxtype == 'B':
- *             bytesize, nvalues, values = convertBinaryTagToList( v + 1 )
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __pyx_f_5pysam_14calignmentfile__charptr_to_str(((char *)bam_aux2Z(__pyx_v_v))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3269
- *         elif auxtype == 'Z':
- *             return _charptr_to_str(<char*>bam_aux2Z(v))
- *         elif auxtype == 'B':             # <<<<<<<<<<<<<<
- *             bytesize, nvalues, values = convertBinaryTagToList( v + 1 )
- *             return values
- */
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_auxtype, __pyx_n_s_B, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_5) {
-
-    /* "pysam/calignmentfile.pyx":3270
- *             return _charptr_to_str(<char*>bam_aux2Z(v))
- *         elif auxtype == 'B':
- *             bytesize, nvalues, values = convertBinaryTagToList( v + 1 )             # <<<<<<<<<<<<<<
- *             return values
- *         else:
- */
-    __pyx_t_4 = __pyx_f_5pysam_14calignmentfile_convertBinaryTagToList((__pyx_v_v + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-      PyObject* sequence = __pyx_t_4;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 3)) {
-        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
-        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); 
-      } else {
-        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
-        __pyx_t_10 = PyList_GET_ITEM(sequence, 2); 
-      }
-      __Pyx_INCREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_t_10);
-      #else
-      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      #endif
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
-      index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_1);
-      index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_9);
-      index = 2; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_10);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_12 = NULL;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __pyx_t_12 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
-    }
-    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_v_bytesize = __pyx_t_1;
-    __pyx_t_1 = 0;
-    __pyx_v_nvalues = __pyx_t_13;
-    __pyx_v_values = __pyx_t_10;
-    __pyx_t_10 = 0;
-
-    /* "pysam/calignmentfile.pyx":3271
- *         elif auxtype == 'B':
- *             bytesize, nvalues, values = convertBinaryTagToList( v + 1 )
- *             return values             # <<<<<<<<<<<<<<
- *         else:
- *             raise ValueError("unknown auxilliary type '%s'" % auxtype)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_values);
-    __pyx_r = __pyx_v_values;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":3273
- *             return values
- *         else:
- *             raise ValueError("unknown auxilliary type '%s'" % auxtype)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_unknown_auxilliary_type_s, __pyx_v_auxtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":3246
- *     #######################################################################
- * 
- *     def opt(self, tag):             # <<<<<<<<<<<<<<
- *         """retrieves optional data given a two-letter *tag*"""
- *         #see bam_aux.c: bam_aux_get() and bam_aux2i() etc
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.opt", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_btag);
-  __Pyx_XDECREF(__pyx_v_auxtype);
-  __Pyx_XDECREF(__pyx_v_bytesize);
-  __Pyx_XDECREF(__pyx_v_values);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3290
- *     ########################################################
- *     property qname:
- *         def __get__(self): return self.query_name             # <<<<<<<<<<<<<<
- *         def __set__(self, v): self.query_name = v
- *     property tid:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qname_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qname_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qname___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qname___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3290);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qname.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3291
- *     property qname:
- *         def __get__(self): return self.query_name
- *         def __set__(self, v): self.query_name = v             # <<<<<<<<<<<<<<
- *     property tid:
- *         def __get__(self): return self.reference_id
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qname_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qname_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qname_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qname_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3291);
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_name, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qname.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3293
- *         def __set__(self, v): self.query_name = v
- *     property tid:
- *         def __get__(self): return self.reference_id             # <<<<<<<<<<<<<<
- *         def __set__(self, v): self.reference_id = v
- *     property pos:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3tid_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3tid_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3tid___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3tid___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3293);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.tid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3294
- *     property tid:
- *         def __get__(self): return self.reference_id
- *         def __set__(self, v): self.reference_id = v             # <<<<<<<<<<<<<<
- *     property pos:
- *         def __get__(self): return self.reference_start
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3tid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3tid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3tid_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3tid_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3294);
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_id, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.tid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3296
- *         def __set__(self, v): self.reference_id = v
- *     property pos:
- *         def __get__(self): return self.reference_start             # <<<<<<<<<<<<<<
- *         def __set__(self, v): self.reference_start = v
- *     property mapq:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3pos_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3pos___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3pos___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3296);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3297
- *     property pos:
- *         def __get__(self): return self.reference_start
- *         def __set__(self, v): self.reference_start = v             # <<<<<<<<<<<<<<
- *     property mapq:
- *         def __get__(self): return self.mapping_quality
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3pos_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3pos_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3297);
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_start, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3299
- *         def __set__(self, v): self.reference_start = v
- *     property mapq:
- *         def __get__(self): return self.mapping_quality             # <<<<<<<<<<<<<<
- *         def __set__(self, v): self.mapping_quality = v
- *     property rnext:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mapq_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mapq_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mapq___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mapq___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3299);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapping_quality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mapq.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3300
- *     property mapq:
- *         def __get__(self): return self.mapping_quality
- *         def __set__(self, v): self.mapping_quality = v             # <<<<<<<<<<<<<<
- *     property rnext:
- *         def __get__(self): return self.next_reference_id
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mapq_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mapq_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mapq_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mapq_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3300);
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapping_quality, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mapq.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3302
- *         def __set__(self, v): self.mapping_quality = v
- *     property rnext:
- *         def __get__(self): return self.next_reference_id             # <<<<<<<<<<<<<<
- *         def __set__(self, v): self.next_reference_id = v
- *     property pnext:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rnext_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rnext_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rnext___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rnext___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3302);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.rnext.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3303
- *     property rnext:
- *         def __get__(self): return self.next_reference_id
- *         def __set__(self, v): self.next_reference_id = v             # <<<<<<<<<<<<<<
- *     property pnext:
- *         def __get__(self):
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rnext_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rnext_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rnext_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rnext_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3303);
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_id, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.rnext.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3305
- *         def __set__(self, v): self.next_reference_id = v
- *     property pnext:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.next_reference_start
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5pnext_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5pnext_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5pnext___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5pnext___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3305);
-
-  /* "pysam/calignmentfile.pyx":3306
- *     property pnext:
- *         def __get__(self):
- *             return self.next_reference_start             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.next_reference_start = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3305
- *         def __set__(self, v): self.next_reference_id = v
- *     property pnext:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.next_reference_start
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.pnext.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3307
- *         def __get__(self):
- *             return self.next_reference_start
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.next_reference_start = v
- *     property cigar:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5pnext_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5pnext_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5pnext_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5pnext_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3307);
-
-  /* "pysam/calignmentfile.pyx":3308
- *             return self.next_reference_start
- *         def __set__(self, v):
- *             self.next_reference_start = v             # <<<<<<<<<<<<<<
- *     property cigar:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_start, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3307
- *         def __get__(self):
- *             return self.next_reference_start
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.next_reference_start = v
- *     property cigar:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.pnext.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3310
- *             self.next_reference_start = v
- *     property cigar:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             r = self.cigartuples
- *             if r is None:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5cigar_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5cigar_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5cigar___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5cigar___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_v_r = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3310);
-
-  /* "pysam/calignmentfile.pyx":3311
- *     property cigar:
- *         def __get__(self):
- *             r = self.cigartuples             # <<<<<<<<<<<<<<
- *             if r is None:
- *                 r = []
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cigartuples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":3312
- *         def __get__(self):
- *             r = self.cigartuples
- *             if r is None:             # <<<<<<<<<<<<<<
- *                 r = []
- *             return r
- */
-  __pyx_t_2 = (__pyx_v_r == Py_None);
-  __pyx_t_3 = (__pyx_t_2 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":3313
- *             r = self.cigartuples
- *             if r is None:
- *                 r = []             # <<<<<<<<<<<<<<
- *             return r
- *         def __set__(self, v): self.cigartuples = v
- */
-    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":3314
- *             if r is None:
- *                 r = []
- *             return r             # <<<<<<<<<<<<<<
- *         def __set__(self, v): self.cigartuples = v
- *     property tlen:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_r);
-  __pyx_r = __pyx_v_r;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3310
- *             self.next_reference_start = v
- *     property cigar:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             r = self.cigartuples
- *             if r is None:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.cigar.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3315
- *                 r = []
- *             return r
- *         def __set__(self, v): self.cigartuples = v             # <<<<<<<<<<<<<<
- *     property tlen:
- *         def __get__(self):
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5cigar_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5cigar_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5cigar_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5cigar_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3315);
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cigartuples, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.cigar.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3317
- *         def __set__(self, v): self.cigartuples = v
- *     property tlen:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.template_length
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tlen_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tlen_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tlen___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tlen___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3317);
-
-  /* "pysam/calignmentfile.pyx":3318
- *     property tlen:
- *         def __get__(self):
- *             return self.template_length             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.template_length = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_template_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3317
- *         def __set__(self, v): self.cigartuples = v
- *     property tlen:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.template_length
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.tlen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3319
- *         def __get__(self):
- *             return self.template_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.template_length = v
- *     property seq:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tlen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tlen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tlen_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4tlen_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3319);
-
-  /* "pysam/calignmentfile.pyx":3320
- *             return self.template_length
- *         def __set__(self, v):
- *             self.template_length = v             # <<<<<<<<<<<<<<
- *     property seq:
- *         def __get__(self): return self.query_sequence
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_template_length, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3319
- *         def __get__(self):
- *             return self.template_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.template_length = v
- *     property seq:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.tlen.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3322
- *             self.template_length = v
- *     property seq:
- *         def __get__(self): return self.query_sequence             # <<<<<<<<<<<<<<
- *         def __set__(self, v): self.query_sequence = v
- *     property qual:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3seq_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3seq_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3seq___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3seq___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3322);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.seq.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3323
- *     property seq:
- *         def __get__(self): return self.query_sequence
- *         def __set__(self, v): self.query_sequence = v             # <<<<<<<<<<<<<<
- *     property qual:
- *         def __get__(self):
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3seq_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3seq_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3seq_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_3seq_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3323);
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_sequence, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.seq.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3325
- *         def __set__(self, v): self.query_sequence = v
- *     property qual:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return toQualityString(self.query_qualities)
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qual_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qual_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qual___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qual___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3325);
-
-  /* "pysam/calignmentfile.pyx":3326
- *     property qual:
- *         def __get__(self):
- *             return toQualityString(self.query_qualities)             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.query_qualities = fromQualityString(v)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_toQualityString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_qualities); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3325
- *         def __set__(self, v): self.query_sequence = v
- *     property qual:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return toQualityString(self.query_qualities)
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3327
- *         def __get__(self):
- *             return toQualityString(self.query_qualities)
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_qualities = fromQualityString(v)
- *     property alen:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qual_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qual_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __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("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3327);
-
-  /* "pysam/calignmentfile.pyx":3328
- *             return toQualityString(self.query_qualities)
- *         def __set__(self, v):
- *             self.query_qualities = fromQualityString(v)             # <<<<<<<<<<<<<<
- *     property alen:
- *         def __get__(self):
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fromQualityString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __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 = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_v);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_v);
-  __Pyx_GIVEREF(__pyx_v_v);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_qualities, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":3327
- *         def __get__(self):
- *             return toQualityString(self.query_qualities)
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_qualities = fromQualityString(v)
- *     property alen:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qual.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3330
- *             self.query_qualities = fromQualityString(v)
- *     property alen:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_length
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4alen_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4alen_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4alen___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4alen___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3330);
-
-  /* "pysam/calignmentfile.pyx":3331
- *     property alen:
- *         def __get__(self):
- *             return self.reference_length             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.reference_length = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3330
- *             self.query_qualities = fromQualityString(v)
- *     property alen:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_length
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.alen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3332
- *         def __get__(self):
- *             return self.reference_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_length = v
- *     property aend:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4alen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4alen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4alen_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4alen_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3332);
-
-  /* "pysam/calignmentfile.pyx":3333
- *             return self.reference_length
- *         def __set__(self, v):
- *             self.reference_length = v             # <<<<<<<<<<<<<<
- *     property aend:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_length, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3332
- *         def __get__(self):
- *             return self.reference_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_length = v
- *     property aend:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.alen.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3335
- *             self.reference_length = v
- *     property aend:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_end
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4aend_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4aend_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4aend___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4aend___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3335);
-
-  /* "pysam/calignmentfile.pyx":3336
- *     property aend:
- *         def __get__(self):
- *             return self.reference_end             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.reference_end = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3335
- *             self.reference_length = v
- *     property aend:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_end
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.aend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3337
- *         def __get__(self):
- *             return self.reference_end
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_end = v
- *     property rlen:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4aend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4aend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4aend_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4aend_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3337);
-
-  /* "pysam/calignmentfile.pyx":3338
- *             return self.reference_end
- *         def __set__(self, v):
- *             self.reference_end = v             # <<<<<<<<<<<<<<
- *     property rlen:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_end, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3337
- *         def __get__(self):
- *             return self.reference_end
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_end = v
- *     property rlen:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.aend.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3340
- *             self.reference_end = v
- *     property rlen:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_length
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4rlen_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4rlen_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4rlen___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4rlen___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3340);
-
-  /* "pysam/calignmentfile.pyx":3341
- *     property rlen:
- *         def __get__(self):
- *             return self.query_length             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.query_length = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3340
- *             self.reference_end = v
- *     property rlen:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_length
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.rlen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3342
- *         def __get__(self):
- *             return self.query_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_length = v
- *     property query:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4rlen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4rlen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4rlen_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4rlen_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3342);
-
-  /* "pysam/calignmentfile.pyx":3343
- *             return self.query_length
- *         def __set__(self, v):
- *             self.query_length = v             # <<<<<<<<<<<<<<
- *     property query:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_length, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3342
- *         def __get__(self):
- *             return self.query_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_length = v
- *     property query:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.rlen.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3345
- *             self.query_length = v
- *     property query:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_alignment_sequence
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5query_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5query_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5query___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5query___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3345);
-
-  /* "pysam/calignmentfile.pyx":3346
- *     property query:
- *         def __get__(self):
- *             return self.query_alignment_sequence             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.query_alignment_sequence = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3345
- *             self.query_length = v
- *     property query:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_alignment_sequence
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3347
- *         def __get__(self):
- *             return self.query_alignment_sequence
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_sequence = v
- *     property qqual:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5query_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5query_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5query_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5query_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3347);
-
-  /* "pysam/calignmentfile.pyx":3348
- *             return self.query_alignment_sequence
- *         def __set__(self, v):
- *             self.query_alignment_sequence = v             # <<<<<<<<<<<<<<
- *     property qqual:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_sequence, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3347
- *         def __get__(self):
- *             return self.query_alignment_sequence
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_sequence = v
- *     property qqual:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.query.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3350
- *             self.query_alignment_sequence = v
- *     property qqual:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return toQualityString(self.query_alignment_qualities)
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qqual_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qqual_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qqual___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qqual___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3350);
-
-  /* "pysam/calignmentfile.pyx":3351
- *     property qqual:
- *         def __get__(self):
- *             return toQualityString(self.query_alignment_qualities)             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.query_alignment_qualities = fromQualityString(v)
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_toQualityString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_qualities); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3350
- *             self.query_alignment_sequence = v
- *     property qqual:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return toQualityString(self.query_alignment_qualities)
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qqual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3352
- *         def __get__(self):
- *             return toQualityString(self.query_alignment_qualities)
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_qualities = fromQualityString(v)
- *     property qstart:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qqual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qqual_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qqual_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5qqual_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __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("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3352);
-
-  /* "pysam/calignmentfile.pyx":3353
- *             return toQualityString(self.query_alignment_qualities)
- *         def __set__(self, v):
- *             self.query_alignment_qualities = fromQualityString(v)             # <<<<<<<<<<<<<<
- *     property qstart:
- *         def __get__(self):
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fromQualityString); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __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 = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_v);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_v);
-  __Pyx_GIVEREF(__pyx_v_v);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_qualities, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":3352
- *         def __get__(self):
- *             return toQualityString(self.query_alignment_qualities)
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_qualities = fromQualityString(v)
- *     property qstart:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qqual.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3355
- *             self.query_alignment_qualities = fromQualityString(v)
- *     property qstart:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_alignment_start
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6qstart_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6qstart_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6qstart___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6qstart___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3355);
-
-  /* "pysam/calignmentfile.pyx":3356
- *     property qstart:
- *         def __get__(self):
- *             return self.query_alignment_start             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.query_alignment_start = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3355
- *             self.query_alignment_qualities = fromQualityString(v)
- *     property qstart:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_alignment_start
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qstart.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3357
- *         def __get__(self):
- *             return self.query_alignment_start
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_start = v
- *     property qend:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6qstart_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6qstart_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6qstart_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6qstart_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3357);
-
-  /* "pysam/calignmentfile.pyx":3358
- *             return self.query_alignment_start
- *         def __set__(self, v):
- *             self.query_alignment_start = v             # <<<<<<<<<<<<<<
- *     property qend:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_start, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3357
- *         def __get__(self):
- *             return self.query_alignment_start
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_start = v
- *     property qend:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qstart.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3360
- *             self.query_alignment_start = v
- *     property qend:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_alignment_end
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qend_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qend_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qend___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qend___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3360);
-
-  /* "pysam/calignmentfile.pyx":3361
- *     property qend:
- *         def __get__(self):
- *             return self.query_alignment_end             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.query_alignment_end = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3360
- *             self.query_alignment_start = v
- *     property qend:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_alignment_end
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3362
- *         def __get__(self):
- *             return self.query_alignment_end
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_end = v
- *     property qlen:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qend_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qend_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qend_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3362);
-
-  /* "pysam/calignmentfile.pyx":3363
- *             return self.query_alignment_end
- *         def __set__(self, v):
- *             self.query_alignment_end = v             # <<<<<<<<<<<<<<
- *     property qlen:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_end, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3362
- *         def __get__(self):
- *             return self.query_alignment_end
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_end = v
- *     property qlen:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qend.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3365
- *             self.query_alignment_end = v
- *     property qlen:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_alignment_length
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qlen_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qlen_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qlen___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qlen___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3365);
-
-  /* "pysam/calignmentfile.pyx":3366
- *     property qlen:
- *         def __get__(self):
- *             return self.query_alignment_length             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.query_alignment_length = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3365
- *             self.query_alignment_end = v
- *     property qlen:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.query_alignment_length
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qlen.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3367
- *         def __get__(self):
- *             return self.query_alignment_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_length = v
- *     property mrnm:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qlen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qlen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qlen_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4qlen_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3367);
-
-  /* "pysam/calignmentfile.pyx":3368
- *             return self.query_alignment_length
- *         def __set__(self, v):
- *             self.query_alignment_length = v             # <<<<<<<<<<<<<<
- *     property mrnm:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_alignment_length, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3367
- *         def __get__(self):
- *             return self.query_alignment_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.query_alignment_length = v
- *     property mrnm:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.qlen.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3370
- *             self.query_alignment_length = v
- *     property mrnm:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.next_reference_id
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mrnm_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mrnm_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mrnm___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mrnm___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3370);
-
-  /* "pysam/calignmentfile.pyx":3371
- *     property mrnm:
- *         def __get__(self):
- *             return self.next_reference_id             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.next_reference_id = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3370
- *             self.query_alignment_length = v
- *     property mrnm:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.next_reference_id
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mrnm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3372
- *         def __get__(self):
- *             return self.next_reference_id
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.next_reference_id = v
- *     property mpos:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mrnm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mrnm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mrnm_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mrnm_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3372);
-
-  /* "pysam/calignmentfile.pyx":3373
- *             return self.next_reference_id
- *         def __set__(self, v):
- *             self.next_reference_id = v             # <<<<<<<<<<<<<<
- *     property mpos:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_id, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3372
- *         def __get__(self):
- *             return self.next_reference_id
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.next_reference_id = v
- *     property mpos:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mrnm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3375
- *             self.next_reference_id = v
- *     property mpos:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.next_reference_start
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mpos_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mpos_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mpos___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mpos___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3375);
-
-  /* "pysam/calignmentfile.pyx":3376
- *     property mpos:
- *         def __get__(self):
- *             return self.next_reference_start             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.next_reference_start = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3375
- *             self.next_reference_id = v
- *     property mpos:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.next_reference_start
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mpos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3377
- *         def __get__(self):
- *             return self.next_reference_start
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.next_reference_start = v
- *     property rname:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mpos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mpos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mpos_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_4mpos_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3377);
-
-  /* "pysam/calignmentfile.pyx":3378
- *             return self.next_reference_start
- *         def __set__(self, v):
- *             self.next_reference_start = v             # <<<<<<<<<<<<<<
- *     property rname:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next_reference_start, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3377
- *         def __get__(self):
- *             return self.next_reference_start
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.next_reference_start = v
- *     property rname:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.mpos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3380
- *             self.next_reference_start = v
- *     property rname:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_id
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rname_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rname_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rname___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rname___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3380);
-
-  /* "pysam/calignmentfile.pyx":3381
- *     property rname:
- *         def __get__(self):
- *             return self.reference_id             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.reference_id = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3380
- *             self.next_reference_start = v
- *     property rname:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_id
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.rname.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3382
- *         def __get__(self):
- *             return self.reference_id
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_id = v
- *     property isize:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rname_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rname_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rname_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5rname_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3382);
-
-  /* "pysam/calignmentfile.pyx":3383
- *             return self.reference_id
- *         def __set__(self, v):
- *             self.reference_id = v             # <<<<<<<<<<<<<<
- *     property isize:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_id, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3382
- *         def __get__(self):
- *             return self.reference_id
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_id = v
- *     property isize:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.rname.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3385
- *             self.reference_id = v
- *     property isize:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.template_length
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5isize_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5isize_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5isize___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5isize___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3385);
-
-  /* "pysam/calignmentfile.pyx":3386
- *     property isize:
- *         def __get__(self):
- *             return self.template_length             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.template_length = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_template_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3385
- *             self.reference_id = v
- *     property isize:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.template_length
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.isize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3387
- *         def __get__(self):
- *             return self.template_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.template_length = v
- *     property blocks:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5isize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5isize_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5isize_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_5isize_2__set__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3387);
-
-  /* "pysam/calignmentfile.pyx":3388
- *             return self.template_length
- *         def __set__(self, v):
- *             self.template_length = v             # <<<<<<<<<<<<<<
- *     property blocks:
- *         def __get__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_template_length, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3387
- *         def __get__(self):
- *             return self.template_length
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.template_length = v
- *     property blocks:
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.isize.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3390
- *             self.template_length = v
- *     property blocks:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.get_blocks()
- *     property aligned_pairs:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6blocks_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6blocks_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6blocks___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_6blocks___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3390);
-
-  /* "pysam/calignmentfile.pyx":3391
- *     property blocks:
- *         def __get__(self):
- *             return self.get_blocks()             # <<<<<<<<<<<<<<
- *     property aligned_pairs:
- *         def __get__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_blocks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3390
- *             self.template_length = v
- *     property blocks:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.get_blocks()
- *     property aligned_pairs:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.blocks.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3393
- *             return self.get_blocks()
- *     property aligned_pairs:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.get_aligned_pairs()
- *     property inferred_length:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13aligned_pairs_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13aligned_pairs_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_13aligned_pairs___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_13aligned_pairs___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3393);
-
-  /* "pysam/calignmentfile.pyx":3394
- *     property aligned_pairs:
- *         def __get__(self):
- *             return self.get_aligned_pairs()             # <<<<<<<<<<<<<<
- *     property inferred_length:
- *         def __get__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_aligned_pairs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3393
- *             return self.get_blocks()
- *     property aligned_pairs:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.get_aligned_pairs()
- *     property inferred_length:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.aligned_pairs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3396
- *             return self.get_aligned_pairs()
- *     property inferred_length:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.infer_query_length()
- *     property positions:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15inferred_length_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15inferred_length_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15inferred_length___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_15inferred_length___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3396);
-
-  /* "pysam/calignmentfile.pyx":3397
- *     property inferred_length:
- *         def __get__(self):
- *             return self.infer_query_length()             # <<<<<<<<<<<<<<
- *     property positions:
- *         def __get__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_infer_query_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3396
- *             return self.get_aligned_pairs()
- *     property inferred_length:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.infer_query_length()
- *     property positions:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.inferred_length.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3399
- *             return self.infer_query_length()
- *     property positions:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.get_reference_positions()
- *     def overlap(self):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9positions_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9positions_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9positions___get__(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_9positions___get__(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3399);
-
-  /* "pysam/calignmentfile.pyx":3400
- *     property positions:
- *         def __get__(self):
- *             return self.get_reference_positions()             # <<<<<<<<<<<<<<
- *     def overlap(self):
- *         return self.get_overlap()
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_reference_positions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3399
- *             return self.infer_query_length()
- *     property positions:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.get_reference_positions()
- *     def overlap(self):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.positions.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3401
- *         def __get__(self):
- *             return self.get_reference_positions()
- *     def overlap(self):             # <<<<<<<<<<<<<<
- *         return self.get_overlap()
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_25overlap(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_24overlap[] = "AlignedSegment.overlap(self)";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_25overlap(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("overlap (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_14AlignedSegment_24overlap(((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_14AlignedSegment_24overlap(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("overlap", 0);
-  __Pyx_TraceCall("overlap", __pyx_f[0], 3401);
-
-  /* "pysam/calignmentfile.pyx":3402
- *             return self.get_reference_positions()
- *     def overlap(self):
- *         return self.get_overlap()             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_overlap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3401
- *         def __get__(self):
- *             return self.get_reference_positions()
- *     def overlap(self):             # <<<<<<<<<<<<<<
- *         return self.get_overlap()
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.calignmentfile.AlignedSegment.overlap", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3415
- * 
- *     '''
- *     def __init__(self):             # <<<<<<<<<<<<<<
- *         raise TypeError("this class cannot be instantiated from Python")
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
-  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn___init__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn___init__(CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 3415);
-
-  /* "pysam/calignmentfile.pyx":3416
- *     '''
- *     def __init__(self):
- *         raise TypeError("this class cannot be instantiated from Python")             # <<<<<<<<<<<<<<
- * 
- *     def __str__(self):
- */
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3415
- * 
- *     '''
- *     def __init__(self):             # <<<<<<<<<<<<<<
- *         raise TypeError("this class cannot be instantiated from Python")
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3418
- *         raise TypeError("this class cannot be instantiated from Python")
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         return "\t".join(map(str,
- *                               (self.reference_id, self.reference_pos,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_3__str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_3__str__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_2__str__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_2__str__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self) {
-  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("__str__", 0);
-  __Pyx_TraceCall("__str__", __pyx_f[0], 3418);
-
-  /* "pysam/calignmentfile.pyx":3419
- * 
- *     def __str__(self):
- *         return "\t".join(map(str,             # <<<<<<<<<<<<<<
- *                               (self.reference_id, self.reference_pos,
- *                                self.nsegmentes))) +\
- */
-  __Pyx_XDECREF(__pyx_r);
-
-  /* "pysam/calignmentfile.pyx":3420
- *     def __str__(self):
- *         return "\t".join(map(str,
- *                               (self.reference_id, self.reference_pos,             # <<<<<<<<<<<<<<
- *                                self.nsegmentes))) +\
- *             "\n" +\
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-
-  /* "pysam/calignmentfile.pyx":3421
- *         return "\t".join(map(str,
- *                               (self.reference_id, self.reference_pos,
- *                                self.nsegmentes))) +\             # <<<<<<<<<<<<<<
- *             "\n" +\
- *             "\n".join(map(str, self.pileups))
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nsegmentes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-
-  /* "pysam/calignmentfile.pyx":3420
- *     def __str__(self):
- *         return "\t".join(map(str,
- *                               (self.reference_id, self.reference_pos,             # <<<<<<<<<<<<<<
- *                                self.nsegmentes))) +\
- *             "\n" +\
- */
-  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_1 = 0;
-  __pyx_t_2 = 0;
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":3419
- * 
- *     def __str__(self):
- *         return "\t".join(map(str,             # <<<<<<<<<<<<<<
- *                               (self.reference_id, self.reference_pos,
- *                                self.nsegmentes))) +\
- */
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__43, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/calignmentfile.pyx":3421
- *         return "\t".join(map(str,
- *                               (self.reference_id, self.reference_pos,
- *                                self.nsegmentes))) +\             # <<<<<<<<<<<<<<
- *             "\n" +\
- *             "\n".join(map(str, self.pileups))
- */
-  __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__38); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":3423
- *                                self.nsegmentes))) +\
- *             "\n" +\
- *             "\n".join(map(str, self.pileups))             # <<<<<<<<<<<<<<
- * 
- *     property reference_id:
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pileups); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__38, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":3422
- *                               (self.reference_id, self.reference_pos,
- *                                self.nsegmentes))) +\
- *             "\n" +\             # <<<<<<<<<<<<<<
- *             "\n".join(map(str, self.pileups))
- * 
- */
-  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3418
- *         raise TypeError("this class cannot be instantiated from Python")
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         return "\t".join(map(str,
- *                               (self.reference_id, self.reference_pos,
- */
-
-  /* function exit code */
-  __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("pysam.calignmentfile.PileupColumn.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3427
- *     property reference_id:
- *         '''the reference sequence number as defined in the header'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.tid
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_12reference_id_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_12reference_id_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_12reference_id___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_12reference_id___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3427);
-
-  /* "pysam/calignmentfile.pyx":3428
- *         '''the reference sequence number as defined in the header'''
- *         def __get__(self):
- *             return self.tid             # <<<<<<<<<<<<<<
- * 
- *     property nsegments:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3427
- *     property reference_id:
- *         '''the reference sequence number as defined in the header'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.tid
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.reference_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3432
- *     property nsegments:
- *         '''number of reads mapping to this column.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.n_pu
- *         def __set__(self, n):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_9nsegments_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_9nsegments_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_9nsegments___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_9nsegments___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3432);
-
-  /* "pysam/calignmentfile.pyx":3433
- *         '''number of reads mapping to this column.'''
- *         def __get__(self):
- *             return self.n_pu             # <<<<<<<<<<<<<<
- *         def __set__(self, n):
- *             self.n_pu = n
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->n_pu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3432
- *     property nsegments:
- *         '''number of reads mapping to this column.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.n_pu
- *         def __set__(self, n):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.nsegments.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3434
- *         def __get__(self):
- *             return self.n_pu
- *         def __set__(self, n):             # <<<<<<<<<<<<<<
- *             self.n_pu = n
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_9nsegments_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_9nsegments_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_9nsegments_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self), ((PyObject *)__pyx_v_n));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn_9nsegments_2__set__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self, PyObject *__pyx_v_n) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3434);
-
-  /* "pysam/calignmentfile.pyx":3435
- *             return self.n_pu
- *         def __set__(self, n):
- *             self.n_pu = n             # <<<<<<<<<<<<<<
- * 
- *     property reference_pos:
- */
-  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->n_pu = __pyx_t_1;
-
-  /* "pysam/calignmentfile.pyx":3434
- *         def __get__(self):
- *             return self.n_pu
- *         def __set__(self, n):             # <<<<<<<<<<<<<<
- *             self.n_pu = n
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.nsegments.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3439
- *     property reference_pos:
- *         '''the position in the reference sequence (0-based).'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.pos
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_13reference_pos_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_13reference_pos_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_13reference_pos___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_13reference_pos___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3439);
-
-  /* "pysam/calignmentfile.pyx":3440
- *         '''the position in the reference sequence (0-based).'''
- *         def __get__(self):
- *             return self.pos             # <<<<<<<<<<<<<<
- * 
- *     property pileups:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3439
- *     property reference_pos:
- *         '''the position in the reference sequence (0-based).'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.pos
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.reference_pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3444
- *     property pileups:
- *         '''list of reads (:class:`pysam.PileupRead`) aligned to this column'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef int x
- *             pileups = []
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_7pileups_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_7pileups_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_7pileups___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_7pileups___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self) {
-  int __pyx_v_x;
-  PyObject *__pyx_v_pileups = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3444);
-
-  /* "pysam/calignmentfile.pyx":3446
- *         def __get__(self):
- *             cdef int x
- *             pileups = []             # <<<<<<<<<<<<<<
- * 
- *             if self.plp == NULL or self.plp[0] == NULL:
- */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_pileups = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":3448
- *             pileups = []
- * 
- *             if self.plp == NULL or self.plp[0] == NULL:             # <<<<<<<<<<<<<<
- *                 raise ValueError("PileupColumn accessed after iterator finished")
- * 
- */
-  __pyx_t_2 = ((__pyx_v_self->plp == NULL) != 0);
-  if (!__pyx_t_2) {
-    __pyx_t_3 = (((__pyx_v_self->plp[0]) == NULL) != 0);
-    __pyx_t_4 = __pyx_t_3;
-  } else {
-    __pyx_t_4 = __pyx_t_2;
-  }
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":3449
- * 
- *             if self.plp == NULL or self.plp[0] == NULL:
- *                 raise ValueError("PileupColumn accessed after iterator finished")             # <<<<<<<<<<<<<<
- * 
- *             # warning: there could be problems if self.n and self.buf are
- */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":3453
- *             # warning: there could be problems if self.n and self.buf are
- *             # out of sync.
- *             for x from 0 <= x < self.n_pu:             # <<<<<<<<<<<<<<
- *                 pileups.append(makePileupRead(&(self.plp[0][x])))
- *             return pileups
- */
-  __pyx_t_5 = __pyx_v_self->n_pu;
-  for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_5; __pyx_v_x++) {
-
-    /* "pysam/calignmentfile.pyx":3454
- *             # out of sync.
- *             for x from 0 <= x < self.n_pu:
- *                 pileups.append(makePileupRead(&(self.plp[0][x])))             # <<<<<<<<<<<<<<
- *             return pileups
- * 
- */
-    __pyx_t_1 = __pyx_f_5pysam_14calignmentfile_makePileupRead((&((__pyx_v_self->plp[0])[__pyx_v_x]))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_pileups, __pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-
-  /* "pysam/calignmentfile.pyx":3455
- *             for x from 0 <= x < self.n_pu:
- *                 pileups.append(makePileupRead(&(self.plp[0][x])))
- *             return pileups             # <<<<<<<<<<<<<<
- * 
- *     ########################################################
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_pileups);
-  __pyx_r = __pyx_v_pileups;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3444
- *     property pileups:
- *         '''list of reads (:class:`pysam.PileupRead`) aligned to this column'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef int x
- *             pileups = []
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.pileups.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_pileups);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3462
- *     ########################################################
- *     property pos:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_pos
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_3pos_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_3pos___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_3pos___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3462);
-
-  /* "pysam/calignmentfile.pyx":3463
- *     property pos:
- *         def __get__(self):
- *             return self.reference_pos             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.reference_pos = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3462
- *     ########################################################
- *     property pos:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_pos
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3464
- *         def __get__(self):
- *             return self.reference_pos
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_pos = v
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3pos_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_3pos_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn_3pos_2__set__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3464);
-
-  /* "pysam/calignmentfile.pyx":3465
- *             return self.reference_pos
- *         def __set__(self, v):
- *             self.reference_pos = v             # <<<<<<<<<<<<<<
- * 
- *     property tid:
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_pos, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3464
- *         def __get__(self):
- *             return self.reference_pos
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_pos = v
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.pos.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3468
- * 
- *     property tid:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_id
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_3tid_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_3tid_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_3tid___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_3tid___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3468);
-
-  /* "pysam/calignmentfile.pyx":3469
- *     property tid:
- *         def __get__(self):
- *             return self.reference_id             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.reference_id = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3468
- * 
- *     property tid:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.reference_id
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.tid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3470
- *         def __get__(self):
- *             return self.reference_id
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_id = v
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3tid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3tid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_3tid_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn_3tid_2__set__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3470);
-
-  /* "pysam/calignmentfile.pyx":3471
- *             return self.reference_id
- *         def __set__(self, v):
- *             self.reference_id = v             # <<<<<<<<<<<<<<
- * 
- *     property n:
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_id, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3470
- *         def __get__(self):
- *             return self.reference_id
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.reference_id = v
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.tid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3474
- * 
- *     property n:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.nsegments
- *         def __set__(self, v):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_1n_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12PileupColumn_1n_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_1n___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12PileupColumn_1n___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3474);
-
-  /* "pysam/calignmentfile.pyx":3475
- *     property n:
- *         def __get__(self):
- *             return self.nsegments             # <<<<<<<<<<<<<<
- *         def __set__(self, v):
- *             self.nsegments = v
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nsegments); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3474
- * 
- *     property n:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.nsegments
- *         def __set__(self, v):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.n.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3476
- *         def __get__(self):
- *             return self.nsegments
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.nsegments = v
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_1n_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_12PileupColumn_1n_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12PileupColumn_1n_2__set__(((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_v_self), ((PyObject *)__pyx_v_v));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_12PileupColumn_1n_2__set__(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_self, PyObject *__pyx_v_v) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__set__", 0);
-  __Pyx_TraceCall("__set__", __pyx_f[0], 3476);
-
-  /* "pysam/calignmentfile.pyx":3477
- *             return self.nsegments
- *         def __set__(self, v):
- *             self.nsegments = v             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_nsegments, __pyx_v_v) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3476
- *         def __get__(self):
- *             return self.nsegments
- *         def __set__(self, v):             # <<<<<<<<<<<<<<
- *             self.nsegments = v
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupColumn.n.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3486
- *     '''
- * 
- *     def __init__(self):             # <<<<<<<<<<<<<<
- *         raise TypeError("this class cannot be instantiated from Python")
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_10PileupRead_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_10PileupRead_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
-  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead___init__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_10PileupRead___init__(CYTHON_UNUSED struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 3486);
-
-  /* "pysam/calignmentfile.pyx":3487
- * 
- *     def __init__(self):
- *         raise TypeError("this class cannot be instantiated from Python")             # <<<<<<<<<<<<<<
- * 
- *     def __str__(self):
- */
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":3486
- *     '''
- * 
- *     def __init__(self):             # <<<<<<<<<<<<<<
- *         raise TypeError("this class cannot be instantiated from Python")
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3489
- *         raise TypeError("this class cannot be instantiated from Python")
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         return "\t".join(
- *             map(str,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_3__str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_3__str__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_2__str__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_2__str__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__str__", 0);
-  __Pyx_TraceCall("__str__", __pyx_f[0], 3489);
-
-  /* "pysam/calignmentfile.pyx":3490
- * 
- *     def __str__(self):
- *         return "\t".join(             # <<<<<<<<<<<<<<
- *             map(str,
- *                 (self.alignment, self.query_position,
- */
-  __Pyx_XDECREF(__pyx_r);
-
-  /* "pysam/calignmentfile.pyx":3492
- *         return "\t".join(
- *             map(str,
- *                 (self.alignment, self.query_position,             # <<<<<<<<<<<<<<
- *                  self.indel, self.level,
- *                  self.is_del, self.is_head,
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_query_position); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-
-  /* "pysam/calignmentfile.pyx":3493
- *             map(str,
- *                 (self.alignment, self.query_position,
- *                  self.indel, self.level,             # <<<<<<<<<<<<<<
- *                  self.is_del, self.is_head,
- *                  self.is_tail, self.is_refskip)))
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_indel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_level); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-
-  /* "pysam/calignmentfile.pyx":3494
- *                 (self.alignment, self.query_position,
- *                  self.indel, self.level,
- *                  self.is_del, self.is_head,             # <<<<<<<<<<<<<<
- *                  self.is_tail, self.is_refskip)))
- * 
- */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_del); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_head); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-
-  /* "pysam/calignmentfile.pyx":3495
- *                  self.indel, self.level,
- *                  self.is_del, self.is_head,
- *                  self.is_tail, self.is_refskip)))             # <<<<<<<<<<<<<<
- * 
- *     property alignment:
- */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_tail); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_refskip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-
-  /* "pysam/calignmentfile.pyx":3492
- *         return "\t".join(
- *             map(str,
- *                 (self.alignment, self.query_position,             # <<<<<<<<<<<<<<
- *                  self.indel, self.level,
- *                  self.is_del, self.is_head,
- */
-  __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  __pyx_t_1 = 0;
-  __pyx_t_2 = 0;
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_5 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
-
-  /* "pysam/calignmentfile.pyx":3491
- *     def __str__(self):
- *         return "\t".join(
- *             map(str,             # <<<<<<<<<<<<<<
- *                 (self.alignment, self.query_position,
- *                  self.indel, self.level,
- */
-  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_9);
-  __pyx_t_9 = 0;
-  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-  /* "pysam/calignmentfile.pyx":3490
- * 
- *     def __str__(self):
- *         return "\t".join(             # <<<<<<<<<<<<<<
- *             map(str,
- *                 (self.alignment, self.query_position,
- */
-  __pyx_t_8 = __Pyx_PyString_Join(__pyx_kp_s__43, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_r = __pyx_t_8;
-  __pyx_t_8 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3489
- *         raise TypeError("this class cannot be instantiated from Python")
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- *         return "\t".join(
- *             map(str,
- */
-
-  /* function exit code */
-  __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);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3499
- *     property alignment:
- *         """a :class:`pysam.AlignedSegment` object of the aligned read"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._alignment
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_9alignment_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_9alignment_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_9alignment___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_9alignment___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3499);
-
-  /* "pysam/calignmentfile.pyx":3500
- *         """a :class:`pysam.AlignedSegment` object of the aligned read"""
- *         def __get__(self):
- *             return self._alignment             # <<<<<<<<<<<<<<
- * 
- *     property query_position:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self->_alignment));
-  __pyx_r = ((PyObject *)__pyx_v_self->_alignment);
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3499
- *     property alignment:
- *         """a :class:`pysam.AlignedSegment` object of the aligned read"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._alignment
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3504
- *     property query_position:
- *         """position of the read base at the pileup site, 0-based"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._qpos
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_14query_position_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_14query_position_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_14query_position___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_14query_position___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3504);
-
-  /* "pysam/calignmentfile.pyx":3505
- *         """position of the read base at the pileup site, 0-based"""
- *         def __get__(self):
- *             return self._qpos             # <<<<<<<<<<<<<<
- * 
- *     property indel:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_self->_qpos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3504
- *     property query_position:
- *         """position of the read base at the pileup site, 0-based"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._qpos
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.query_position.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3509
- *     property indel:
- *         """indel length; 0 for no indel, positive for ins and negative            for del"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._indel
- *     property level:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_5indel_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_5indel_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_5indel___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_5indel___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3509);
-
-  /* "pysam/calignmentfile.pyx":3510
- *         """indel length; 0 for no indel, positive for ins and negative            for del"""
- *         def __get__(self):
- *             return self._indel             # <<<<<<<<<<<<<<
- *     property level:
- *         """the level of the read in the "viewer" mode"""
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_indel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3509
- *     property indel:
- *         """indel length; 0 for no indel, positive for ins and negative            for del"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._indel
- *     property level:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.indel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3513
- *     property level:
- *         """the level of the read in the "viewer" mode"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._level
- *     property is_del:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_5level_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_5level_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_5level___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_5level___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3513);
-
-  /* "pysam/calignmentfile.pyx":3514
- *         """the level of the read in the "viewer" mode"""
- *         def __get__(self):
- *             return self._level             # <<<<<<<<<<<<<<
- *     property is_del:
- *         """1 iff the base on the padded read is a deletion"""
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3513
- *     property level:
- *         """the level of the read in the "viewer" mode"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._level
- *     property is_del:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.level.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3517
- *     property is_del:
- *         """1 iff the base on the padded read is a deletion"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._is_del
- *     property is_head:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_6is_del_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_6is_del_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_6is_del___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_6is_del___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3517);
-
-  /* "pysam/calignmentfile.pyx":3518
- *         """1 iff the base on the padded read is a deletion"""
- *         def __get__(self):
- *             return self._is_del             # <<<<<<<<<<<<<<
- *     property is_head:
- *         def __get__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->_is_del); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3517
- *     property is_del:
- *         """1 iff the base on the padded read is a deletion"""
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._is_del
- *     property is_head:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.is_del.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3520
- *             return self._is_del
- *     property is_head:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._is_head
- *     property is_tail:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_7is_head_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_7is_head_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_7is_head___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_7is_head___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3520);
-
-  /* "pysam/calignmentfile.pyx":3521
- *     property is_head:
- *         def __get__(self):
- *             return self._is_head             # <<<<<<<<<<<<<<
- *     property is_tail:
- *         def __get__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->_is_head); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3520
- *             return self._is_del
- *     property is_head:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._is_head
- *     property is_tail:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.is_head.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3523
- *             return self._is_head
- *     property is_tail:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._is_tail
- *     property is_refskip:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_7is_tail_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_7is_tail_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_7is_tail___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_7is_tail___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3523);
-
-  /* "pysam/calignmentfile.pyx":3524
- *     property is_tail:
- *         def __get__(self):
- *             return self._is_tail             # <<<<<<<<<<<<<<
- *     property is_refskip:
- *         def __get__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->_is_tail); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3523
- *             return self._is_head
- *     property is_tail:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._is_tail
- *     property is_refskip:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.is_tail.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3526
- *             return self._is_tail
- *     property is_refskip:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._is_refskip
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_10is_refskip_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_10PileupRead_10is_refskip_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_10PileupRead_10is_refskip___get__(((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_10PileupRead_10is_refskip___get__(struct __pyx_obj_5pysam_14calignmentfile_PileupRead *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3526);
-
-  /* "pysam/calignmentfile.pyx":3527
- *     property is_refskip:
- *         def __get__(self):
- *             return self._is_refskip             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_refskip_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3526
- *             return self._is_tail
- *     property is_refskip:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._is_refskip
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.PileupRead.is_refskip.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3543
- *     property tid:
- *         '''the chromosome ID as is defined in the header'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._tid
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_3tid_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_3tid_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall_3tid___get__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_3tid___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3543);
-
-  /* "pysam/calignmentfile.pyx":3544
- *         '''the chromosome ID as is defined in the header'''
- *         def __get__(self):
- *             return self._tid             # <<<<<<<<<<<<<<
- * 
- *     property pos:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3543
- *     property tid:
- *         '''the chromosome ID as is defined in the header'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._tid
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.tid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3548
- *     property pos:
- *        '''nucleotide position of SNP.'''
- *        def __get__(self): return self._pos             # <<<<<<<<<<<<<<
- * 
- *     property reference_base:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_3pos_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall_3pos___get__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_3pos___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3548);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3552
- *     property reference_base:
- *        '''reference base at pos. ``N`` if no reference sequence supplied.'''
- *        def __get__(self): return from_string_and_size( &self._reference_base, 1 )             # <<<<<<<<<<<<<<
- * 
- *     property genotype:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_14reference_base_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_14reference_base_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall_14reference_base___get__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_14reference_base___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3552);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_5pysam_14calignmentfile_from_string_and_size((&__pyx_v_self->_reference_base), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.reference_base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3556
- *     property genotype:
- *        '''the genotype called.'''
- *        def __get__(self): return from_string_and_size( &self._genotype, 1 )             # <<<<<<<<<<<<<<
- * 
- *     property consensus_quality:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_8genotype_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_8genotype_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall_8genotype___get__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_8genotype___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3556);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_5pysam_14calignmentfile_from_string_and_size((&__pyx_v_self->_genotype), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.genotype.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3560
- *     property consensus_quality:
- *        '''the genotype quality (Phred-scaled).'''
- *        def __get__(self): return self._consensus_quality             # <<<<<<<<<<<<<<
- * 
- *     property snp_quality:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_17consensus_quality_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_17consensus_quality_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall_17consensus_quality___get__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_17consensus_quality___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3560);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_consensus_quality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.consensus_quality.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3565
- *        '''the snp quality (Phred scaled) - probability of consensus being
- *        identical to reference sequence.'''
- *        def __get__(self): return self._snp_quality             # <<<<<<<<<<<<<<
- * 
- *     property mapping_quality:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_11snp_quality_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_11snp_quality_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall_11snp_quality___get__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_11snp_quality___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3565);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_snp_quality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.snp_quality.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3570
- *        '''the root mean square (rms) of the mapping quality of all reads
- *        involved in the call.'''
- *        def __get__(self): return self._rms_mapping_quality             # <<<<<<<<<<<<<<
- * 
- *     property coverage:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_15mapping_quality_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_15mapping_quality_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall_15mapping_quality___get__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_15mapping_quality___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3570);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_rms_mapping_quality); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.mapping_quality.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3574
- *     property coverage:
- *        '''coverage or read depth - the number of reads involved in the call.'''
- *        def __get__(self): return self._coverage             # <<<<<<<<<<<<<<
- * 
- *     def __str__(self):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_8coverage_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_8coverage_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall_8coverage___get__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall_8coverage___get__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 3574);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_coverage); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.coverage.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3576
- *        def __get__(self): return self._coverage
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- * 
- *         return "\t".join( map(str, (
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_1__str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_14calignmentfile_7SNPCall_1__str__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_7SNPCall___str__(((struct __pyx_obj_5pysam_14calignmentfile_SNPCall *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_7SNPCall___str__(struct __pyx_obj_5pysam_14calignmentfile_SNPCall *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__str__", 0);
-  __Pyx_TraceCall("__str__", __pyx_f[0], 3576);
-
-  /* "pysam/calignmentfile.pyx":3578
- *     def __str__(self):
- * 
- *         return "\t".join( map(str, (             # <<<<<<<<<<<<<<
- *                     self.tid,
- *                     self.pos,
- */
-  __Pyx_XDECREF(__pyx_r);
-
-  /* "pysam/calignmentfile.pyx":3579
- * 
- *         return "\t".join( map(str, (
- *                     self.tid,             # <<<<<<<<<<<<<<
- *                     self.pos,
- *                     self.reference_base,
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/calignmentfile.pyx":3580
- *         return "\t".join( map(str, (
- *                     self.tid,
- *                     self.pos,             # <<<<<<<<<<<<<<
- *                     self.reference_base,
- *                     self.genotype,
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-
-  /* "pysam/calignmentfile.pyx":3581
- *                     self.tid,
- *                     self.pos,
- *                     self.reference_base,             # <<<<<<<<<<<<<<
- *                     self.genotype,
- *                     self.consensus_quality,
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reference_base); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-
-  /* "pysam/calignmentfile.pyx":3582
- *                     self.pos,
- *                     self.reference_base,
- *                     self.genotype,             # <<<<<<<<<<<<<<
- *                     self.consensus_quality,
- *                     self.snp_quality,
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_genotype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-
-  /* "pysam/calignmentfile.pyx":3583
- *                     self.reference_base,
- *                     self.genotype,
- *                     self.consensus_quality,             # <<<<<<<<<<<<<<
- *                     self.snp_quality,
- *                     self.mapping_quality,
- */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_consensus_quality); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-
-  /* "pysam/calignmentfile.pyx":3584
- *                     self.genotype,
- *                     self.consensus_quality,
- *                     self.snp_quality,             # <<<<<<<<<<<<<<
- *                     self.mapping_quality,
- *                     self.coverage ) ) )
- */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_snp_quality); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-
-  /* "pysam/calignmentfile.pyx":3585
- *                     self.consensus_quality,
- *                     self.snp_quality,
- *                     self.mapping_quality,             # <<<<<<<<<<<<<<
- *                     self.coverage ) ) )
- * 
- */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mapping_quality); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-
-  /* "pysam/calignmentfile.pyx":3586
- *                     self.snp_quality,
- *                     self.mapping_quality,
- *                     self.coverage ) ) )             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_coverage); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-
-  /* "pysam/calignmentfile.pyx":3579
- * 
- *         return "\t".join( map(str, (
- *                     self.tid,             # <<<<<<<<<<<<<<
- *                     self.pos,
- *                     self.reference_base,
- */
-  __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  __pyx_t_1 = 0;
-  __pyx_t_2 = 0;
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_5 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
-
-  /* "pysam/calignmentfile.pyx":3578
- *     def __str__(self):
- * 
- *         return "\t".join( map(str, (             # <<<<<<<<<<<<<<
- *                     self.tid,
- *                     self.pos,
- */
-  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_9);
-  __pyx_t_9 = 0;
-  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyString_Join(__pyx_kp_s__43, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_r = __pyx_t_8;
-  __pyx_t_8 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/calignmentfile.pyx":3576
- *        def __get__(self): return self._coverage
- * 
- *     def __str__(self):             # <<<<<<<<<<<<<<
- * 
- *         return "\t".join( map(str, (
- */
-
-  /* function exit code */
-  __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);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("pysam.calignmentfile.SNPCall.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3599
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, int multiple_iterators=True):             # <<<<<<<<<<<<<<
- * 
- *         # makes sure that samfile stays alive as long as this
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_14calignmentfile_12IndexedReads_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_14calignmentfile_12IndexedReads_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile = 0;
-  int __pyx_v_multiple_iterators;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_samfile,&__pyx_n_s_multiple_iterators,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __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_samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)values[0]);
-    if (values[1]) {
-      __pyx_v_multiple_iterators = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_multiple_iterators == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_multiple_iterators = ((int)1);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.IndexedReads.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_14calignmentfile_AlignmentFile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12IndexedReads___init__(((struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *)__pyx_v_self), __pyx_v_samfile, __pyx_v_multiple_iterators);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_14calignmentfile_12IndexedReads___init__(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *__pyx_v_self, struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *__pyx_v_samfile, int __pyx_v_multiple_iterators) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  char const *__pyx_t_2;
-  htsFile *__pyx_t_3;
-  bam_hdr_t *__pyx_t_4;
-  BGZF *__pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 3599);
-
-  /* "pysam/calignmentfile.pyx":3603
- *         # makes sure that samfile stays alive as long as this
- *         # object is alive.
- *         self.samfile = samfile             # <<<<<<<<<<<<<<
- * 
- *         assert samfile.isbam, "can only IndexReads on bam files"
- */
-  __Pyx_INCREF(((PyObject *)__pyx_v_samfile));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_samfile));
-  __Pyx_GOTREF(__pyx_v_self->samfile);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->samfile));
-  __pyx_v_self->samfile = __pyx_v_samfile;
-
-  /* "pysam/calignmentfile.pyx":3605
- *         self.samfile = samfile
- * 
- *         assert samfile.isbam, "can only IndexReads on bam files"             # <<<<<<<<<<<<<<
- * 
- *         # multiple_iterators the file - note that this makes the iterator
- */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    if (unlikely(!(__pyx_v_samfile->isbam != 0))) {
-      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_can_only_IndexReads_on_bam_files);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-
-  /* "pysam/calignmentfile.pyx":3609
- *         # multiple_iterators the file - note that this makes the iterator
- *         # slow and causes pileup to slow down significantly.
- *         if multiple_iterators:             # <<<<<<<<<<<<<<
- *             self.htsfile = hts_open(samfile._filename, 'r')
- *             assert self.htsfile != NULL
- */
-  __pyx_t_1 = (__pyx_v_multiple_iterators != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":3610
- *         # slow and causes pileup to slow down significantly.
- *         if multiple_iterators:
- *             self.htsfile = hts_open(samfile._filename, 'r')             # <<<<<<<<<<<<<<
- *             assert self.htsfile != NULL
- *             # read header - required for accurate positioning
- */
-    __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_samfile->_filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_self->htsfile = hts_open(__pyx_t_2, __pyx_k_r);
-
-    /* "pysam/calignmentfile.pyx":3611
- *         if multiple_iterators:
- *             self.htsfile = hts_open(samfile._filename, 'r')
- *             assert self.htsfile != NULL             # <<<<<<<<<<<<<<
- *             # read header - required for accurate positioning
- *             self.header = sam_hdr_read(self.htsfile)
- */
-    #ifndef CYTHON_WITHOUT_ASSERTIONS
-    if (unlikely(!Py_OptimizeFlag)) {
-      if (unlikely(!((__pyx_v_self->htsfile != NULL) != 0))) {
-        PyErr_SetNone(PyExc_AssertionError);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-    }
-    #endif
-
-    /* "pysam/calignmentfile.pyx":3613
- *             assert self.htsfile != NULL
- *             # read header - required for accurate positioning
- *             self.header = sam_hdr_read(self.htsfile)             # <<<<<<<<<<<<<<
- *             self.owns_samfile = True
- *         else:
- */
-    __pyx_v_self->header = sam_hdr_read(__pyx_v_self->htsfile);
-
-    /* "pysam/calignmentfile.pyx":3614
- *             # read header - required for accurate positioning
- *             self.header = sam_hdr_read(self.htsfile)
- *             self.owns_samfile = True             # <<<<<<<<<<<<<<
- *         else:
- *             self.htsfile = self.samfile.htsfile
- */
-    __pyx_v_self->owns_samfile = 1;
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":3616
- *             self.owns_samfile = True
- *         else:
- *             self.htsfile = self.samfile.htsfile             # <<<<<<<<<<<<<<
- *             self.header = self.samfile.header
- *             self.owns_samfile = False
- */
-    __pyx_t_3 = __pyx_v_self->samfile->htsfile;
-    __pyx_v_self->htsfile = __pyx_t_3;
-
-    /* "pysam/calignmentfile.pyx":3617
- *         else:
- *             self.htsfile = self.samfile.htsfile
- *             self.header = self.samfile.header             # <<<<<<<<<<<<<<
- *             self.owns_samfile = False
- * 
- */
-    __pyx_t_4 = __pyx_v_self->samfile->header;
-    __pyx_v_self->header = __pyx_t_4;
-
-    /* "pysam/calignmentfile.pyx":3618
- *             self.htsfile = self.samfile.htsfile
- *             self.header = self.samfile.header
- *             self.owns_samfile = False             # <<<<<<<<<<<<<<
- * 
- *         # TODO: BAM file specific
- */
-    __pyx_v_self->owns_samfile = 0;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":3621
- * 
- *         # TODO: BAM file specific
- *         self.fp = self.htsfile.fp.bgzf             # <<<<<<<<<<<<<<
- * 
- *     def build(self):
- */
-  __pyx_t_5 = __pyx_v_self->htsfile->fp.bgzf;
-  __pyx_v_self->fp = __pyx_t_5;
-
-  /* "pysam/calignmentfile.pyx":3599
- *     """
- * 
- *     def __init__(self, AlignmentFile samfile, int multiple_iterators=True):             # <<<<<<<<<<<<<<
- * 
- *         # makes sure that samfile stays alive as long as this
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.calignmentfile.IndexedReads.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3623
- *         self.fp = self.htsfile.fp.bgzf
- * 
- *     def build(self):             # <<<<<<<<<<<<<<
- *         '''build index.'''
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12IndexedReads_3build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_12IndexedReads_2build[] = "IndexedReads.build(self)\nbuild index.";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12IndexedReads_3build(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("build (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12IndexedReads_2build(((struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12IndexedReads_2build(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *__pyx_v_self) {
-  int __pyx_v_ret;
-  bam1_t *__pyx_v_b;
-  uint64_t __pyx_v_pos;
-  PyObject *__pyx_v_qname = 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;
-  int __pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("build", 0);
-  __Pyx_TraceCall("build", __pyx_f[0], 3623);
-
-  /* "pysam/calignmentfile.pyx":3626
- *         '''build index.'''
- * 
- *         self.index = collections.defaultdict(list)             # <<<<<<<<<<<<<<
- * 
- *         # this method will start indexing from the current file position
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __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 = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyList_Type))));
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyList_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyList_Type))));
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GIVEREF(__pyx_t_3);
-  __Pyx_GOTREF(__pyx_v_self->index);
-  __Pyx_DECREF(__pyx_v_self->index);
-  __pyx_v_self->index = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/calignmentfile.pyx":3630
- *         # this method will start indexing from the current file position
- *         # if you decide
- *         cdef int ret = 1             # <<<<<<<<<<<<<<
- *         cdef bam1_t * b = <bam1_t*>calloc(1, sizeof( bam1_t))
- * 
- */
-  __pyx_v_ret = 1;
-
-  /* "pysam/calignmentfile.pyx":3631
- *         # if you decide
- *         cdef int ret = 1
- *         cdef bam1_t * b = <bam1_t*>calloc(1, sizeof( bam1_t))             # <<<<<<<<<<<<<<
- * 
- *         cdef uint64_t pos
- */
-  __pyx_v_b = ((bam1_t *)calloc(1, (sizeof(bam1_t))));
-
-  /* "pysam/calignmentfile.pyx":3635
- *         cdef uint64_t pos
- * 
- *         while ret > 0:             # <<<<<<<<<<<<<<
- *             pos = bgzf_tell(self.fp)
- *             ret = sam_read1(self.htsfile,
- */
-  while (1) {
-    __pyx_t_4 = ((__pyx_v_ret > 0) != 0);
-    if (!__pyx_t_4) break;
-
-    /* "pysam/calignmentfile.pyx":3636
- * 
- *         while ret > 0:
- *             pos = bgzf_tell(self.fp)             # <<<<<<<<<<<<<<
- *             ret = sam_read1(self.htsfile,
- *                             self.samfile.header,
- */
-    __pyx_v_pos = bgzf_tell(__pyx_v_self->fp);
-
-    /* "pysam/calignmentfile.pyx":3637
- *         while ret > 0:
- *             pos = bgzf_tell(self.fp)
- *             ret = sam_read1(self.htsfile,             # <<<<<<<<<<<<<<
- *                             self.samfile.header,
- *                             b)
- */
-    __pyx_v_ret = sam_read1(__pyx_v_self->htsfile, __pyx_v_self->samfile->header, __pyx_v_b);
-
-    /* "pysam/calignmentfile.pyx":3640
- *                             self.samfile.header,
- *                             b)
- *             if ret > 0:             # <<<<<<<<<<<<<<
- *                 qname = _charptr_to_str(pysam_bam_get_qname(b))
- *                 self.index[qname].append(pos)
- */
-    __pyx_t_4 = ((__pyx_v_ret > 0) != 0);
-    if (__pyx_t_4) {
-
-      /* "pysam/calignmentfile.pyx":3641
- *                             b)
- *             if ret > 0:
- *                 qname = _charptr_to_str(pysam_bam_get_qname(b))             # <<<<<<<<<<<<<<
- *                 self.index[qname].append(pos)
- * 
- */
-      __pyx_t_3 = __pyx_f_5pysam_14calignmentfile__charptr_to_str(pysam_bam_get_qname(__pyx_v_b)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_XDECREF_SET(__pyx_v_qname, __pyx_t_3);
-      __pyx_t_3 = 0;
-
-      /* "pysam/calignmentfile.pyx":3642
- *             if ret > 0:
- *                 qname = _charptr_to_str(pysam_bam_get_qname(b))
- *                 self.index[qname].append(pos)             # <<<<<<<<<<<<<<
- * 
- *         bam_destroy1(b)
- */
-      __pyx_t_3 = PyObject_GetItem(__pyx_v_self->index, __pyx_v_qname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L5;
-    }
-    __pyx_L5:;
-  }
-
-  /* "pysam/calignmentfile.pyx":3644
- *                 self.index[qname].append(pos)
- * 
- *         bam_destroy1(b)             # <<<<<<<<<<<<<<
- * 
- *     def find(self, query_name):
- */
-  bam_destroy1(__pyx_v_b);
-
-  /* "pysam/calignmentfile.pyx":3623
- *         self.fp = self.htsfile.fp.bgzf
- * 
- *     def build(self):             # <<<<<<<<<<<<<<
- *         '''build index.'''
- * 
- */
-
-  /* function exit code */
-  __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("pysam.calignmentfile.IndexedReads.build", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_qname);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3646
- *         bam_destroy1(b)
- * 
- *     def find(self, query_name):             # <<<<<<<<<<<<<<
- *         '''find *query_name* in index.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12IndexedReads_5find(PyObject *__pyx_v_self, PyObject *__pyx_v_query_name); /*proto*/
-static char __pyx_doc_5pysam_14calignmentfile_12IndexedReads_4find[] = "IndexedReads.find(self, query_name)\nfind *query_name* in index.\n\n        Returns an iterator over all reads with query_name.\n\n        Raise a KeyError if the *query_name* is not in the index.\n        ";
-static PyObject *__pyx_pw_5pysam_14calignmentfile_12IndexedReads_5find(PyObject *__pyx_v_self, PyObject *__pyx_v_query_name) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("find (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_14calignmentfile_12IndexedReads_4find(((struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *)__pyx_v_self), ((PyObject *)__pyx_v_query_name));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_14calignmentfile_12IndexedReads_4find(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *__pyx_v_self, PyObject *__pyx_v_query_name) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("find", 0);
-  __Pyx_TraceCall("find", __pyx_f[0], 3646);
-
-  /* "pysam/calignmentfile.pyx":3653
- *         Raise a KeyError if the *query_name* is not in the index.
- *         '''
- *         if query_name in self.index:             # <<<<<<<<<<<<<<
- *             return IteratorRowSelection(
- *                 self.samfile,
- */
-  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_query_name, __pyx_v_self->index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/calignmentfile.pyx":3654
- *         '''
- *         if query_name in self.index:
- *             return IteratorRowSelection(             # <<<<<<<<<<<<<<
- *                 self.samfile,
- *                 self.index[query_name],
- */
-    __Pyx_XDECREF(__pyx_r);
-
-    /* "pysam/calignmentfile.pyx":3656
- *             return IteratorRowSelection(
- *                 self.samfile,
- *                 self.index[query_name],             # <<<<<<<<<<<<<<
- *                 multiple_iterators = False)
- *         else:
- */
-    __pyx_t_3 = PyObject_GetItem(__pyx_v_self->index, __pyx_v_query_name); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3656; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_3);
-
-    /* "pysam/calignmentfile.pyx":3654
- *         '''
- *         if query_name in self.index:
- *             return IteratorRowSelection(             # <<<<<<<<<<<<<<
- *                 self.samfile,
- *                 self.index[query_name],
- */
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(((PyObject *)__pyx_v_self->samfile));
-    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->samfile));
-    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->samfile));
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-
-    /* "pysam/calignmentfile.pyx":3657
- *                 self.samfile,
- *                 self.index[query_name],
- *                 multiple_iterators = False)             # <<<<<<<<<<<<<<
- *         else:
- *             raise KeyError("read %s not found" % query_name)
- */
-    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_multiple_iterators, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/calignmentfile.pyx":3654
- *         '''
- *         if query_name in self.index:
- *             return IteratorRowSelection(             # <<<<<<<<<<<<<<
- *                 self.samfile,
- *                 self.index[query_name],
- */
-    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection)), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_5;
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":3659
- *                 multiple_iterators = False)
- *         else:
- *             raise KeyError("read %s not found" % query_name)             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_read_s_not_found, __pyx_v_query_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/calignmentfile.pyx":3646
- *         bam_destroy1(b)
- * 
- *     def find(self, query_name):             # <<<<<<<<<<<<<<
- *         '''find *query_name* in index.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.calignmentfile.IndexedReads.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/calignmentfile.pyx":3661
- *             raise KeyError("read %s not found" % query_name)
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         if self.owns_samfile:
- *             hts_close(self.htsfile)
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_14calignmentfile_12IndexedReads_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_14calignmentfile_12IndexedReads_7__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_14calignmentfile_12IndexedReads_6__dealloc__(((struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_14calignmentfile_12IndexedReads_6__dealloc__(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 3661);
-
-  /* "pysam/calignmentfile.pyx":3662
- * 
- *     def __dealloc__(self):
- *         if self.owns_samfile:             # <<<<<<<<<<<<<<
- *             hts_close(self.htsfile)
- *             bam_hdr_destroy(self.header)
- */
-  __pyx_t_1 = (__pyx_v_self->owns_samfile != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/calignmentfile.pyx":3663
- *     def __dealloc__(self):
- *         if self.owns_samfile:
- *             hts_close(self.htsfile)             # <<<<<<<<<<<<<<
- *             bam_hdr_destroy(self.header)
- * 
- */
-    hts_close(__pyx_v_self->htsfile);
-
-    /* "pysam/calignmentfile.pyx":3664
- *         if self.owns_samfile:
- *             hts_close(self.htsfile)
- *             bam_hdr_destroy(self.header)             # <<<<<<<<<<<<<<
- * 
- * __all__ = ["AlignmentFile",
- */
-    bam_hdr_destroy(__pyx_v_self->header);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":3661
- *             raise KeyError("read %s not found" % query_name)
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         if self.owns_samfile:
- *             hts_close(self.htsfile)
- */
-
-  /* function exit code */
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "array.pxd":91
- *             __data_union data
- * 
- *         def __getbuffer__(self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
-/* Python wrapper */
-static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
-  PyObject *__pyx_v_item_count = NULL;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  char *__pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  Py_ssize_t __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__getbuffer__", 0);
-  if (__pyx_v_info != NULL) {
-    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
-    __Pyx_GIVEREF(__pyx_v_info->obj);
-  }
-  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 91);
-
-  /* "array.pxd":96
- *             # In particular strided access is always provided regardless
- *             # of flags
- *             item_count = Py_SIZE(self)             # <<<<<<<<<<<<<<
- * 
- *             info.suboffsets = NULL
- */
-  __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_item_count = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "array.pxd":98
- *             item_count = Py_SIZE(self)
- * 
- *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
- *             info.buf = self.data.as_chars
- *             info.readonly = 0
- */
-  __pyx_v_info->suboffsets = NULL;
-
-  /* "array.pxd":99
- * 
- *             info.suboffsets = NULL
- *             info.buf = self.data.as_chars             # <<<<<<<<<<<<<<
- *             info.readonly = 0
- *             info.ndim = 1
- */
-  __pyx_t_2 = __pyx_v_self->data.as_chars;
-  __pyx_v_info->buf = __pyx_t_2;
-
-  /* "array.pxd":100
- *             info.suboffsets = NULL
- *             info.buf = self.data.as_chars
- *             info.readonly = 0             # <<<<<<<<<<<<<<
- *             info.ndim = 1
- *             info.itemsize = self.ob_descr.itemsize   # e.g. sizeof(float)
- */
-  __pyx_v_info->readonly = 0;
-
-  /* "array.pxd":101
- *             info.buf = self.data.as_chars
- *             info.readonly = 0
- *             info.ndim = 1             # <<<<<<<<<<<<<<
- *             info.itemsize = self.ob_descr.itemsize   # e.g. sizeof(float)
- *             info.len = info.itemsize * item_count
- */
-  __pyx_v_info->ndim = 1;
-
-  /* "array.pxd":102
- *             info.readonly = 0
- *             info.ndim = 1
- *             info.itemsize = self.ob_descr.itemsize   # e.g. sizeof(float)             # <<<<<<<<<<<<<<
- *             info.len = info.itemsize * item_count
- * 
- */
-  __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
-  __pyx_v_info->itemsize = __pyx_t_3;
-
-  /* "array.pxd":103
- *             info.ndim = 1
- *             info.itemsize = self.ob_descr.itemsize   # e.g. sizeof(float)
- *             info.len = info.itemsize * item_count             # <<<<<<<<<<<<<<
- * 
- *             info.shape = <Py_ssize_t*> PyMem_Malloc(sizeof(Py_ssize_t) + 2)
- */
-  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_v_info->len = __pyx_t_5;
-
-  /* "array.pxd":105
- *             info.len = info.itemsize * item_count
- * 
- *             info.shape = <Py_ssize_t*> PyMem_Malloc(sizeof(Py_ssize_t) + 2)             # <<<<<<<<<<<<<<
- *             if not info.shape:
- *                 raise MemoryError()
- */
-  __pyx_v_info->shape = ((Py_ssize_t *)PyMem_Malloc(((sizeof(Py_ssize_t)) + 2)));
-
-  /* "array.pxd":106
- * 
- *             info.shape = <Py_ssize_t*> PyMem_Malloc(sizeof(Py_ssize_t) + 2)
- *             if not info.shape:             # <<<<<<<<<<<<<<
- *                 raise MemoryError()
- *             info.shape[0] = item_count      # constant regardless of resizing
- */
-  __pyx_t_6 = ((!(__pyx_v_info->shape != 0)) != 0);
-  if (__pyx_t_6) {
-
-    /* "array.pxd":107
- *             info.shape = <Py_ssize_t*> PyMem_Malloc(sizeof(Py_ssize_t) + 2)
- *             if not info.shape:
- *                 raise MemoryError()             # <<<<<<<<<<<<<<
- *             info.shape[0] = item_count      # constant regardless of resizing
- *             info.strides = &info.itemsize
- */
-    PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "array.pxd":108
- *             if not info.shape:
- *                 raise MemoryError()
- *             info.shape[0] = item_count      # constant regardless of resizing             # <<<<<<<<<<<<<<
- *             info.strides = &info.itemsize
- * 
- */
-  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  (__pyx_v_info->shape[0]) = __pyx_t_5;
-
-  /* "array.pxd":109
- *                 raise MemoryError()
- *             info.shape[0] = item_count      # constant regardless of resizing
- *             info.strides = &info.itemsize             # <<<<<<<<<<<<<<
- * 
- *             info.format = <char*> (info.shape + 1)
- */
-  __pyx_v_info->strides = (&__pyx_v_info->itemsize);
-
-  /* "array.pxd":111
- *             info.strides = &info.itemsize
- * 
- *             info.format = <char*> (info.shape + 1)             # <<<<<<<<<<<<<<
- *             info.format[0] = self.ob_descr.typecode
- *             info.format[1] = 0
- */
-  __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
-
-  /* "array.pxd":112
- * 
- *             info.format = <char*> (info.shape + 1)
- *             info.format[0] = self.ob_descr.typecode             # <<<<<<<<<<<<<<
- *             info.format[1] = 0
- *             info.obj = self
- */
-  __pyx_t_3 = __pyx_v_self->ob_descr->typecode;
-  (__pyx_v_info->format[0]) = __pyx_t_3;
-
-  /* "array.pxd":113
- *             info.format = <char*> (info.shape + 1)
- *             info.format[0] = self.ob_descr.typecode
- *             info.format[1] = 0             # <<<<<<<<<<<<<<
- *             info.obj = self
- * 
- */
-  (__pyx_v_info->format[1]) = 0;
-
-  /* "array.pxd":114
- *             info.format[0] = self.ob_descr.typecode
- *             info.format[1] = 0
- *             info.obj = self             # <<<<<<<<<<<<<<
- * 
- *         def __releasebuffer__(self, Py_buffer* info):
- */
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __Pyx_GOTREF(__pyx_v_info->obj);
-  __Pyx_DECREF(__pyx_v_info->obj);
-  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
-
-  /* "array.pxd":91
- *             __data_union data
- * 
- *         def __getbuffer__(self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
- *             # This implementation of getbuffer is geared towards Cython
- *             # requirements, and does not yet fullfill the PEP.
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
-    __Pyx_GOTREF(__pyx_v_info->obj);
-    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
-  }
-  goto __pyx_L2;
-  __pyx_L0:;
-  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
-    __Pyx_GOTREF(Py_None);
-    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
-  }
-  __pyx_L2:;
-  __Pyx_XDECREF(__pyx_v_item_count);
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "array.pxd":116
- *             info.obj = self
- * 
- *         def __releasebuffer__(self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             PyMem_Free(info.shape)
- * 
- */
-
-/* Python wrapper */
-static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
-static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
-  __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
-  __Pyx_TraceCall("__releasebuffer__", __pyx_f[1], 116);
-
-  /* "array.pxd":117
- * 
- *         def __releasebuffer__(self, Py_buffer* info):
- *             PyMem_Free(info.shape)             # <<<<<<<<<<<<<<
- * 
- *     array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
- */
-  PyMem_Free(__pyx_v_info->shape);
-
-  /* "array.pxd":116
- *             info.obj = self
- * 
- *         def __releasebuffer__(self, Py_buffer* info):             # <<<<<<<<<<<<<<
- *             PyMem_Free(info.shape)
- * 
- */
-
-  /* function exit code */
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "array.pxd":128
- * 
- * 
- * cdef inline array clone(array template, Py_ssize_t length, bint zero):             # <<<<<<<<<<<<<<
- *     """ fast creation of a new array, given a template array.
- *     type will be same as template.
- */
-
-static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
-  arrayobject *__pyx_v_op = NULL;
-  arrayobject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("clone", 0);
-  __Pyx_TraceCall("clone", __pyx_f[1], 128);
-
-  /* "array.pxd":132
- *     type will be same as template.
- *     if zero is true, new array will be initialized with zeroes."""
- *     op = newarrayobject(Py_TYPE(template), length, template.ob_descr)             # <<<<<<<<<<<<<<
- *     if zero and op is not None:
- *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
- */
-  __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_op = ((arrayobject *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "array.pxd":133
- *     if zero is true, new array will be initialized with zeroes."""
- *     op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
- *     if zero and op is not None:             # <<<<<<<<<<<<<<
- *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
- *     return op
- */
-  if ((__pyx_v_zero != 0)) {
-    __pyx_t_2 = (((PyObject *)__pyx_v_op) != Py_None);
-    __pyx_t_3 = (__pyx_t_2 != 0);
-  } else {
-    __pyx_t_3 = (__pyx_v_zero != 0);
-  }
-  if (__pyx_t_3) {
-
-    /* "array.pxd":134
- *     op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
- *     if zero and op is not None:
- *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)             # <<<<<<<<<<<<<<
- *     return op
- * 
- */
-    memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize));
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "array.pxd":135
- *     if zero and op is not None:
- *         memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
- *     return op             # <<<<<<<<<<<<<<
- * 
- * cdef inline array copy(array self):
- */
-  __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __Pyx_INCREF(((PyObject *)__pyx_v_op));
-  __pyx_r = __pyx_v_op;
-  goto __pyx_L0;
-
-  /* "array.pxd":128
- * 
- * 
- * cdef inline array clone(array template, Py_ssize_t length, bint zero):             # <<<<<<<<<<<<<<
- *     """ fast creation of a new array, given a template array.
- *     type will be same as template.
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_op);
-  __Pyx_XGIVEREF((PyObject *)__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "array.pxd":137
- *     return op
- * 
- * cdef inline array copy(array self):             # <<<<<<<<<<<<<<
- *     """ make a copy of an array. """
- *     op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
- */
-
-static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
-  arrayobject *__pyx_v_op = NULL;
-  arrayobject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("copy", 0);
-  __Pyx_TraceCall("copy", __pyx_f[1], 137);
-
-  /* "array.pxd":139
- * cdef inline array copy(array self):
- *     """ make a copy of an array. """
- *     op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)             # <<<<<<<<<<<<<<
- *     memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
- *     return op
- */
-  __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_op = ((arrayobject *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "array.pxd":140
- *     """ make a copy of an array. """
- *     op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
- *     memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)             # <<<<<<<<<<<<<<
- *     return op
- * 
- */
-  memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize));
-
-  /* "array.pxd":141
- *     op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
- *     memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
- *     return op             # <<<<<<<<<<<<<<
- * 
- * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
- */
-  __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __Pyx_INCREF(((PyObject *)__pyx_v_op));
-  __pyx_r = __pyx_v_op;
-  goto __pyx_L0;
-
-  /* "array.pxd":137
- *     return op
- * 
- * cdef inline array copy(array self):             # <<<<<<<<<<<<<<
- *     """ make a copy of an array. """
- *     op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_op);
-  __Pyx_XGIVEREF((PyObject *)__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "array.pxd":143
- *     return op
- * 
- * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:             # <<<<<<<<<<<<<<
- *     """ efficent appending of new stuff of same type
- *     (e.g. of same array type)
- */
-
-static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
-  Py_ssize_t __pyx_v_itemsize;
-  Py_ssize_t __pyx_v_origsize;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("extend_buffer", 0);
-  __Pyx_TraceCall("extend_buffer", __pyx_f[1], 143);
-
-  /* "array.pxd":147
- *     (e.g. of same array type)
- *     n: number of elements (not number of bytes!) """
- *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize             # <<<<<<<<<<<<<<
- *     cdef Py_ssize_t origsize = Py_SIZE(self)
- *     resize_smart(self, origsize + n)
- */
-  __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
-  __pyx_v_itemsize = __pyx_t_1;
-
-  /* "array.pxd":148
- *     n: number of elements (not number of bytes!) """
- *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize
- *     cdef Py_ssize_t origsize = Py_SIZE(self)             # <<<<<<<<<<<<<<
- *     resize_smart(self, origsize + n)
- *     memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
- */
-  __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
-
-  /* "array.pxd":149
- *     cdef Py_ssize_t itemsize = self.ob_descr.itemsize
- *     cdef Py_ssize_t origsize = Py_SIZE(self)
- *     resize_smart(self, origsize + n)             # <<<<<<<<<<<<<<
- *     memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
- *     return 0
- */
-  __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "array.pxd":150
- *     cdef Py_ssize_t origsize = Py_SIZE(self)
- *     resize_smart(self, origsize + n)
- *     memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)             # <<<<<<<<<<<<<<
- *     return 0
- * 
- */
-  memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize));
-
-  /* "array.pxd":151
- *     resize_smart(self, origsize + n)
- *     memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
- *     return 0             # <<<<<<<<<<<<<<
- * 
- * cdef inline int extend(array self, array other) except -1:
- */
-  __pyx_r = 0;
-  goto __pyx_L0;
-
-  /* "array.pxd":143
- *     return op
- * 
- * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:             # <<<<<<<<<<<<<<
- *     """ efficent appending of new stuff of same type
- *     (e.g. of same array type)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "array.pxd":153
- *     return 0
- * 
- * cdef inline int extend(array self, array other) except -1:             # <<<<<<<<<<<<<<
- *     """ extend array with data from another array; types must match. """
- *     if self.ob_descr.typecode != other.ob_descr.typecode:
- */
-
-static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("extend", 0);
-  __Pyx_TraceCall("extend", __pyx_f[1], 153);
-
-  /* "array.pxd":155
- * cdef inline int extend(array self, array other) except -1:
- *     """ extend array with data from another array; types must match. """
- *     if self.ob_descr.typecode != other.ob_descr.typecode:             # <<<<<<<<<<<<<<
- *         PyErr_BadArgument()
- *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
- */
-  __pyx_t_1 = ((__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode) != 0);
-  if (__pyx_t_1) {
-
-    /* "array.pxd":156
- *     """ extend array with data from another array; types must match. """
- *     if self.ob_descr.typecode != other.ob_descr.typecode:
- *         PyErr_BadArgument()             # <<<<<<<<<<<<<<
- *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
- * 
- */
-    __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "array.pxd":157
- *     if self.ob_descr.typecode != other.ob_descr.typecode:
- *         PyErr_BadArgument()
- *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))             # <<<<<<<<<<<<<<
- * 
- * cdef inline void zero(array self):
- */
-  __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_t_2;
-  goto __pyx_L0;
-
-  /* "array.pxd":153
- *     return 0
- * 
- * cdef inline int extend(array self, array other) except -1:             # <<<<<<<<<<<<<<
- *     """ extend array with data from another array; types must match. """
- *     if self.ob_descr.typecode != other.ob_descr.typecode:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "array.pxd":159
- *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
- * 
- * cdef inline void zero(array self):             # <<<<<<<<<<<<<<
- *     """ set all elements of array to zero. """
- *     memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
- */
-
-static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("zero", 0);
-  __Pyx_TraceCall("zero", __pyx_f[1], 159);
-
-  /* "array.pxd":161
- * cdef inline void zero(array self):
- *     """ set all elements of array to zero. """
- *     memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)             # <<<<<<<<<<<<<<
- */
-  memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize));
-
-  /* "array.pxd":159
- *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
- * 
- * cdef inline void zero(array self):             # <<<<<<<<<<<<<<
- *     """ set all elements of array to zero. """
- *     memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
- */
-
-  /* function exit code */
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment __pyx_vtable_5pysam_14calignmentfile_AlignedSegment;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_AlignedSegment(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment;
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_AlignedSegment(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_name(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10query_name_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_query_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10query_name_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_flag(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4flag_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_flag(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4flag_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_reference_id(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12reference_id_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_reference_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12reference_id_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_reference_start(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15reference_start_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_reference_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15reference_start_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mapping_quality(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mapping_quality(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mapping_quality_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_cigarstring(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_cigarstring(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigarstring_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_next_reference_id(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_next_reference_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17next_reference_id_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_next_reference_start(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_next_reference_start(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_20next_reference_start_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_length(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12query_length_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_template_length(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15template_length_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_template_length(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15template_length_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_sequence(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_query_sequence(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14query_sequence_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_qualities(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_query_qualities(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15query_qualities_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_tags(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tags_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_tags(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tags_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_bin(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3bin_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_bin(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3bin_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_paired(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_paired_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_paired(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_paired_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_proper_pair(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_proper_pair(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_14is_proper_pair_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_unmapped(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_unmapped(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11is_unmapped_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mate_is_unmapped(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mate_is_unmapped(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16mate_is_unmapped_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_reverse(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_reverse(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_10is_reverse_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mate_is_reverse(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mate_is_reverse(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15mate_is_reverse_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_read1(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read1_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_read1(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read1_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_read2(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read2_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_read2(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_8is_read2_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_secondary(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_secondary(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_secondary_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_qcfail(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_qcfail(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9is_qcfail_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_duplicate(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_duplicate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_12is_duplicate_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_reference_end(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13reference_end_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_reference_length(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_16reference_length_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_length(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_22query_alignment_length_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_sequence(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_24query_alignment_sequence_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_qualities(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_25query_alignment_qualities_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_start(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21query_alignment_start_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_end(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_19query_alignment_end_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_aligment_length(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21query_aligment_length_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_cigartuples(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_cigartuples(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11cigartuples_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qname(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qname_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qname(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qname_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_tid(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3tid_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_tid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3tid_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_pos(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3pos_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3pos_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mapq(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mapq_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mapq(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mapq_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_rnext(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rnext_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_rnext(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rnext_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_pnext(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5pnext_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_pnext(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5pnext_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_cigar(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5cigar_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_cigar(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5cigar_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_tlen(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tlen_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_tlen(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4tlen_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_seq(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3seq_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_seq(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_3seq_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qual(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qual_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qual(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qual_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_alen(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4alen_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_alen(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4alen_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_aend(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4aend_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_aend(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4aend_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_rlen(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4rlen_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_rlen(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4rlen_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5query_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_query(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5query_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qqual(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qqual_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qqual(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5qqual_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qstart(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6qstart_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qstart(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6qstart_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qend(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qend_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qend(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qend_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qlen(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qlen_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qlen(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4qlen_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mrnm(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mrnm_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mrnm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mrnm_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mpos(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mpos_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mpos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_4mpos_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_rname(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rname_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_rname(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5rname_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_isize(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5isize_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_isize(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5isize_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_blocks(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_6blocks_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_aligned_pairs(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13aligned_pairs_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_inferred_length(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15inferred_length_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_positions(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9positions_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_AlignedSegment[] = {
-  {__Pyx_NAMESTR("compare"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_7compare, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_6compare)},
-  {__Pyx_NAMESTR("get_reference_positions"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_11get_reference_positions, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_10get_reference_positions)},
-  {__Pyx_NAMESTR("infer_query_length"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_13infer_query_length, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_12infer_query_length)},
-  {__Pyx_NAMESTR("get_aligned_pairs"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_15get_aligned_pairs, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_14get_aligned_pairs)},
-  {__Pyx_NAMESTR("get_blocks"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_17get_blocks, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_16get_blocks)},
-  {__Pyx_NAMESTR("get_overlap"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_19get_overlap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_18get_overlap)},
-  {__Pyx_NAMESTR("setTag"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_21setTag, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_20setTag)},
-  {__Pyx_NAMESTR("opt"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_23opt, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_22opt)},
-  {__Pyx_NAMESTR("overlap"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14AlignedSegment_25overlap, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14AlignedSegment_24overlap)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_14calignmentfile_AlignedSegment[] = {
-  {(char *)"query_name", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_name, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_query_name, __Pyx_DOCSTR(__pyx_k_the_query_template_name_None_if), 0},
-  {(char *)"flag", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_flag, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_flag, __Pyx_DOCSTR(__pyx_k_properties_flag), 0},
-  {(char *)"reference_id", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_reference_id, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_reference_id, __Pyx_DOCSTR(__pyx_k_term_reference_ID_note_This_fie), 0},
-  {(char *)"reference_start", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_reference_start, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_reference_start, __Pyx_DOCSTR(__pyx_k_0_based_leftmost_coordinate), 0},
-  {(char *)"mapping_quality", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mapping_quality, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mapping_quality, __Pyx_DOCSTR(__pyx_k_mapping_quality_2), 0},
-  {(char *)"cigarstring", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_cigarstring, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_cigarstring, __Pyx_DOCSTR(__pyx_k_the_term_cigar_alignment_as_a_st), 0},
-  {(char *)"next_reference_id", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_next_reference_id, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_next_reference_id, __Pyx_DOCSTR(__pyx_k_the_term_reference_id_of_the_mat), 0},
-  {(char *)"next_reference_start", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_next_reference_start, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_next_reference_start, __Pyx_DOCSTR(__pyx_k_the_position_of_the_mate_next_re), 0},
-  {(char *)"query_length", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_length, 0, __Pyx_DOCSTR(__pyx_k_the_length_of_the_query_read_Thi), 0},
-  {(char *)"template_length", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_template_length, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_template_length, __Pyx_DOCSTR(__pyx_k_the_observed_query_template_leng), 0},
-  {(char *)"query_sequence", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_sequence, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_query_sequence, __Pyx_DOCSTR(__pyx_k_read_sequence_bases_including_te), 0},
-  {(char *)"query_qualities", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_qualities, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_query_qualities, __Pyx_DOCSTR(__pyx_k_read_sequence_base_qualities_inc), 0},
-  {(char *)"tags", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_tags, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_tags, __Pyx_DOCSTR(__pyx_k_the_tags_in_the_AUX_field_This_p), 0},
-  {(char *)"bin", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_bin, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_bin, __Pyx_DOCSTR(__pyx_k_properties_bin), 0},
-  {(char *)"is_paired", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_paired, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_paired, __Pyx_DOCSTR(__pyx_k_true_if_read_is_paired_in_sequen), 0},
-  {(char *)"is_proper_pair", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_proper_pair, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_proper_pair, __Pyx_DOCSTR(__pyx_k_true_if_read_is_mapped_in_a_prop), 0},
-  {(char *)"is_unmapped", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_unmapped, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_unmapped, __Pyx_DOCSTR(__pyx_k_true_if_read_itself_is_unmapped), 0},
-  {(char *)"mate_is_unmapped", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mate_is_unmapped, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mate_is_unmapped, __Pyx_DOCSTR(__pyx_k_true_if_the_mate_is_unmapped), 0},
-  {(char *)"is_reverse", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_reverse, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_reverse, __Pyx_DOCSTR(__pyx_k_true_if_read_is_mapped_to_revers), 0},
-  {(char *)"mate_is_reverse", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mate_is_reverse, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mate_is_reverse, __Pyx_DOCSTR(__pyx_k_true_is_read_is_mapped_to_revers), 0},
-  {(char *)"is_read1", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_read1, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_read1, __Pyx_DOCSTR(__pyx_k_true_if_this_is_read1), 0},
-  {(char *)"is_read2", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_read2, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_read2, __Pyx_DOCSTR(__pyx_k_true_if_this_is_read2), 0},
-  {(char *)"is_secondary", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_secondary, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_secondary, __Pyx_DOCSTR(__pyx_k_true_if_not_primary_alignment), 0},
-  {(char *)"is_qcfail", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_qcfail, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_qcfail, __Pyx_DOCSTR(__pyx_k_true_if_QC_failure), 0},
-  {(char *)"is_duplicate", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_is_duplicate, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_is_duplicate, __Pyx_DOCSTR(__pyx_k_true_if_optical_or_PCR_duplicate), 0},
-  {(char *)"reference_end", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_reference_end, 0, __Pyx_DOCSTR(__pyx_k_aligned_reference_position_of_th), 0},
-  {(char *)"reference_length", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_reference_length, 0, __Pyx_DOCSTR(__pyx_k_aligned_length_of_the_read_on_th), 0},
-  {(char *)"query_alignment_length", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_length, 0, __Pyx_DOCSTR(__pyx_k_length_of_the_query_template_Thi), 0},
-  {(char *)"query_alignment_sequence", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_sequence, 0, __Pyx_DOCSTR(__pyx_k_aligned_portion_of_the_read_This), 0},
-  {(char *)"query_alignment_qualities", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_qualities, 0, __Pyx_DOCSTR(__pyx_k_aligned_query_sequence_quality_v), 0},
-  {(char *)"query_alignment_start", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_start, 0, __Pyx_DOCSTR(__pyx_k_start_index_of_the_aligned_query), 0},
-  {(char *)"query_alignment_end", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_alignment_end, 0, __Pyx_DOCSTR(__pyx_k_end_index_of_the_aligned_query_p), 0},
-  {(char *)"query_aligment_length", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query_aligment_length, 0, __Pyx_DOCSTR(__pyx_k_length_of_the_aligned_query_sequ), 0},
-  {(char *)"cigartuples", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_cigartuples, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_cigartuples, __Pyx_DOCSTR(__pyx_k_the_term_cigar_alignment_The_ali), 0},
-  {(char *)"qname", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qname, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qname, 0, 0},
-  {(char *)"tid", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_tid, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_tid, 0, 0},
-  {(char *)"pos", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_pos, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_pos, 0, 0},
-  {(char *)"mapq", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mapq, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mapq, 0, 0},
-  {(char *)"rnext", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_rnext, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_rnext, 0, 0},
-  {(char *)"pnext", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_pnext, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_pnext, 0, 0},
-  {(char *)"cigar", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_cigar, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_cigar, 0, 0},
-  {(char *)"tlen", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_tlen, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_tlen, 0, 0},
-  {(char *)"seq", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_seq, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_seq, 0, 0},
-  {(char *)"qual", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qual, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qual, 0, 0},
-  {(char *)"alen", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_alen, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_alen, 0, 0},
-  {(char *)"aend", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_aend, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_aend, 0, 0},
-  {(char *)"rlen", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_rlen, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_rlen, 0, 0},
-  {(char *)"query", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_query, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_query, 0, 0},
-  {(char *)"qqual", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qqual, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qqual, 0, 0},
-  {(char *)"qstart", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qstart, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qstart, 0, 0},
-  {(char *)"qend", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qend, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qend, 0, 0},
-  {(char *)"qlen", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_qlen, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_qlen, 0, 0},
-  {(char *)"mrnm", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mrnm, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mrnm, 0, 0},
-  {(char *)"mpos", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_mpos, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_mpos, 0, 0},
-  {(char *)"rname", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_rname, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_rname, 0, 0},
-  {(char *)"isize", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_isize, __pyx_setprop_5pysam_14calignmentfile_14AlignedSegment_isize, 0, 0},
-  {(char *)"blocks", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_blocks, 0, 0, 0},
-  {(char *)"aligned_pairs", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_aligned_pairs, 0, 0, 0},
-  {(char *)"inferred_length", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_inferred_length, 0, 0, 0},
-  {(char *)"positions", __pyx_getprop_5pysam_14calignmentfile_14AlignedSegment_positions, 0, 0, 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_AlignedSegment = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.AlignedSegment"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_AlignedSegment, /*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*/
-  __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_9__hash__, /*tp_hash*/
-  0, /*tp_call*/
-  __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_5__str__, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-  __Pyx_DOCSTR("AlignedSegment()\nClass representing an aligned segment. \n\n    This class stores a handle to the samtools C-structure representing\n    an aligned read. Member read access is forwarded to the C-structure\n    and converted into python objects. This implementation should be fast,\n    as only the data needed is converted.\n\n    For write access, the C-structure is updated in-place. This is\n    not the most efficient way to build BAM entries, as the variable\n    length [...]
-  0, /*tp_traverse*/
-  0, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_AlignedSegment, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_14calignmentfile_AlignedSegment, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_14AlignedSegment_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_AlignedSegment, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile __pyx_vtable_5pysam_14calignmentfile_AlignmentFile;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_AlignmentFile(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile;
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_AlignmentFile(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *p = (struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_33__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->_filename);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile_AlignmentFile(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *p = (struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)o;
-  if (p->_filename) {
-    e = (*v)(p->_filename, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile_AlignmentFile(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *p = (struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)o;
-  tmp = ((PyObject*)p->_filename);
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_filename(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_8filename_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_nreferences(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_11nreferences_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_references(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_10references_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_lengths(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_7lengths_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_mapped(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_6mapped_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_unmapped(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_8unmapped_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_nocoordinate(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_12nocoordinate_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_text(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_4text_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_header(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_6header_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_AlignmentFile[] = {
-  {__Pyx_NAMESTR("_isOpen"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_3_isOpen, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_2_isOpen)},
-  {__Pyx_NAMESTR("_hasIndex"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_5_hasIndex, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_4_hasIndex)},
-  {__Pyx_NAMESTR("_open"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_7_open, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_6_open)},
-  {__Pyx_NAMESTR("gettid"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_9gettid, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_8gettid)},
-  {__Pyx_NAMESTR("getrname"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_11getrname, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_10getrname)},
-  {__Pyx_NAMESTR("_parseRegion"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_13_parseRegion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_12_parseRegion)},
-  {__Pyx_NAMESTR("reset"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_15reset, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_14reset)},
-  {__Pyx_NAMESTR("seek"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_17seek, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_16seek)},
-  {__Pyx_NAMESTR("tell"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_19tell, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_18tell)},
-  {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_21fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_20fetch)},
-  {__Pyx_NAMESTR("head"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_23head, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_22head)},
-  {__Pyx_NAMESTR("mate"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_25mate, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_24mate)},
-  {__Pyx_NAMESTR("count"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_27count, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_26count)},
-  {__Pyx_NAMESTR("pileup"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_29pileup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_28pileup)},
-  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_31close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_30close)},
-  {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_35write, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_34write)},
-  {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_37__enter__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_36__enter__)},
-  {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_39__exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_38__exit__)},
-  {__Pyx_NAMESTR("_checkIndex"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_41_checkIndex, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_40_checkIndex)},
-  {__Pyx_NAMESTR("_buildLine"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_43_buildLine, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_42_buildLine)},
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_13AlignmentFile_47__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_13AlignmentFile_46__next__)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_14calignmentfile_AlignmentFile[] = {
-  {(char *)"filename", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_filename, 0, __Pyx_DOCSTR(__pyx_k_number_of_term_filename_associat), 0},
-  {(char *)"nreferences", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_nreferences, 0, __Pyx_DOCSTR(__pyx_k_number_of_term_reference_sequenc), 0},
-  {(char *)"references", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_references, 0, __Pyx_DOCSTR(__pyx_k_tuple_with_the_names_of_term_ref), 0},
-  {(char *)"lengths", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_lengths, 0, __Pyx_DOCSTR(__pyx_k_tuple_of_the_lengths_of_the_term), 0},
-  {(char *)"mapped", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_mapped, 0, __Pyx_DOCSTR(__pyx_k_total_number_of_mapped_alignment), 0},
-  {(char *)"unmapped", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_unmapped, 0, __Pyx_DOCSTR(__pyx_k_total_number_of_unmapped_reads_i), 0},
-  {(char *)"nocoordinate", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_nocoordinate, 0, __Pyx_DOCSTR(__pyx_k_total_number_of_reads_without_co), 0},
-  {(char *)"text", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_text, 0, __Pyx_DOCSTR(__pyx_k_full_contents_of_the_term_sam_fi), 0},
-  {(char *)"header", __pyx_getprop_5pysam_14calignmentfile_13AlignmentFile_header, 0, __Pyx_DOCSTR(__pyx_k_header_information_within_the_te), 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_AlignmentFile = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.AlignmentFile"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_AlignmentFile, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("*(filename, mode=None, template = None,\n         referencenames=None, referencelengths = None,\n         text=NULL, header=None,\n         add_sq_text=False, check_header=True,\n         check_sq=True)*\n\n    A :term:`SAM`/:term:`BAM` formatted file. The file is\n    automatically opened.\n\n    *mode* should be ``r`` for reading or ``w`` for writing. The\n    default is text mode (:term:`SAM`). For binary (:term:`BAM`) I/O\n    you should append ``b`` for compressed or [...]
-  __pyx_tp_traverse_5pysam_14calignmentfile_AlignmentFile, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_AlignmentFile, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_45__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_14calignmentfile_13AlignmentFile_47__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_AlignmentFile, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_14calignmentfile_AlignmentFile, /*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_5pysam_14calignmentfile_AlignmentFile, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_PileupColumn(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_PileupColumn(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_12PileupColumn_reference_id(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_12reference_id_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_12PileupColumn_nsegments(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_9nsegments_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_12PileupColumn_nsegments(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_9nsegments_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_12PileupColumn_reference_pos(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_13reference_pos_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_12PileupColumn_pileups(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_7pileups_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_12PileupColumn_pos(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3pos_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_12PileupColumn_pos(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3pos_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_12PileupColumn_tid(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3tid_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_12PileupColumn_tid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3tid_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_12PileupColumn_n(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_1n_1__get__(o);
-}
-
-static int __pyx_setprop_5pysam_14calignmentfile_12PileupColumn_n(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
-  if (v) {
-    return __pyx_pw_5pysam_14calignmentfile_12PileupColumn_1n_3__set__(o, v);
-  }
-  else {
-    PyErr_SetString(PyExc_NotImplementedError, "__del__");
-    return -1;
-  }
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_PileupColumn[] = {
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_14calignmentfile_PileupColumn[] = {
-  {(char *)"reference_id", __pyx_getprop_5pysam_14calignmentfile_12PileupColumn_reference_id, 0, __Pyx_DOCSTR(__pyx_k_the_reference_sequence_number_as), 0},
-  {(char *)"nsegments", __pyx_getprop_5pysam_14calignmentfile_12PileupColumn_nsegments, __pyx_setprop_5pysam_14calignmentfile_12PileupColumn_nsegments, __Pyx_DOCSTR(__pyx_k_number_of_reads_mapping_to_this), 0},
-  {(char *)"reference_pos", __pyx_getprop_5pysam_14calignmentfile_12PileupColumn_reference_pos, 0, __Pyx_DOCSTR(__pyx_k_the_position_in_the_reference_se), 0},
-  {(char *)"pileups", __pyx_getprop_5pysam_14calignmentfile_12PileupColumn_pileups, 0, __Pyx_DOCSTR(__pyx_k_list_of_reads_class_pysam_Pileup), 0},
-  {(char *)"pos", __pyx_getprop_5pysam_14calignmentfile_12PileupColumn_pos, __pyx_setprop_5pysam_14calignmentfile_12PileupColumn_pos, 0, 0},
-  {(char *)"tid", __pyx_getprop_5pysam_14calignmentfile_12PileupColumn_tid, __pyx_setprop_5pysam_14calignmentfile_12PileupColumn_tid, 0, 0},
-  {(char *)"n", __pyx_getprop_5pysam_14calignmentfile_12PileupColumn_n, __pyx_setprop_5pysam_14calignmentfile_12PileupColumn_n, 0, 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_PileupColumn = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.PileupColumn"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_PileupColumn, /*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*/
-  __pyx_pw_5pysam_14calignmentfile_12PileupColumn_3__str__, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-  __Pyx_DOCSTR("PileupColumn()\nA pileup of reads at a particular reference sequence postion\n    (:term:`column`). A pileup column contains all the reads that map\n    to a certain target base.\n\n    This class is a proxy for results returned by the samtools pileup\n    engine.  If the underlying engine iterator advances, the results\n    of this column will change.\n\n    "), /*tp_doc*/
-  0, /*tp_traverse*/
-  0, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_PileupColumn, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_14calignmentfile_PileupColumn, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_12PileupColumn_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_PileupColumn, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_PileupRead(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_PileupRead *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)o);
-  p->_alignment = ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)Py_None); Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_PileupRead(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile_PileupRead *p = (struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->_alignment);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile_PileupRead(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile_PileupRead *p = (struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)o;
-  if (p->_alignment) {
-    e = (*v)(((PyObject*)p->_alignment), a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile_PileupRead(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile_PileupRead *p = (struct __pyx_obj_5pysam_14calignmentfile_PileupRead *)o;
-  tmp = ((PyObject*)p->_alignment);
-  p->_alignment = ((struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_10PileupRead_alignment(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_10PileupRead_9alignment_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_10PileupRead_query_position(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_10PileupRead_14query_position_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_10PileupRead_indel(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_10PileupRead_5indel_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_10PileupRead_level(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_10PileupRead_5level_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_10PileupRead_is_del(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_10PileupRead_6is_del_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_10PileupRead_is_head(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_10PileupRead_7is_head_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_10PileupRead_is_tail(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_10PileupRead_7is_tail_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_10PileupRead_is_refskip(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_10PileupRead_10is_refskip_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_PileupRead[] = {
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_14calignmentfile_PileupRead[] = {
-  {(char *)"alignment", __pyx_getprop_5pysam_14calignmentfile_10PileupRead_alignment, 0, __Pyx_DOCSTR(__pyx_k_a_class_pysam_AlignedSegment_obj), 0},
-  {(char *)"query_position", __pyx_getprop_5pysam_14calignmentfile_10PileupRead_query_position, 0, __Pyx_DOCSTR(__pyx_k_position_of_the_read_base_at_the), 0},
-  {(char *)"indel", __pyx_getprop_5pysam_14calignmentfile_10PileupRead_indel, 0, __Pyx_DOCSTR(__pyx_k_indel_length_0_for_no_indel_posi), 0},
-  {(char *)"level", __pyx_getprop_5pysam_14calignmentfile_10PileupRead_level, 0, __Pyx_DOCSTR(__pyx_k_the_level_of_the_read_in_the_vie), 0},
-  {(char *)"is_del", __pyx_getprop_5pysam_14calignmentfile_10PileupRead_is_del, 0, __Pyx_DOCSTR(__pyx_k_1_iff_the_base_on_the_padded_rea), 0},
-  {(char *)"is_head", __pyx_getprop_5pysam_14calignmentfile_10PileupRead_is_head, 0, 0, 0},
-  {(char *)"is_tail", __pyx_getprop_5pysam_14calignmentfile_10PileupRead_is_tail, 0, 0, 0},
-  {(char *)"is_refskip", __pyx_getprop_5pysam_14calignmentfile_10PileupRead_is_refskip, 0, 0, 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_PileupRead = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.PileupRead"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_PileupRead), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_PileupRead, /*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*/
-  __pyx_pw_5pysam_14calignmentfile_10PileupRead_3__str__, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("PileupRead()\nRepresentation of a read aligned to a particular position in the\n    reference sequence.\n\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_PileupRead, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_PileupRead, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_PileupRead, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_14calignmentfile_PileupRead, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_10PileupRead_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_PileupRead, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRow(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *)o);
-  p->samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)Py_None); Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRow(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_14calignmentfile_11IteratorRow_3__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->samfile);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRow(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *)o;
-  if (p->samfile) {
-    e = (*v)(((PyObject*)p->samfile), a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile_IteratorRow(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRow *)o;
-  tmp = ((PyObject*)p->samfile);
-  p->samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorRow[] = {
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorRow = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorRow"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRow), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRow, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("IteratorRow(AlignmentFile samfile, int multiple_iterators=False)\nabstract base class for iterators over mapped reads.\n\n    Various iterators implement different behaviours for wrapping around\n    contig boundaries. Examples include:\n\n    :class:`pysam.IteratorRowRegion`\n        iterate within a single contig and a defined region.\n\n    :class:`pysam.IteratorRowAll`\n        iterate until EOF. This iterator will also include unmapped reads.\n\n    :class:`pysam.Ite [...]
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRow, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorRow, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorRow, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_11IteratorRow_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_IteratorRow, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion __pyx_vtable_5pysam_14calignmentfile_IteratorRowRegion;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowRegion(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *p;
-  PyObject *o = __pyx_tp_new_5pysam_14calignmentfile_IteratorRow(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion;
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRowRegion(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_7__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  PyObject_GC_Track(o);
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRow(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorRowRegion[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_17IteratorRowRegion_4__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorRowRegion = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorRowRegion"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRowRegion, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("IteratorRowRegion(AlignmentFile samfile, int tid, int beg, int end, int multiple_iterators=False)\n*(AlignmentFile samfile, int tid, int beg, int end,\n    int multiple_iterators=False)*\n\n    iterate over mapped reads in a region.\n\n    .. note::\n        It is usually not necessary to create an object of this class\n        explicitely. It is returned as a result of call to a :meth:`AlignmentFile.fetch`.\n\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRow, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorRow, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_3__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_5__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorRowRegion, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_17IteratorRowRegion_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_IteratorRowRegion, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead __pyx_vtable_5pysam_14calignmentfile_IteratorRowHead;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowHead(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *p;
-  PyObject *o = __pyx_tp_new_5pysam_14calignmentfile_IteratorRow(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead;
-  return o;
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorRowHead[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_15IteratorRowHead_4__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorRowHead = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorRowHead"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRow, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("IteratorRowHead(AlignmentFile samfile, int n, int multiple_iterators=False)\n*(AlignmentFile samfile, n, int multiple_iterators=False)*\n\n    iterate over first n reads in *samfile*\n\n    .. note::\n        It is usually not necessary to create an object of this class\n        explicitly. It is returned as a result of call to a :meth:`AlignmentFile.head`.\n        \n\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRow, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorRow, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_3__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_5__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorRowHead, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_15IteratorRowHead_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_IteratorRowHead, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll __pyx_vtable_5pysam_14calignmentfile_IteratorRowAll;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowAll(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *p;
-  PyObject *o = __pyx_tp_new_5pysam_14calignmentfile_IteratorRow(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll;
-  return o;
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorRowAll[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14IteratorRowAll_4__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorRowAll = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorRowAll"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRow, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("IteratorRowAll(AlignmentFile samfile, int multiple_iterators=False)\n*(AlignmentFile samfile, int multiple_iterators=False)*\n\n    iterate over all reads in *samfile*\n\n    .. note::\n        It is usually not necessary to create an object of this class\n        explicitly. It is returned as a result of call to a :meth:`AlignmentFile.fetch`.\n        \n\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRow, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorRow, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_3__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_5__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorRowAll, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_14IteratorRowAll_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_IteratorRowAll, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowAllRefs(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *p;
-  PyObject *o = __pyx_tp_new_5pysam_14calignmentfile_IteratorRow(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *)o);
-  p->rowiter = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)Py_None); Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRowAllRefs(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->rowiter);
-  PyObject_GC_Track(o);
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRow(o);
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRowAllRefs(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *)o;
-  e = __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRow(o, v, a); if (e) return e;
-  if (p->rowiter) {
-    e = (*v)(((PyObject*)p->rowiter), a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile_IteratorRowAllRefs(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs *)o;
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorRow(o);
-  tmp = ((PyObject*)p->rowiter);
-  p->rowiter = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorRowAllRefs[] = {
-  {__Pyx_NAMESTR("nextiter"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_3nextiter, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_18IteratorRowAllRefs_2nextiter)},
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_7__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorRowAllRefs = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorRowAllRefs"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRowAllRefs, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("IteratorRowAllRefs(AlignmentFile samfile, multiple_iterators=False)\niterates over all mapped reads by chaining iterators over each reference\n\n    .. note::\n        It is usually not necessary to create an object of this class\n        explicitely. It is returned as a result of call to a :meth:`AlignmentFile.fetch`.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRowAllRefs, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorRowAllRefs, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_5__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_7__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorRowAllRefs, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_18IteratorRowAllRefs_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_IteratorRowAllRefs, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection __pyx_vtable_5pysam_14calignmentfile_IteratorRowSelection;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorRowSelection(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *p;
-  PyObject *o = __pyx_tp_new_5pysam_14calignmentfile_IteratorRow(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection;
-  p->positions = Py_None; Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRowSelection(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->positions);
-  PyObject_GC_Track(o);
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRow(o);
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRowSelection(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *)o;
-  e = __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRow(o, v, a); if (e) return e;
-  if (p->positions) {
-    e = (*v)(p->positions, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile_IteratorRowSelection(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *)o;
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorRow(o);
-  tmp = ((PyObject*)p->positions);
-  p->positions = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorRowSelection[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_20IteratorRowSelection_4__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorRowSelection = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorRowSelection"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorRowSelection, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("IteratorRowSelection(AlignmentFile samfile, positions, int multiple_iterators=True)\n*(AlignmentFile samfile)*\n\n    iterate over reads in *samfile* at a given list of file positions.\n\n    .. note::\n        It is usually not necessary to create an object of this class\n        explicitely. It is returned as a result of call to a :meth:`AlignmentFile.fetch`.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorRowSelection, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorRowSelection, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_3__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_5__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorRowSelection, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_20IteratorRowSelection_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_IteratorRowSelection, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn __pyx_vtable_5pysam_14calignmentfile_IteratorColumn;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorColumn(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn;
-  p->iter = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)Py_None); Py_INCREF(Py_None);
-  p->samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)Py_None); Py_INCREF(Py_None);
-  p->fastafile = ((struct __pyx_obj_5pysam_6cfaidx_Fastafile *)Py_None); Py_INCREF(Py_None);
-  p->stepper = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorColumn(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_9__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->iter);
-  Py_CLEAR(p->samfile);
-  Py_CLEAR(p->fastafile);
-  Py_CLEAR(p->stepper);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile_IteratorColumn(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)o;
-  if (p->iter) {
-    e = (*v)(((PyObject*)p->iter), a); if (e) return e;
-  }
-  if (p->samfile) {
-    e = (*v)(((PyObject*)p->samfile), a); if (e) return e;
-  }
-  if (p->fastafile) {
-    e = (*v)(((PyObject*)p->fastafile), a); if (e) return e;
-  }
-  if (p->stepper) {
-    e = (*v)(p->stepper, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile_IteratorColumn(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *p = (struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *)o;
-  tmp = ((PyObject*)p->iter);
-  p->iter = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->samfile);
-  p->samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->fastafile);
-  p->fastafile = ((struct __pyx_obj_5pysam_6cfaidx_Fastafile *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->stepper);
-  p->stepper = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_14IteratorColumn_seq_len(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_7seq_len_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorColumn[] = {
-  {__Pyx_NAMESTR("addReference"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_5addReference, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14IteratorColumn_4addReference)},
-  {__Pyx_NAMESTR("hasReference"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_14IteratorColumn_7hasReference, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_14IteratorColumn_6hasReference)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_14calignmentfile_IteratorColumn[] = {
-  {(char *)"seq_len", __pyx_getprop_5pysam_14calignmentfile_14IteratorColumn_seq_len, 0, __Pyx_DOCSTR(__pyx_k_current_sequence_length), 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorColumn = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorColumn"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorColumn, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("abstract base class for iterators over columns.\n\n    IteratorColumn objects wrap the pileup functionality of samtools.\n\n    For reasons of efficiency, the iterator points to the current\n    pileup buffer. The pileup buffer is updated at every iteration.\n    This might cause some unexpected behavious. For example,\n    consider the conversion to a list::\n\n       f = AlignmentFile(\"file.bam\", \"rb\")\n       result = list( f.pileup() )\n\n    Here, ``result`` will [...]
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorColumn, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorColumn, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_3__iter__, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorColumn, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_14calignmentfile_IteratorColumn, /*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_5pysam_14calignmentfile_IteratorColumn, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion __pyx_vtable_5pysam_14calignmentfile_IteratorColumnRegion;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorColumnRegion(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion *p;
-  PyObject *o = __pyx_tp_new_5pysam_14calignmentfile_IteratorColumn(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn*)__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion;
-  if (unlikely(__pyx_pw_5pysam_14calignmentfile_20IteratorColumnRegion_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorColumnRegion[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_20IteratorColumnRegion_3__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorColumnRegion = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorColumnRegion"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorColumn, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("iterates over a region only.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorColumn, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorColumn, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_3__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  __pyx_pw_5pysam_14calignmentfile_20IteratorColumnRegion_3__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorColumnRegion, /*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_5pysam_14calignmentfile_IteratorColumnRegion, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs __pyx_vtable_5pysam_14calignmentfile_IteratorColumnAllRefs;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IteratorColumnAllRefs(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs *p;
-  PyObject *o = __pyx_tp_new_5pysam_14calignmentfile_IteratorColumn(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn*)__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs;
-  if (unlikely(__pyx_pw_5pysam_14calignmentfile_21IteratorColumnAllRefs_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IteratorColumnAllRefs[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_21IteratorColumnAllRefs_3__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IteratorColumnAllRefs = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IteratorColumnAllRefs"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IteratorColumn, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("iterates over all columns by chaining iterators over each reference\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_IteratorColumn, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IteratorColumn, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_14calignmentfile_14IteratorColumn_3__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  __pyx_pw_5pysam_14calignmentfile_21IteratorColumnAllRefs_3__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IteratorColumnAllRefs, /*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_5pysam_14calignmentfile_IteratorColumnAllRefs, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_IndexedReads(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *)o);
-  p->samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)Py_None); Py_INCREF(Py_None);
-  p->index = Py_None; Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_IndexedReads(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *p = (struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_14calignmentfile_12IndexedReads_7__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->samfile);
-  Py_CLEAR(p->index);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile_IndexedReads(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *p = (struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *)o;
-  if (p->samfile) {
-    e = (*v)(((PyObject*)p->samfile), a); if (e) return e;
-  }
-  if (p->index) {
-    e = (*v)(p->index, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile_IndexedReads(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *p = (struct __pyx_obj_5pysam_14calignmentfile_IndexedReads *)o;
-  tmp = ((PyObject*)p->samfile);
-  p->samfile = ((struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->index);
-  p->index = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_IndexedReads[] = {
-  {__Pyx_NAMESTR("build"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_12IndexedReads_3build, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_12IndexedReads_2build)},
-  {__Pyx_NAMESTR("find"), (PyCFunction)__pyx_pw_5pysam_14calignmentfile_12IndexedReads_5find, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_14calignmentfile_12IndexedReads_4find)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_IndexedReads = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.IndexedReads"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_IndexedReads, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("IndexedReads(AlignmentFile samfile, int multiple_iterators=True)\nindex a Sam/BAM-file by query name.\n\n    The index is kept in memory and can be substantial.\n\n    By default, the file is re-openend to avoid conflicts if multiple\n    operators work on the same file. Set *multiple_iterators* = False\n    to not re-open *samfile*.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile_IndexedReads, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile_IndexedReads, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_IndexedReads, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_14calignmentfile_12IndexedReads_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_14calignmentfile_IndexedReads, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile_SNPCall(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile_SNPCall(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_7SNPCall_tid(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_7SNPCall_3tid_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_7SNPCall_pos(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_7SNPCall_3pos_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_7SNPCall_reference_base(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_7SNPCall_14reference_base_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_7SNPCall_genotype(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_7SNPCall_8genotype_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_7SNPCall_consensus_quality(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_7SNPCall_17consensus_quality_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_7SNPCall_snp_quality(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_7SNPCall_11snp_quality_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_7SNPCall_mapping_quality(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_7SNPCall_15mapping_quality_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_14calignmentfile_7SNPCall_coverage(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_14calignmentfile_7SNPCall_8coverage_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_14calignmentfile_SNPCall[] = {
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_14calignmentfile_SNPCall[] = {
-  {(char *)"tid", __pyx_getprop_5pysam_14calignmentfile_7SNPCall_tid, 0, __Pyx_DOCSTR(__pyx_k_the_chromosome_ID_as_is_defined), 0},
-  {(char *)"pos", __pyx_getprop_5pysam_14calignmentfile_7SNPCall_pos, 0, __Pyx_DOCSTR(__pyx_k_nucleotide_position_of_SNP), 0},
-  {(char *)"reference_base", __pyx_getprop_5pysam_14calignmentfile_7SNPCall_reference_base, 0, __Pyx_DOCSTR(__pyx_k_reference_base_at_pos_N_if_no_re), 0},
-  {(char *)"genotype", __pyx_getprop_5pysam_14calignmentfile_7SNPCall_genotype, 0, __Pyx_DOCSTR(__pyx_k_the_genotype_called), 0},
-  {(char *)"consensus_quality", __pyx_getprop_5pysam_14calignmentfile_7SNPCall_consensus_quality, 0, __Pyx_DOCSTR(__pyx_k_the_genotype_quality_Phred_scale), 0},
-  {(char *)"snp_quality", __pyx_getprop_5pysam_14calignmentfile_7SNPCall_snp_quality, 0, __Pyx_DOCSTR(__pyx_k_the_snp_quality_Phred_scaled_pro), 0},
-  {(char *)"mapping_quality", __pyx_getprop_5pysam_14calignmentfile_7SNPCall_mapping_quality, 0, __Pyx_DOCSTR(__pyx_k_the_root_mean_square_rms_of_the), 0},
-  {(char *)"coverage", __pyx_getprop_5pysam_14calignmentfile_7SNPCall_coverage, 0, __Pyx_DOCSTR(__pyx_k_coverage_or_read_depth_the_numbe), 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile_SNPCall = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.SNPCall"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile_SNPCall), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile_SNPCall, /*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*/
-  __pyx_pw_5pysam_14calignmentfile_7SNPCall_1__str__, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-  __Pyx_DOCSTR("the results of a SNP call."), /*tp_doc*/
-  0, /*tp_traverse*/
-  0, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_14calignmentfile_SNPCall, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_14calignmentfile_SNPCall, /*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_5pysam_14calignmentfile_SNPCall, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *__pyx_freelist_5pysam_14calignmentfile___pyx_scope_struct__genexpr[8];
-static int __pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct__genexpr = 0;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((__pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct__genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr)))) {
-    o = (PyObject*)__pyx_freelist_5pysam_14calignmentfile___pyx_scope_struct__genexpr[--__pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct__genexpr];
-    memset(o, 0, sizeof(struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr));
-    (void) PyObject_INIT(o, t);
-    PyObject_GC_Track(o);
-  } else {
-    o = (*t->tp_alloc)(t, 0);
-    if (unlikely(!o)) return 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile___pyx_scope_struct__genexpr(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *)o;
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->__pyx_v_x);
-  Py_CLEAR(p->__pyx_v_y);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_1);
-  if ((__pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct__genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr))) {
-    __pyx_freelist_5pysam_14calignmentfile___pyx_scope_struct__genexpr[__pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *)o);
-  } else {
-    (*Py_TYPE(o)->tp_free)(o);
-  }
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *)o;
-  if (p->__pyx_v_x) {
-    e = (*v)(p->__pyx_v_x, a); if (e) return e;
-  }
-  if (p->__pyx_v_y) {
-    e = (*v)(p->__pyx_v_y, a); if (e) return e;
-  }
-  if (p->__pyx_t_0) {
-    e = (*v)(p->__pyx_t_0, a); if (e) return e;
-  }
-  if (p->__pyx_t_1) {
-    e = (*v)(p->__pyx_t_1, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile___pyx_scope_struct__genexpr(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *p = (struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr *)o;
-  tmp = ((PyObject*)p->__pyx_v_x);
-  p->__pyx_v_x = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->__pyx_v_y);
-  p->__pyx_v_y = 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);
-  tmp = ((PyObject*)p->__pyx_t_1);
-  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile___pyx_scope_struct__genexpr = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.__pyx_scope_struct__genexpr"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct__genexpr), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile___pyx_scope_struct__genexpr, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile___pyx_scope_struct__genexpr, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile___pyx_scope_struct__genexpr, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_14calignmentfile___pyx_scope_struct__genexpr, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *__pyx_freelist_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr[8];
-static int __pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr = 0;
-
-static PyObject *__pyx_tp_new_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((__pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr)))) {
-    o = (PyObject*)__pyx_freelist_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr[--__pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr];
-    memset(o, 0, sizeof(struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr));
-    (void) PyObject_INIT(o, t);
-    PyObject_GC_Track(o);
-  } else {
-    o = (*t->tp_alloc)(t, 0);
-    if (unlikely(!o)) return 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr(PyObject *o) {
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *)o;
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->__pyx_v_x);
-  Py_CLEAR(p->__pyx_v_y);
-  Py_CLEAR(p->__pyx_t_0);
-  Py_CLEAR(p->__pyx_t_1);
-  if ((__pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr))) {
-    __pyx_freelist_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr[__pyx_freecount_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *)o);
-  } else {
-    (*Py_TYPE(o)->tp_free)(o);
-  }
-}
-
-static int __pyx_tp_traverse_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *)o;
-  if (p->__pyx_v_x) {
-    e = (*v)(p->__pyx_v_x, a); if (e) return e;
-  }
-  if (p->__pyx_v_y) {
-    e = (*v)(p->__pyx_v_y, a); if (e) return e;
-  }
-  if (p->__pyx_t_0) {
-    e = (*v)(p->__pyx_t_0, a); if (e) return e;
-  }
-  if (p->__pyx_t_1) {
-    e = (*v)(p->__pyx_t_1, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr *)o;
-  tmp = ((PyObject*)p->__pyx_v_x);
-  p->__pyx_v_x = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->__pyx_v_y);
-  p->__pyx_v_y = 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);
-  tmp = ((PyObject*)p->__pyx_t_1);
-  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyTypeObject __pyx_type_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.calignmentfile.__pyx_scope_struct_1_genexpr"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
-  {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
-    PyModuleDef_HEAD_INIT,
-  #endif
-    __Pyx_NAMESTR("calignmentfile"),
-    0, /* m_doc */
-    -1, /* m_size */
-    __pyx_methods /* m_methods */,
-    NULL, /* m_reload */
-    NULL, /* m_traverse */
-    NULL, /* m_clear */
-    NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_2scB, __pyx_k_2scB, sizeof(__pyx_k_2scB), 0, 0, 1, 0},
-  {&__pyx_kp_s_2scH, __pyx_k_2scH, sizeof(__pyx_k_2scH), 0, 0, 1, 0},
-  {&__pyx_kp_s_2scI, __pyx_k_2scI, sizeof(__pyx_k_2scI), 0, 0, 1, 0},
-  {&__pyx_kp_s_2sc_is, __pyx_k_2sc_is, sizeof(__pyx_k_2sc_is), 0, 0, 1, 0},
-  {&__pyx_kp_s_2scb, __pyx_k_2scb, sizeof(__pyx_k_2scb), 0, 0, 1, 0},
-  {&__pyx_kp_s_2scc, __pyx_k_2scc, sizeof(__pyx_k_2scc), 0, 0, 1, 0},
-  {&__pyx_kp_s_2sccI_i_s, __pyx_k_2sccI_i_s, sizeof(__pyx_k_2sccI_i_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_2scf, __pyx_k_2scf, sizeof(__pyx_k_2scf), 0, 0, 1, 0},
-  {&__pyx_kp_s_2sch, __pyx_k_2sch, sizeof(__pyx_k_2sch), 0, 0, 1, 0},
-  {&__pyx_kp_s_2sci, __pyx_k_2sci, sizeof(__pyx_k_2sci), 0, 0, 1, 0},
-  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
-  {&__pyx_n_s_AS, __pyx_k_AS, sizeof(__pyx_k_AS), 0, 0, 1, 1},
-  {&__pyx_n_s_AlignedSegment, __pyx_k_AlignedSegment, sizeof(__pyx_k_AlignedSegment), 0, 0, 1, 1},
-  {&__pyx_n_s_AlignmentFile, __pyx_k_AlignmentFile, sizeof(__pyx_k_AlignmentFile), 0, 0, 1, 1},
-  {&__pyx_kp_s_AlignmentFile_mapped_only_availa, __pyx_k_AlignmentFile_mapped_only_availa, sizeof(__pyx_k_AlignmentFile_mapped_only_availa), 0, 0, 1, 0},
-  {&__pyx_kp_u_Argument_must_be_string_bytes_or, __pyx_k_Argument_must_be_string_bytes_or, sizeof(__pyx_k_Argument_must_be_string_bytes_or), 0, 1, 0, 0},
-  {&__pyx_kp_u_Argument_must_be_string_or_unico, __pyx_k_Argument_must_be_string_or_unico, sizeof(__pyx_k_Argument_must_be_string_or_unico), 0, 1, 0, 0},
-  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
-  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
-  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
-  {&__pyx_n_s_CIGAR2CODE, __pyx_k_CIGAR2CODE, sizeof(__pyx_k_CIGAR2CODE), 0, 0, 1, 1},
-  {&__pyx_n_s_CIGAR_REGEX, __pyx_k_CIGAR_REGEX, sizeof(__pyx_k_CIGAR_REGEX), 0, 0, 1, 1},
-  {&__pyx_n_s_CL, __pyx_k_CL, sizeof(__pyx_k_CL), 0, 0, 1, 1},
-  {&__pyx_n_s_CN, __pyx_k_CN, sizeof(__pyx_k_CN), 0, 0, 1, 1},
-  {&__pyx_n_s_CO, __pyx_k_CO, sizeof(__pyx_k_CO), 0, 0, 1, 1},
-  {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1},
-  {&__pyx_n_s_DS, __pyx_k_DS, sizeof(__pyx_k_DS), 0, 0, 1, 1},
-  {&__pyx_n_s_DT, __pyx_k_DT, sizeof(__pyx_k_DT), 0, 0, 1, 1},
-  {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1},
-  {&__pyx_n_s_FO, __pyx_k_FO, sizeof(__pyx_k_FO), 0, 0, 1, 1},
-  {&__pyx_n_s_GO, __pyx_k_GO, sizeof(__pyx_k_GO), 0, 0, 1, 1},
-  {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1},
-  {&__pyx_n_s_HD, __pyx_k_HD, sizeof(__pyx_k_HD), 0, 0, 1, 1},
-  {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1},
-  {&__pyx_n_s_ID, __pyx_k_ID, sizeof(__pyx_k_ID), 0, 0, 1, 1},
-  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
-  {&__pyx_n_s_IS_PYTHON3, __pyx_k_IS_PYTHON3, sizeof(__pyx_k_IS_PYTHON3), 0, 0, 1, 1},
-  {&__pyx_kp_s_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 0, 1, 0},
-  {&__pyx_n_s_IndexedReads, __pyx_k_IndexedReads, sizeof(__pyx_k_IndexedReads), 0, 0, 1, 1},
-  {&__pyx_kp_s_Invalid_tag_s, __pyx_k_Invalid_tag_s, sizeof(__pyx_k_Invalid_tag_s), 0, 0, 1, 0},
-  {&__pyx_n_s_IteratorColumn, __pyx_k_IteratorColumn, sizeof(__pyx_k_IteratorColumn), 0, 0, 1, 1},
-  {&__pyx_n_s_IteratorRow, __pyx_k_IteratorRow, sizeof(__pyx_k_IteratorRow), 0, 0, 1, 1},
-  {&__pyx_n_s_KS, __pyx_k_KS, sizeof(__pyx_k_KS), 0, 0, 1, 1},
-  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
-  {&__pyx_n_s_LB, __pyx_k_LB, sizeof(__pyx_k_LB), 0, 0, 1, 1},
-  {&__pyx_n_s_LN, __pyx_k_LN, sizeof(__pyx_k_LN), 0, 0, 1, 1},
-  {&__pyx_n_s_M5, __pyx_k_M5, sizeof(__pyx_k_M5), 0, 0, 1, 1},
-  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
-  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
-  {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
-  {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
-  {&__pyx_n_s_PG, __pyx_k_PG, sizeof(__pyx_k_PG), 0, 0, 1, 1},
-  {&__pyx_n_s_PI, __pyx_k_PI, sizeof(__pyx_k_PI), 0, 0, 1, 1},
-  {&__pyx_n_s_PL, __pyx_k_PL, sizeof(__pyx_k_PL), 0, 0, 1, 1},
-  {&__pyx_n_s_PN, __pyx_k_PN, sizeof(__pyx_k_PN), 0, 0, 1, 1},
-  {&__pyx_n_s_PP, __pyx_k_PP, sizeof(__pyx_k_PP), 0, 0, 1, 1},
-  {&__pyx_n_s_PU, __pyx_k_PU, sizeof(__pyx_k_PU), 0, 0, 1, 1},
-  {&__pyx_n_s_PileupColumn, __pyx_k_PileupColumn, sizeof(__pyx_k_PileupColumn), 0, 0, 1, 1},
-  {&__pyx_kp_s_PileupColumn_accessed_after_iter, __pyx_k_PileupColumn_accessed_after_iter, sizeof(__pyx_k_PileupColumn_accessed_after_iter), 0, 0, 1, 0},
-  {&__pyx_n_s_PileupRead, __pyx_k_PileupRead, sizeof(__pyx_k_PileupRead), 0, 0, 1, 1},
-  {&__pyx_n_s_RG, __pyx_k_RG, sizeof(__pyx_k_RG), 0, 0, 1, 1},
-  {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1},
-  {&__pyx_n_s_SM, __pyx_k_SM, sizeof(__pyx_k_SM), 0, 0, 1, 1},
-  {&__pyx_n_s_SN, __pyx_k_SN, sizeof(__pyx_k_SN), 0, 0, 1, 1},
-  {&__pyx_n_s_SO, __pyx_k_SO, sizeof(__pyx_k_SO), 0, 0, 1, 1},
-  {&__pyx_n_s_SP, __pyx_k_SP, sizeof(__pyx_k_SP), 0, 0, 1, 1},
-  {&__pyx_n_s_SQ, __pyx_k_SQ, sizeof(__pyx_k_SQ), 0, 0, 1, 1},
-  {&__pyx_kp_s_SQ_SN_s_LN_s, __pyx_k_SQ_SN_s_LN_s, sizeof(__pyx_k_SQ_SN_s_LN_s), 0, 0, 1, 0},
-  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
-  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
-  {&__pyx_n_s_UR, __pyx_k_UR, sizeof(__pyx_k_UR), 0, 0, 1, 1},
-  {&__pyx_kp_s_Unsupported_value_type_in_set_op, __pyx_k_Unsupported_value_type_in_set_op, sizeof(__pyx_k_Unsupported_value_type_in_set_op), 0, 0, 1, 0},
-  {&__pyx_n_s_VALID_HEADERS, __pyx_k_VALID_HEADERS, sizeof(__pyx_k_VALID_HEADERS), 0, 0, 1, 1},
-  {&__pyx_n_s_VALID_HEADER_FIELDS, __pyx_k_VALID_HEADER_FIELDS, sizeof(__pyx_k_VALID_HEADER_FIELDS), 0, 0, 1, 1},
-  {&__pyx_n_s_VALID_HEADER_ORDER, __pyx_k_VALID_HEADER_ORDER, sizeof(__pyx_k_VALID_HEADER_ORDER), 0, 0, 1, 1},
-  {&__pyx_n_s_VALID_HEADER_TYPES, __pyx_k_VALID_HEADER_TYPES, sizeof(__pyx_k_VALID_HEADER_TYPES), 0, 0, 1, 1},
-  {&__pyx_n_s_VN, __pyx_k_VN, sizeof(__pyx_k_VN), 0, 0, 1, 1},
-  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 0, 1, 1},
-  {&__pyx_n_s_Zidf, __pyx_k_Zidf, sizeof(__pyx_k_Zidf), 0, 0, 1, 1},
-  {&__pyx_kp_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 0},
-  {&__pyx_kp_s__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 1, 0},
-  {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0},
-  {&__pyx_kp_s__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 1, 0},
-  {&__pyx_kp_s__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 1, 0},
-  {&__pyx_kp_s__47, __pyx_k__47, sizeof(__pyx_k__47), 0, 0, 1, 0},
-  {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0},
-  {&__pyx_kp_s__74, __pyx_k__74, sizeof(__pyx_k__74), 0, 0, 1, 0},
-  {&__pyx_n_s_add_sq_text, __pyx_k_add_sq_text, sizeof(__pyx_k_add_sq_text), 0, 0, 1, 1},
-  {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1},
-  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
-  {&__pyx_n_s_all_2, __pyx_k_all_2, sizeof(__pyx_k_all_2), 0, 0, 1, 1},
-  {&__pyx_n_s_always, __pyx_k_always, sizeof(__pyx_k_always), 0, 0, 1, 1},
-  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
-  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
-  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
-  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
-  {&__pyx_kp_s_at_least_one_integer_out_of_rang, __pyx_k_at_least_one_integer_out_of_rang, sizeof(__pyx_k_at_least_one_integer_out_of_rang), 0, 0, 1, 0},
-  {&__pyx_kp_s_at_least_one_signed_integer_out, __pyx_k_at_least_one_signed_integer_out, sizeof(__pyx_k_at_least_one_signed_integer_out), 0, 0, 1, 0},
-  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
-  {&__pyx_kp_b_bai, __pyx_k_bai, sizeof(__pyx_k_bai), 0, 0, 0, 0},
-  {&__pyx_n_s_beg, __pyx_k_beg, sizeof(__pyx_k_beg), 0, 0, 1, 1},
-  {&__pyx_n_s_buildLine, __pyx_k_buildLine, sizeof(__pyx_k_buildLine), 0, 0, 1, 1},
-  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
-  {&__pyx_kp_s_c_2, __pyx_k_c_2, sizeof(__pyx_k_c_2), 0, 0, 1, 0},
-  {&__pyx_n_s_calcsize, __pyx_k_calcsize, sizeof(__pyx_k_calcsize), 0, 0, 1, 1},
-  {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1},
-  {&__pyx_kp_s_callback_not_implemented_yet, __pyx_k_callback_not_implemented_yet, sizeof(__pyx_k_callback_not_implemented_yet), 0, 0, 1, 0},
-  {&__pyx_kp_s_can_not_iterate_over_samfile_wit, __pyx_k_can_not_iterate_over_samfile_wit, sizeof(__pyx_k_can_not_iterate_over_samfile_wit), 0, 0, 1, 0},
-  {&__pyx_kp_s_can_only_IndexReads_on_bam_files, __pyx_k_can_only_IndexReads_on_bam_files, sizeof(__pyx_k_can_only_IndexReads_on_bam_files), 0, 0, 1, 0},
-  {&__pyx_kp_s_can_t_guess_type_or_invalid_type, __pyx_k_can_t_guess_type_or_invalid_type, sizeof(__pyx_k_can_t_guess_type_or_invalid_type), 0, 0, 1, 0},
-  {&__pyx_n_s_checkIndex, __pyx_k_checkIndex, sizeof(__pyx_k_checkIndex), 0, 0, 1, 1},
-  {&__pyx_n_s_check_header, __pyx_k_check_header, sizeof(__pyx_k_check_header), 0, 0, 1, 1},
-  {&__pyx_n_s_check_sq, __pyx_k_check_sq, sizeof(__pyx_k_check_sq), 0, 0, 1, 1},
-  {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
-  {&__pyx_n_s_cigarstring, __pyx_k_cigarstring, sizeof(__pyx_k_cigarstring), 0, 0, 1, 1},
-  {&__pyx_n_s_cigartuples, __pyx_k_cigartuples, sizeof(__pyx_k_cigartuples), 0, 0, 1, 1},
-  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
-  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
-  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
-  {&__pyx_n_s_consensus_quality, __pyx_k_consensus_quality, sizeof(__pyx_k_consensus_quality), 0, 0, 1, 1},
-  {&__pyx_kp_s_could_not_open_file_mode_s_is_it, __pyx_k_could_not_open_file_mode_s_is_it, sizeof(__pyx_k_could_not_open_file_mode_s_is_it), 0, 0, 1, 0},
-  {&__pyx_kp_s_could_not_open_file_s, __pyx_k_could_not_open_file_s, sizeof(__pyx_k_could_not_open_file_s), 0, 0, 1, 0},
-  {&__pyx_n_s_coverage, __pyx_k_coverage, sizeof(__pyx_k_coverage), 0, 0, 1, 1},
-  {&__pyx_n_s_create_string_buffer, __pyx_k_create_string_buffer, sizeof(__pyx_k_create_string_buffer), 0, 0, 1, 1},
-  {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
-  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
-  {&__pyx_kp_s_d_MIDNSHP_X, __pyx_k_d_MIDNSHP_X, sizeof(__pyx_k_d_MIDNSHP_X), 0, 0, 1, 0},
-  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
-  {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1},
-  {&__pyx_kp_s_either_supply_options_template_h, __pyx_k_either_supply_options_template_h, sizeof(__pyx_k_either_supply_options_template_h), 0, 0, 1, 0},
-  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
-  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
-  {&__pyx_kp_s_end_out_of_range_i, __pyx_k_end_out_of_range_i, sizeof(__pyx_k_end_out_of_range_i), 0, 0, 1, 0},
-  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
-  {&__pyx_kp_s_error_during_iteration, __pyx_k_error_during_iteration, sizeof(__pyx_k_error_during_iteration), 0, 0, 1, 0},
-  {&__pyx_kp_s_error_while_opening_index_s, __pyx_k_error_while_opening_index_s, sizeof(__pyx_k_error_while_opening_index_s), 0, 0, 1, 0},
-  {&__pyx_n_s_exc_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 0, 0, 1, 1},
-  {&__pyx_n_s_exc_value, __pyx_k_exc_value, sizeof(__pyx_k_exc_value), 0, 0, 1, 1},
-  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
-  {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
-  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
-  {&__pyx_n_s_fastafile, __pyx_k_fastafile, sizeof(__pyx_k_fastafile), 0, 0, 1, 1},
-  {&__pyx_n_s_fetch, __pyx_k_fetch, sizeof(__pyx_k_fetch), 0, 0, 1, 1},
-  {&__pyx_kp_s_fetch_called_for_htsfile_without, __pyx_k_fetch_called_for_htsfile_without, sizeof(__pyx_k_fetch_called_for_htsfile_without), 0, 0, 1, 0},
-  {&__pyx_kp_s_fetch_called_on_bamfile_without, __pyx_k_fetch_called_on_bamfile_without, sizeof(__pyx_k_fetch_called_on_bamfile_without), 0, 0, 1, 0},
-  {&__pyx_kp_s_fetching_by_region_is_not_availa, __pyx_k_fetching_by_region_is_not_availa, sizeof(__pyx_k_fetching_by_region_is_not_availa), 0, 0, 1, 0},
-  {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
-  {&__pyx_kp_s_file_does_not_have_valid_header, __pyx_k_file_does_not_have_valid_header, sizeof(__pyx_k_file_does_not_have_valid_header), 0, 0, 1, 0},
-  {&__pyx_kp_s_file_does_not_have_valid_header_2, __pyx_k_file_does_not_have_valid_header_2, sizeof(__pyx_k_file_does_not_have_valid_header_2), 0, 0, 1, 0},
-  {&__pyx_kp_s_file_header_is_empty_mode_s_is_i, __pyx_k_file_header_is_empty_mode_s_is_i, sizeof(__pyx_k_file_header_is_empty_mode_s_is_i), 0, 0, 1, 0},
-  {&__pyx_kp_s_file_s_not_found, __pyx_k_file_s_not_found, sizeof(__pyx_k_file_s_not_found), 0, 0, 1, 0},
-  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
-  {&__pyx_n_s_findall, __pyx_k_findall, sizeof(__pyx_k_findall), 0, 0, 1, 1},
-  {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1},
-  {&__pyx_n_s_fromQualityString, __pyx_k_fromQualityString, sizeof(__pyx_k_fromQualityString), 0, 0, 1, 1},
-  {&__pyx_kp_b_ftp, __pyx_k_ftp, sizeof(__pyx_k_ftp), 0, 0, 0, 0},
-  {&__pyx_n_s_full_length, __pyx_k_full_length, sizeof(__pyx_k_full_length), 0, 0, 1, 1},
-  {&__pyx_n_s_genotype, __pyx_k_genotype, sizeof(__pyx_k_genotype), 0, 0, 1, 1},
-  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
-  {&__pyx_n_s_get_aligned_pairs, __pyx_k_get_aligned_pairs, sizeof(__pyx_k_get_aligned_pairs), 0, 0, 1, 1},
-  {&__pyx_n_s_get_blocks, __pyx_k_get_blocks, sizeof(__pyx_k_get_blocks), 0, 0, 1, 1},
-  {&__pyx_n_s_get_overlap, __pyx_k_get_overlap, sizeof(__pyx_k_get_overlap), 0, 0, 1, 1},
-  {&__pyx_n_s_get_reference_positions, __pyx_k_get_reference_positions, sizeof(__pyx_k_get_reference_positions), 0, 0, 1, 1},
-  {&__pyx_n_s_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_gettid, __pyx_k_gettid, sizeof(__pyx_k_gettid), 0, 0, 1, 1},
-  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
-  {&__pyx_n_s_hasIndex, __pyx_k_hasIndex, sizeof(__pyx_k_hasIndex), 0, 0, 1, 1},
-  {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1},
-  {&__pyx_kp_s_header_line_with_invalid_type_s, __pyx_k_header_line_with_invalid_type_s, sizeof(__pyx_k_header_line_with_invalid_type_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_header_line_without_s, __pyx_k_header_line_without_s, sizeof(__pyx_k_header_line_without_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_k_home_andreas_devel_pysam_pysam, sizeof(__pyx_k_home_andreas_devel_pysam_pysam), 0, 0, 1, 0},
-  {&__pyx_kp_b_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 0, 0, 0},
-  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
-  {&__pyx_kp_s_i_c, __pyx_k_i_c, sizeof(__pyx_k_i_c), 0, 0, 1, 0},
-  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_kp_s_incomplete_sequence_information, __pyx_k_incomplete_sequence_information, sizeof(__pyx_k_incomplete_sequence_information), 0, 0, 1, 0},
-  {&__pyx_n_s_indel, __pyx_k_indel, sizeof(__pyx_k_indel), 0, 0, 1, 1},
-  {&__pyx_n_s_infer_query_length, __pyx_k_infer_query_length, sizeof(__pyx_k_infer_query_length), 0, 0, 1, 1},
-  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
-  {&__pyx_kp_s_integer_i_out_of_range_of_BAM_SA, __pyx_k_integer_i_out_of_range_of_BAM_SA, sizeof(__pyx_k_integer_i_out_of_range_of_BAM_SA), 0, 0, 1, 0},
-  {&__pyx_kp_s_invalid_coordinates_start_i_end, __pyx_k_invalid_coordinates_start_i_end, sizeof(__pyx_k_invalid_coordinates_start_i_end), 0, 0, 1, 0},
-  {&__pyx_kp_s_invalid_file_opening_mode_s, __pyx_k_invalid_file_opening_mode_s, sizeof(__pyx_k_invalid_file_opening_mode_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_invalid_reference_s, __pyx_k_invalid_reference_s, sizeof(__pyx_k_invalid_reference_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_invalid_type_for_record_s_s_expe, __pyx_k_invalid_type_for_record_s_s_expe, sizeof(__pyx_k_invalid_type_for_record_s_s_expe), 0, 0, 1, 0},
-  {&__pyx_n_s_isOpen, __pyx_k_isOpen, sizeof(__pyx_k_isOpen), 0, 0, 1, 1},
-  {&__pyx_n_s_is_del, __pyx_k_is_del, sizeof(__pyx_k_is_del), 0, 0, 1, 1},
-  {&__pyx_n_s_is_head, __pyx_k_is_head, sizeof(__pyx_k_is_head), 0, 0, 1, 1},
-  {&__pyx_n_s_is_refskip, __pyx_k_is_refskip, sizeof(__pyx_k_is_refskip), 0, 0, 1, 1},
-  {&__pyx_n_s_is_refskip_2, __pyx_k_is_refskip_2, sizeof(__pyx_k_is_refskip_2), 0, 0, 1, 1},
-  {&__pyx_n_s_is_tail, __pyx_k_is_tail, sizeof(__pyx_k_is_tail), 0, 0, 1, 1},
-  {&__pyx_n_s_islower, __pyx_k_islower, sizeof(__pyx_k_islower), 0, 0, 1, 1},
-  {&__pyx_n_s_isupper, __pyx_k_isupper, sizeof(__pyx_k_isupper), 0, 0, 1, 1},
-  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
-  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
-  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
-  {&__pyx_n_s_lengths, __pyx_k_lengths, sizeof(__pyx_k_lengths), 0, 0, 1, 1},
-  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
-  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
-  {&__pyx_kp_s_malformatted_header_no_in_field, __pyx_k_malformatted_header_no_in_field, sizeof(__pyx_k_malformatted_header_no_in_field), 0, 0, 1, 0},
-  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
-  {&__pyx_kp_s_mapping_information_not_recorded, __pyx_k_mapping_information_not_recorded, sizeof(__pyx_k_mapping_information_not_recorded), 0, 0, 1, 0},
-  {&__pyx_n_s_mapping_quality, __pyx_k_mapping_quality, sizeof(__pyx_k_mapping_quality), 0, 0, 1, 1},
-  {&__pyx_kp_s_mate_not_found, __pyx_k_mate_not_found, sizeof(__pyx_k_mate_not_found), 0, 0, 1, 0},
-  {&__pyx_kp_s_mate_s_is_unmapped, __pyx_k_mate_s_is_unmapped, sizeof(__pyx_k_mate_s_is_unmapped), 0, 0, 1, 0},
-  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
-  {&__pyx_n_s_max_depth, __pyx_k_max_depth, sizeof(__pyx_k_max_depth), 0, 0, 1, 1},
-  {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
-  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
-  {&__pyx_n_s_multiple_iterators, __pyx_k_multiple_iterators, sizeof(__pyx_k_multiple_iterators), 0, 0, 1, 1},
-  {&__pyx_kp_s_multiple_s_lines_are_not_permitt, __pyx_k_multiple_s_lines_are_not_permitt, sizeof(__pyx_k_multiple_s_lines_are_not_permitt), 0, 0, 1, 0},
-  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
-  {&__pyx_n_s_next_reference_id, __pyx_k_next_reference_id, sizeof(__pyx_k_next_reference_id), 0, 0, 1, 1},
-  {&__pyx_n_s_next_reference_start, __pyx_k_next_reference_start, sizeof(__pyx_k_next_reference_start), 0, 0, 1, 1},
-  {&__pyx_n_s_nextiter, __pyx_k_nextiter, sizeof(__pyx_k_nextiter), 0, 0, 1, 1},
-  {&__pyx_kp_s_no_index_available_for_fetch, __pyx_k_no_index_available_for_fetch, sizeof(__pyx_k_no_index_available_for_fetch), 0, 0, 1, 0},
-  {&__pyx_kp_s_no_index_available_for_iteration, __pyx_k_no_index_available_for_iteration, sizeof(__pyx_k_no_index_available_for_iteration), 0, 0, 1, 0},
-  {&__pyx_kp_s_no_index_available_for_pileup, __pyx_k_no_index_available_for_pileup, sizeof(__pyx_k_no_index_available_for_pileup), 0, 0, 1, 0},
-  {&__pyx_n_s_nofilter, __pyx_k_nofilter, sizeof(__pyx_k_nofilter), 0, 0, 1, 1},
-  {&__pyx_n_s_nreferences, __pyx_k_nreferences, sizeof(__pyx_k_nreferences), 0, 0, 1, 1},
-  {&__pyx_n_s_nsegmentes, __pyx_k_nsegmentes, sizeof(__pyx_k_nsegmentes), 0, 0, 1, 1},
-  {&__pyx_n_s_nsegments, __pyx_k_nsegments, sizeof(__pyx_k_nsegments), 0, 0, 1, 1},
-  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
-  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
-  {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1},
-  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
-  {&__pyx_n_s_pack_into, __pyx_k_pack_into, sizeof(__pyx_k_pack_into), 0, 0, 1, 1},
-  {&__pyx_n_s_parseRegion, __pyx_k_parseRegion, sizeof(__pyx_k_parseRegion), 0, 0, 1, 1},
-  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
-  {&__pyx_kp_s_pileup_of_samfiles_not_implement, __pyx_k_pileup_of_samfiles_not_implement, sizeof(__pyx_k_pileup_of_samfiles_not_implement), 0, 0, 1, 0},
-  {&__pyx_n_s_pileups, __pyx_k_pileups, sizeof(__pyx_k_pileups), 0, 0, 1, 1},
-  {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
-  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
-  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
-  {&__pyx_n_s_positions, __pyx_k_positions, sizeof(__pyx_k_positions), 0, 0, 1, 1},
-  {&__pyx_n_s_pysam_calignmentfile, __pyx_k_pysam_calignmentfile, sizeof(__pyx_k_pysam_calignmentfile), 0, 0, 1, 1},
-  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
-  {&__pyx_n_s_qualities, __pyx_k_qualities, sizeof(__pyx_k_qualities), 0, 0, 1, 1},
-  {&__pyx_kp_s_quality_and_sequence_mismatch_i, __pyx_k_quality_and_sequence_mismatch_i, sizeof(__pyx_k_quality_and_sequence_mismatch_i), 0, 0, 1, 0},
-  {&__pyx_n_s_quality_string, __pyx_k_quality_string, sizeof(__pyx_k_quality_string), 0, 0, 1, 1},
-  {&__pyx_n_s_query_alignment_end, __pyx_k_query_alignment_end, sizeof(__pyx_k_query_alignment_end), 0, 0, 1, 1},
-  {&__pyx_n_s_query_alignment_length, __pyx_k_query_alignment_length, sizeof(__pyx_k_query_alignment_length), 0, 0, 1, 1},
-  {&__pyx_n_s_query_alignment_qualities, __pyx_k_query_alignment_qualities, sizeof(__pyx_k_query_alignment_qualities), 0, 0, 1, 1},
-  {&__pyx_n_s_query_alignment_sequence, __pyx_k_query_alignment_sequence, sizeof(__pyx_k_query_alignment_sequence), 0, 0, 1, 1},
-  {&__pyx_n_s_query_alignment_start, __pyx_k_query_alignment_start, sizeof(__pyx_k_query_alignment_start), 0, 0, 1, 1},
-  {&__pyx_n_s_query_length, __pyx_k_query_length, sizeof(__pyx_k_query_length), 0, 0, 1, 1},
-  {&__pyx_n_s_query_name, __pyx_k_query_name, sizeof(__pyx_k_query_name), 0, 0, 1, 1},
-  {&__pyx_n_s_query_position, __pyx_k_query_position, sizeof(__pyx_k_query_position), 0, 0, 1, 1},
-  {&__pyx_n_s_query_qualities, __pyx_k_query_qualities, sizeof(__pyx_k_query_qualities), 0, 0, 1, 1},
-  {&__pyx_n_s_query_sequence, __pyx_k_query_sequence, sizeof(__pyx_k_query_sequence), 0, 0, 1, 1},
-  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
-  {&__pyx_n_s_rU, __pyx_k_rU, sizeof(__pyx_k_rU), 0, 0, 1, 1},
-  {&__pyx_n_s_raw, __pyx_k_raw, sizeof(__pyx_k_raw), 0, 0, 1, 1},
-  {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1},
-  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
-  {&__pyx_kp_s_read_s_is_unpaired, __pyx_k_read_s_is_unpaired, sizeof(__pyx_k_read_s_is_unpaired), 0, 0, 1, 0},
-  {&__pyx_kp_s_read_s_not_found, __pyx_k_read_s_not_found, sizeof(__pyx_k_read_s_not_found), 0, 0, 1, 0},
-  {&__pyx_n_s_record, __pyx_k_record, sizeof(__pyx_k_record), 0, 0, 1, 1},
-  {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1},
-  {&__pyx_n_s_reference_base, __pyx_k_reference_base, sizeof(__pyx_k_reference_base), 0, 0, 1, 1},
-  {&__pyx_n_s_reference_end, __pyx_k_reference_end, sizeof(__pyx_k_reference_end), 0, 0, 1, 1},
-  {&__pyx_n_s_reference_id, __pyx_k_reference_id, sizeof(__pyx_k_reference_id), 0, 0, 1, 1},
-  {&__pyx_kp_s_reference_id_i_out_of_range_0_ti, __pyx_k_reference_id_i_out_of_range_0_ti, sizeof(__pyx_k_reference_id_i_out_of_range_0_ti), 0, 0, 1, 0},
-  {&__pyx_n_s_reference_length, __pyx_k_reference_length, sizeof(__pyx_k_reference_length), 0, 0, 1, 1},
-  {&__pyx_n_s_reference_pos, __pyx_k_reference_pos, sizeof(__pyx_k_reference_pos), 0, 0, 1, 1},
-  {&__pyx_kp_s_reference_sequence_for_s_tid_i_n, __pyx_k_reference_sequence_for_s_tid_i_n, sizeof(__pyx_k_reference_sequence_for_s_tid_i_n), 0, 0, 1, 0},
-  {&__pyx_n_s_reference_start, __pyx_k_reference_start, sizeof(__pyx_k_reference_start), 0, 0, 1, 1},
-  {&__pyx_n_s_referencelengths, __pyx_k_referencelengths, sizeof(__pyx_k_referencelengths), 0, 0, 1, 1},
-  {&__pyx_n_s_referencenames, __pyx_k_referencenames, sizeof(__pyx_k_referencenames), 0, 0, 1, 1},
-  {&__pyx_n_s_references, __pyx_k_references, sizeof(__pyx_k_references), 0, 0, 1, 1},
-  {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1},
-  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
-  {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0},
-  {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1},
-  {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0},
-  {&__pyx_n_s_samfile, __pyx_k_samfile, sizeof(__pyx_k_samfile), 0, 0, 1, 1},
-  {&__pyx_n_s_samtools, __pyx_k_samtools, sizeof(__pyx_k_samtools), 0, 0, 1, 1},
-  {&__pyx_n_s_seek, __pyx_k_seek, sizeof(__pyx_k_seek), 0, 0, 1, 1},
-  {&__pyx_kp_s_seek_no_available_in_streams, __pyx_k_seek_no_available_in_streams, sizeof(__pyx_k_seek_no_available_in_streams), 0, 0, 1, 0},
-  {&__pyx_kp_s_seek_only_available_in_bam_files, __pyx_k_seek_only_available_in_bam_files, sizeof(__pyx_k_seek_only_available_in_bam_files), 0, 0, 1, 0},
-  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
-  {&__pyx_n_s_setTag, __pyx_k_setTag, sizeof(__pyx_k_setTag), 0, 0, 1, 1},
-  {&__pyx_n_s_snp_quality, __pyx_k_snp_quality, sizeof(__pyx_k_snp_quality), 0, 0, 1, 1},
-  {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1},
-  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
-  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
-  {&__pyx_kp_s_start_out_of_range_i, __pyx_k_start_out_of_range_i, sizeof(__pyx_k_start_out_of_range_i), 0, 0, 1, 0},
-  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
-  {&__pyx_n_s_stepper, __pyx_k_stepper, sizeof(__pyx_k_stepper), 0, 0, 1, 1},
-  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
-  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
-  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
-  {&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1},
-  {&__pyx_kp_s_tag_s_not_present, __pyx_k_tag_s_not_present, sizeof(__pyx_k_tag_s_not_present), 0, 0, 1, 0},
-  {&__pyx_n_s_tags, __pyx_k_tags, sizeof(__pyx_k_tags), 0, 0, 1, 1},
-  {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
-  {&__pyx_n_s_template, __pyx_k_template, sizeof(__pyx_k_template), 0, 0, 1, 1},
-  {&__pyx_n_s_template_length, __pyx_k_template_length, sizeof(__pyx_k_template_length), 0, 0, 1, 1},
-  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
-  {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
-  {&__pyx_kp_s_this_class_cannot_be_instantiate, __pyx_k_this_class_cannot_be_instantiate, sizeof(__pyx_k_this_class_cannot_be_instantiate), 0, 0, 1, 0},
-  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
-  {&__pyx_n_s_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 0, 1, 1},
-  {&__pyx_kp_s_tid_i_out_of_range_0_tid_i, __pyx_k_tid_i_out_of_range_0_tid_i, sizeof(__pyx_k_tid_i_out_of_range_0_tid_i), 0, 0, 1, 0},
-  {&__pyx_n_s_toQualityString, __pyx_k_toQualityString, sizeof(__pyx_k_toQualityString), 0, 0, 1, 1},
-  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
-  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
-  {&__pyx_kp_s_truncated_file, __pyx_k_truncated_file, sizeof(__pyx_k_truncated_file), 0, 0, 1, 0},
-  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
-  {&__pyx_kp_s_unable_to_open_index_for_s, __pyx_k_unable_to_open_index_for_s, sizeof(__pyx_k_unable_to_open_index_for_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_unequal_names_and_lengths_of_ref, __pyx_k_unequal_names_and_lengths_of_ref, sizeof(__pyx_k_unequal_names_and_lengths_of_ref), 0, 0, 1, 0},
-  {&__pyx_kp_s_unknown_auxilliary_type_s, __pyx_k_unknown_auxilliary_type_s, sizeof(__pyx_k_unknown_auxilliary_type_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_unknown_field_code_s_in_record_s, __pyx_k_unknown_field_code_s_in_record_s, sizeof(__pyx_k_unknown_field_code_s_in_record_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_unknown_stepper_option_s_in_Iter, __pyx_k_unknown_stepper_option_s_in_Iter, sizeof(__pyx_k_unknown_stepper_option_s_in_Iter), 0, 0, 1, 0},
-  {&__pyx_kp_s_unknown_type_s, __pyx_k_unknown_type_s, sizeof(__pyx_k_unknown_type_s), 0, 0, 1, 0},
-  {&__pyx_n_s_until_eof, __pyx_k_until_eof, sizeof(__pyx_k_until_eof), 0, 0, 1, 1},
-  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
-  {&__pyx_n_s_value_type, __pyx_k_value_type, sizeof(__pyx_k_value_type), 0, 0, 1, 1},
-  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
-  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
-  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
-  {&__pyx_n_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 1},
-  {&__pyx_n_s_wb0, __pyx_k_wb0, sizeof(__pyx_k_wb0), 0, 0, 1, 1},
-  {&__pyx_n_s_wbu, __pyx_k_wbu, sizeof(__pyx_k_wbu), 0, 0, 1, 1},
-  {&__pyx_n_s_wh, __pyx_k_wh, sizeof(__pyx_k_wh), 0, 0, 1, 1},
-  {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
-  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
-  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
-  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
-  {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __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);
-
-  /* "pysam/calignmentfile.pyx":71
- *         return s
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- */
-  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple_);
-  __Pyx_GIVEREF(__pyx_tuple_);
-
-  /* "pysam/calignmentfile.pyx":92
- *         return s
- *     elif PyBytes_Check(s):
- *         return s.decode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         # assume unicode
- */
-  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__2);
-  __Pyx_GIVEREF(__pyx_tuple__2);
-
-  /* "pysam/calignmentfile.pyx":371
- *             mode = "wb0"
- * 
- *         cdef bytes bmode = mode.encode('ascii')             # <<<<<<<<<<<<<<
- *         self._filename = filename = _encodeFilename(filename)
- *         self.isstream = filename == b"-"
- */
-  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__3);
-  __Pyx_GIVEREF(__pyx_tuple__3);
-
-  /* "pysam/calignmentfile.pyx":377
- *         self.isbam = len(mode) > 1 and mode[1] == 'b'
- * 
- *         self.isremote = filename.startswith(b"http:") or \             # <<<<<<<<<<<<<<
- *                         filename.startswith(b"ftp:")
- * 
- */
-  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_b_http); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__5);
-  __Pyx_GIVEREF(__pyx_tuple__5);
-
-  /* "pysam/calignmentfile.pyx":378
- * 
- *         self.isremote = filename.startswith(b"http:") or \
- *                         filename.startswith(b"ftp:")             # <<<<<<<<<<<<<<
- * 
- *         cdef char * ctext
- */
-  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_b_ftp); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__6);
-  __Pyx_GIVEREF(__pyx_tuple__6);
-
-  /* "pysam/calignmentfile.pyx":497
- *             if not self.isremote:
- *                 if not os.path.exists(filename + b".bai") \
- *                         and not os.path.exists( filename[:-4] + b".bai"):             # <<<<<<<<<<<<<<
- *                     self.index = NULL
- *                 else:
- */
-  __pyx_slice__8 = PySlice_New(Py_None, __pyx_int_neg_4, Py_None); if (unlikely(!__pyx_slice__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__8);
-  __Pyx_GIVEREF(__pyx_slice__8);
-
-  /* "pysam/calignmentfile.pyx":519
- *         '''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *         reference = _forceBytes(reference)
- *         return bam_name2id(self.header, reference)
- */
-  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__9);
-  __Pyx_GIVEREF(__pyx_tuple__9);
-
-  /* "pysam/calignmentfile.pyx":527
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *         if not 0 <= tid < self.header.n_targets:
- *             raise ValueError("reference_id %i out of range 0<=tid<%i" %
- */
-  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__10);
-  __Pyx_GIVEREF(__pyx_tuple__10);
-
-  /* "pysam/calignmentfile.pyx":537
- *         convert numerical :term:`tid` into :term:`reference` name.'''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- * 
- *         if not 0 <= tid < self.header.n_targets:
- */
-  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__11);
-  __Pyx_GIVEREF(__pyx_tuple__11);
-
-  /* "pysam/calignmentfile.pyx":590
- * 
- *         if not reference:
- *             return 0, 0, 0, 0             # <<<<<<<<<<<<<<
- * 
- *         if tid is not None:
- */
-  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__13);
-  __Pyx_GIVEREF(__pyx_tuple__13);
-
-  /* "pysam/calignmentfile.pyx":621
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")
- */
-  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__14);
-  __Pyx_GIVEREF(__pyx_tuple__14);
-
-  /* "pysam/calignmentfile.pyx":623
- *             raise ValueError( "I/O operation on closed file" )
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")             # <<<<<<<<<<<<<<
- *         if self.isstream:
- *             raise OSError("seek no available in streams")
- */
-  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_seek_only_available_in_bam_files); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__15);
-  __Pyx_GIVEREF(__pyx_tuple__15);
-
-  /* "pysam/calignmentfile.pyx":625
- *             raise NotImplementedError("seek only available in bam files")
- *         if self.isstream:
- *             raise OSError("seek no available in streams")             # <<<<<<<<<<<<<<
- * 
- *         return bgzf_seek(self.fp, offset, where)
- */
-  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_seek_no_available_in_streams); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__16);
-  __Pyx_GIVEREF(__pyx_tuple__16);
-
-  /* "pysam/calignmentfile.pyx":634
- *         '''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")
- */
-  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__17);
-  __Pyx_GIVEREF(__pyx_tuple__17);
-
-  /* "pysam/calignmentfile.pyx":636
- *             raise ValueError("I/O operation on closed file")
- *         if not self.isbam:
- *             raise NotImplementedError("seek only available in bam files")             # <<<<<<<<<<<<<<
- * 
- *         return bgzf_tell(self.fp)
- */
-  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_seek_only_available_in_bam_files); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__18);
-  __Pyx_GIVEREF(__pyx_tuple__18);
-
-  /* "pysam/calignmentfile.pyx":679
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(reference,
- */
-  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__19);
-  __Pyx_GIVEREF(__pyx_tuple__19);
-
-  /* "pysam/calignmentfile.pyx":693
- *         if self.isbam:
- *             if not until_eof and not self._hasIndex() and not self.isremote:
- *                 raise ValueError("fetch called on bamfile without index")             # <<<<<<<<<<<<<<
- * 
- *             if has_coord:
- */
-  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_fetch_called_on_bamfile_without); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__20);
-  __Pyx_GIVEREF(__pyx_tuple__20);
-
-  /* "pysam/calignmentfile.pyx":709
- *         else:
- *             if has_coord:
- *                 raise ValueError(             # <<<<<<<<<<<<<<
- *                     "fetching by region is not available for sam files")
- * 
- */
-  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_fetching_by_region_is_not_availa); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__21);
-  __Pyx_GIVEREF(__pyx_tuple__21);
-
-  /* "pysam/calignmentfile.pyx":713
- * 
- *             if callback:
- *                 raise NotImplementedError("callback not implemented yet")             # <<<<<<<<<<<<<<
- * 
- *             if self.header == NULL:
- */
-  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_callback_not_implemented_yet); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__22);
-  __Pyx_GIVEREF(__pyx_tuple__22);
-
-  /* "pysam/calignmentfile.pyx":716
- * 
- *             if self.header == NULL:
- *                 raise ValueError("fetch called for htsfile without header")             # <<<<<<<<<<<<<<
- * 
- *             # check if targets are defined
- */
-  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_fetch_called_for_htsfile_without); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__23);
-  __Pyx_GIVEREF(__pyx_tuple__23);
-
-  /* "pysam/calignmentfile.pyx":721
- *             # give warning, sam_read1 segfaults
- *             if self.header.n_targets == 0:
- *                 warnings.warn("fetch called for htsfile without header")             # <<<<<<<<<<<<<<
- * 
- *             return IteratorRowAll(self,
- */
-  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_fetch_called_for_htsfile_without); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__24);
-  __Pyx_GIVEREF(__pyx_tuple__24);
-
-  /* "pysam/calignmentfile.pyx":785
- *                 break
- *         else:
- *             raise ValueError("mate not found")             # <<<<<<<<<<<<<<
- * 
- *         return mate
- */
-  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_mate_not_found); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__25);
-  __Pyx_GIVEREF(__pyx_tuple__25);
-
-  /* "pysam/calignmentfile.pyx":810
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         for read in self.fetch(reference=reference,
- */
-  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__26);
-  __Pyx_GIVEREF(__pyx_tuple__26);
-
-  /* "pysam/calignmentfile.pyx":892
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         has_coord, rtid, rstart, rend = self._parseRegion(
- */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
-
-  /* "pysam/calignmentfile.pyx":899
- *         if self.isbam:
- *             if not self._hasIndex():
- *                 raise ValueError("no index available for pileup")             # <<<<<<<<<<<<<<
- * 
- *             if has_coord:
- */
-  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_index_available_for_pileup); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__28);
-  __Pyx_GIVEREF(__pyx_tuple__28);
-
-  /* "pysam/calignmentfile.pyx":911
- * 
- *         else:
- *             raise NotImplementedError( "pileup of samfiles not implemented yet" )             # <<<<<<<<<<<<<<
- * 
- *     def close( self ):
- */
-  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_pileup_of_samfiles_not_implement); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__29);
-  __Pyx_GIVEREF(__pyx_tuple__29);
-
-  /* "pysam/calignmentfile.pyx":965
- *         '''number of :term:`reference` sequences in the file.'''
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *             return self.header.n_targets
- * 
- */
-  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
-
-  /* "pysam/calignmentfile.pyx":971
- *         """tuple with the names of :term:`reference` sequences."""
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *             t = []
- *             for x from 0 <= x < self.header.n_targets:
- */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
-
-  /* "pysam/calignmentfile.pyx":984
- *         """
- *         def __get__(self):
- *             if not self._isOpen(): raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *             t = []
- *             for x from 0 <= x < self.header.n_targets:
- */
-  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
-
-  /* "pysam/calignmentfile.pyx":1007
- *         an error.'''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *         if not self.isbam:
- *             raise AttributeError("AlignmentFile.mapped only available in bam files")
- */
-  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
-
-  /* "pysam/calignmentfile.pyx":1009
- *             raise ValueError("I/O operation on closed file")
- *         if not self.isbam:
- *             raise AttributeError("AlignmentFile.mapped only available in bam files")             # <<<<<<<<<<<<<<
- *         if self.index == NULL:
- *             raise ValueError("mapping information not recorded in index "
- */
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_AlignmentFile_mapped_only_availa); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
-
-  /* "pysam/calignmentfile.pyx":1011
- *             raise AttributeError("AlignmentFile.mapped only available in bam files")
- *         if self.index == NULL:
- *             raise ValueError("mapping information not recorded in index "             # <<<<<<<<<<<<<<
- *                                  "or index not available")
- * 
- */
-  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_mapping_information_not_recorded); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
-
-  /* "pysam/calignmentfile.pyx":1044
- *         def __get__(self):
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *             return from_string_and_size(self.header.text, self.header.l_text)
- * 
- */
-  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
-
-  /* "pysam/calignmentfile.pyx":1070
- *         def __get__(self):
- *             if not self._isOpen():
- *                 raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *             result = {}
- */
-  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__37);
-  __Pyx_GIVEREF(__pyx_tuple__37);
-
-  /* "pysam/calignmentfile.pyx":1078
- *                 # create 0-terminated string)
- *                 t = self.text
- *                 for line in t.split("\n"):             # <<<<<<<<<<<<<<
- *                     if not line.strip(): continue
- *                     assert line.startswith("@"), \
- */
-  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s__38); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__39);
-  __Pyx_GIVEREF(__pyx_tuple__39);
-
-  /* "pysam/calignmentfile.pyx":1080
- *                 for line in t.split("\n"):
- *                     if not line.strip(): continue
- *                     assert line.startswith("@"), \             # <<<<<<<<<<<<<<
- *                         "header line without '@': '%s'" % line
- *                     fields = line[1:].split("\t")
- */
-  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s__40); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__41);
-  __Pyx_GIVEREF(__pyx_tuple__41);
-
-  /* "pysam/calignmentfile.pyx":1082
- *                     assert line.startswith("@"), \
- *                         "header line without '@': '%s'" % line
- *                     fields = line[1:].split("\t")             # <<<<<<<<<<<<<<
- *                     record = fields[0]
- *                     assert record in VALID_HEADER_TYPES, \
- */
-  __pyx_slice__42 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__42);
-  __Pyx_GIVEREF(__pyx_slice__42);
-  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s__43); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__44);
-  __Pyx_GIVEREF(__pyx_tuple__44);
-
-  /* "pysam/calignmentfile.pyx":1091
- *                         if record not in result:
- *                             result[record] = []
- *                         result[record].append("\t".join( fields[1:]))             # <<<<<<<<<<<<<<
- *                         continue
- *                     # the following is clumsy as generators do not work?
- */
-  __pyx_slice__45 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__45);
-  __Pyx_GIVEREF(__pyx_slice__45);
-
-  /* "pysam/calignmentfile.pyx":1096
- *                     x = {}
- * 
- *                     for idx, field in enumerate(fields[1:]):             # <<<<<<<<<<<<<<
- *                         if ":" not in field:
- *                             raise ValueError("malformatted header: no ':' in field" )
- */
-  __pyx_slice__46 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__46);
-  __Pyx_GIVEREF(__pyx_slice__46);
-
-  /* "pysam/calignmentfile.pyx":1098
- *                     for idx, field in enumerate(fields[1:]):
- *                         if ":" not in field:
- *                             raise ValueError("malformatted header: no ':' in field" )             # <<<<<<<<<<<<<<
- *                         key, value = field.split(":", 1)
- *                         if key in ("CL",):
- */
-  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_malformatted_header_no_in_field); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__48);
-  __Pyx_GIVEREF(__pyx_tuple__48);
-
-  /* "pysam/calignmentfile.pyx":1099
- *                         if ":" not in field:
- *                             raise ValueError("malformatted header: no ':' in field" )
- *                         key, value = field.split(":", 1)             # <<<<<<<<<<<<<<
- *                         if key in ("CL",):
- *                             # special treatment for command line
- */
-  __pyx_tuple__49 = PyTuple_Pack(2, __pyx_kp_s__47, __pyx_int_1); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__49);
-  __Pyx_GIVEREF(__pyx_tuple__49);
-
-  /* "pysam/calignmentfile.pyx":1107
- *                             # header. Thus, in contravention to the
- *                             # SAM API, consume the rest of the line.
- *                             key, value = "\t".join(fields[idx+1:]).split(":", 1)             # <<<<<<<<<<<<<<
- *                             x[key] = VALID_HEADER_FIELDS[record][key](value)
- *                             break
- */
-  __pyx_tuple__50 = PyTuple_Pack(2, __pyx_kp_s__47, __pyx_int_1); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__50);
-  __Pyx_GIVEREF(__pyx_tuple__50);
-
-  /* "pysam/calignmentfile.pyx":1216
- *         dest.text = <char*>calloc( len(text), sizeof(char))
- *         dest.l_text = len(text)
- *         cdef bytes btext = text.encode('ascii')             # <<<<<<<<<<<<<<
- *         strncpy( dest.text, btext, dest.l_text )
- * 
- */
-  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__51);
-  __Pyx_GIVEREF(__pyx_tuple__51);
-
-  /* "pysam/calignmentfile.pyx":1237
- *                 dest.target_name[x] = <char*>calloc(
- *                     len(seqname) + 1, sizeof(char))
- *                 bseqname = seqname.encode('ascii')             # <<<<<<<<<<<<<<
- *                 strncpy(dest.target_name[x], bseqname,
- *                         len(seqname) + 1)
- */
-  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__52);
-  __Pyx_GIVEREF(__pyx_tuple__52);
-
-  /* "pysam/calignmentfile.pyx":1254
- *     def __iter__(self):
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         if not self.isbam and self.header.n_targets == 0:
- */
-  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__53);
-  __Pyx_GIVEREF(__pyx_tuple__53);
-
-  /* "pysam/calignmentfile.pyx":1257
- * 
- *         if not self.isbam and self.header.n_targets == 0:
- *             raise NotImplementedError(             # <<<<<<<<<<<<<<
- *                 "can not iterate over samfile without header")
- *         return self
- */
-  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_can_not_iterate_over_samfile_wit); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__54);
-  __Pyx_GIVEREF(__pyx_tuple__54);
-
-  /* "pysam/calignmentfile.pyx":1280
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- *             raise IOError('truncated file')             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_truncated_file); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__55);
-  __Pyx_GIVEREF(__pyx_tuple__55);
-
-  /* "pysam/calignmentfile.pyx":1313
- * 
- *         if not samfile._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- * 
- *         # makes sure that samfile stays alive as long as the
- */
-  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__56);
-  __Pyx_GIVEREF(__pyx_tuple__56);
-
-  /* "pysam/calignmentfile.pyx":1364
- * 
- *         if not samfile._hasIndex():
- *             raise ValueError( "no index available for iteration" )             # <<<<<<<<<<<<<<
- * 
- *         self.iter = sam_itr_queryi(
- */
-  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_no_index_available_for_iteration); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__57);
-  __Pyx_GIVEREF(__pyx_tuple__57);
-
-  /* "pysam/calignmentfile.pyx":1440
- *             return makeAlignedSegment( self.b )
- *         elif (ret == -2):
- *             raise IOError('truncated file')             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_truncated_file); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__58);
-  __Pyx_GIVEREF(__pyx_tuple__58);
-
-  /* "pysam/calignmentfile.pyx":1482
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- *             raise IOError('truncated file')             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_truncated_file); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__59);
-  __Pyx_GIVEREF(__pyx_tuple__59);
-
-  /* "pysam/calignmentfile.pyx":1501
- * 
- *         if not samfile._hasIndex():
- *             raise ValueError("no index available for fetch")             # <<<<<<<<<<<<<<
- * 
- *         self.tid = -1
- */
-  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_no_index_available_for_fetch); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__60);
-  __Pyx_GIVEREF(__pyx_tuple__60);
-
-  /* "pysam/calignmentfile.pyx":1600
- *             return makeAlignedSegment(self.b)
- *         elif (ret == -2):
- *             raise IOError('truncated file')             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_truncated_file); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__61);
-  __Pyx_GIVEREF(__pyx_tuple__61);
-
-  /* "pysam/calignmentfile.pyx":1908
- *             self.cnext()
- *             if self.n_plp < 0:
- *                 raise ValueError("error during iteration" )             # <<<<<<<<<<<<<<
- * 
- *             if self.plp == NULL:
- */
-  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_error_during_iteration); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__63);
-  __Pyx_GIVEREF(__pyx_tuple__63);
-
-  /* "pysam/calignmentfile.pyx":1946
- * 
- *             if self.n_plp < 0:
- *                 raise ValueError("error during iteration" )             # <<<<<<<<<<<<<<
- * 
- *             # return result, if within same reference
- */
-  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_error_during_iteration); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__64);
-  __Pyx_GIVEREF(__pyx_tuple__64);
-
-  /* "pysam/calignmentfile.pyx":2099
- * 
- *     if not type(pytag) is bytes:
- *         pytag = pytag.encode('ascii')             # <<<<<<<<<<<<<<
- *     t = type(value)
- * 
- */
-  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__65);
-  __Pyx_GIVEREF(__pyx_tuple__65);
-
-  /* "pysam/calignmentfile.pyx":2118
- *                     datafmt, datatype = "h", 's'
- *                 elif mi < -2147483648 or ma >= 2147483648:
- *                     raise ValueError(             # <<<<<<<<<<<<<<
- *                         "at least one signed integer out of range of "
- *                         "BAM/SAM specification")
- */
-  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_at_least_one_signed_integer_out); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__66);
-  __Pyx_GIVEREF(__pyx_tuple__66);
-
-  /* "pysam/calignmentfile.pyx":2130
- *                     datafmt, datatype = "H", 'S'
- *                 elif ma >= 4294967296:
- *                     raise ValueError(             # <<<<<<<<<<<<<<
- *                         "at least one integer out of range of BAM/SAM specification")
- *                 else:
- */
-  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_at_least_one_integer_out_of_rang); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__67);
-  __Pyx_GIVEREF(__pyx_tuple__67);
-
-  /* "pysam/calignmentfile.pyx":2136
- * 
- *         datafmt = "2sccI%i%s" % (len(value), datafmt)
- *         args.extend([pytag[:2],             # <<<<<<<<<<<<<<
- *                      pytype.encode('ascii'),
- *                      datatype.encode('ascii'),
- */
-  __pyx_slice__68 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__68);
-  __Pyx_GIVEREF(__pyx_slice__68);
-
-  /* "pysam/calignmentfile.pyx":2137
- *         datafmt = "2sccI%i%s" % (len(value), datafmt)
- *         args.extend([pytag[:2],
- *                      pytype.encode('ascii'),             # <<<<<<<<<<<<<<
- *                      datatype.encode('ascii'),
- *                      len(value)] + list(value))
- */
-  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__69);
-  __Pyx_GIVEREF(__pyx_tuple__69);
-
-  /* "pysam/calignmentfile.pyx":2138
- *         args.extend([pytag[:2],
- *                      pytype.encode('ascii'),
- *                      datatype.encode('ascii'),             # <<<<<<<<<<<<<<
- *                      len(value)] + list(value))
- *         fmts.append( datafmt )
- */
-  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__70);
-  __Pyx_GIVEREF(__pyx_tuple__70);
-
-  /* "pysam/calignmentfile.pyx":2161
- *         # Note: hex strings (H) are not supported yet
- *         if t is not bytes:
- *             value = value.encode('ascii')             # <<<<<<<<<<<<<<
- *         if len(value) == 1:
- *             fmt, pytype = "2scc", 'A'
- */
-  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__71);
-  __Pyx_GIVEREF(__pyx_tuple__71);
-
-  /* "pysam/calignmentfile.pyx":2167
- *             fmt, pytype = "2sc%is" % (len(value)+1), 'Z'
- * 
- *     args.extend([pytag[:2],             # <<<<<<<<<<<<<<
- *                  pytype.encode('ascii'),
- *                  value])
- */
-  __pyx_slice__72 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__72);
-  __Pyx_GIVEREF(__pyx_slice__72);
-
-  /* "pysam/calignmentfile.pyx":2168
- * 
- *     args.extend([pytag[:2],
- *                  pytype.encode('ascii'),             # <<<<<<<<<<<<<<
- *                  value])
- * 
- */
-  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__73);
-  __Pyx_GIVEREF(__pyx_tuple__73);
-
-  /* "pysam/calignmentfile.pyx":3206
- *         type_code = _getTypeCode(value, value_type)
- *         if type_code == 0:
- *             raise ValueError("can't guess type or invalid type code specified")             # <<<<<<<<<<<<<<
- * 
- *         # Not Endian-safe, but then again neither is samtools!
- */
-  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_can_t_guess_type_or_invalid_type); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__75);
-  __Pyx_GIVEREF(__pyx_tuple__75);
-
-  /* "pysam/calignmentfile.pyx":3226
- *             value_size   = sizeof(float)
- *         else:
- *             raise ValueError('Unsupported value_type in set_option')             # <<<<<<<<<<<<<<
- * 
- *         tag = _forceBytes( tag )
- */
-  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_Unsupported_value_type_in_set_op); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__76);
-  __Pyx_GIVEREF(__pyx_tuple__76);
-
-  /* "pysam/calignmentfile.pyx":3416
- *     '''
- *     def __init__(self):
- *         raise TypeError("this class cannot be instantiated from Python")             # <<<<<<<<<<<<<<
- * 
- *     def __str__(self):
- */
-  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_this_class_cannot_be_instantiate); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__77);
-  __Pyx_GIVEREF(__pyx_tuple__77);
-
-  /* "pysam/calignmentfile.pyx":3449
- * 
- *             if self.plp == NULL or self.plp[0] == NULL:
- *                 raise ValueError("PileupColumn accessed after iterator finished")             # <<<<<<<<<<<<<<
- * 
- *             # warning: there could be problems if self.n and self.buf are
- */
-  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_PileupColumn_accessed_after_iter); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__78);
-  __Pyx_GIVEREF(__pyx_tuple__78);
-
-  /* "pysam/calignmentfile.pyx":3487
- * 
- *     def __init__(self):
- *         raise TypeError("this class cannot be instantiated from Python")             # <<<<<<<<<<<<<<
- * 
- *     def __str__(self):
- */
-  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_this_class_cannot_be_instantiate); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__79);
-  __Pyx_GIVEREF(__pyx_tuple__79);
-
-  /* "pysam/calignmentfile.pyx":113
- * else:
- *     CIGAR2CODE = dict( [ord(y),x] for x,y in enumerate( CODE2CIGAR) )
- * CIGAR_REGEX = re.compile( "(\d+)([MIDNSHP=X])" )             # <<<<<<<<<<<<<<
- * 
- * #####################################################################
- */
-  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_d_MIDNSHP_X); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__80);
-  __Pyx_GIVEREF(__pyx_tuple__80);
-
-  /* "pysam/calignmentfile.pyx":211
- * 
- * # order of records within SAM headers
- * VALID_HEADERS = ("HD", "SQ", "RG", "PG", "CO")             # <<<<<<<<<<<<<<
- * 
- * # default type conversions within SAM header records
- */
-  __pyx_tuple__81 = PyTuple_Pack(5, __pyx_n_s_HD, __pyx_n_s_SQ, __pyx_n_s_RG, __pyx_n_s_PG, __pyx_n_s_CO); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__81);
-  __Pyx_GIVEREF(__pyx_tuple__81);
-
-  /* "pysam/calignmentfile.pyx":225
- * 
- * # output order of fields within records
- * VALID_HEADER_ORDER = {"HD" : ("VN", "SO", "GO"),             # <<<<<<<<<<<<<<
- *                       "SQ" : ("SN", "LN", "AS", "M5",
- *                                "UR", "SP"),
- */
-  __pyx_tuple__82 = PyTuple_Pack(3, __pyx_n_s_VN, __pyx_n_s_SO, __pyx_n_s_GO); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__82);
-  __Pyx_GIVEREF(__pyx_tuple__82);
-
-  /* "pysam/calignmentfile.pyx":226
- * # output order of fields within records
- * VALID_HEADER_ORDER = {"HD" : ("VN", "SO", "GO"),
- *                       "SQ" : ("SN", "LN", "AS", "M5",             # <<<<<<<<<<<<<<
- *                                "UR", "SP"),
- *                       "RG" : ("ID", "SM", "LB", "DS",
- */
-  __pyx_tuple__83 = PyTuple_Pack(6, __pyx_n_s_SN, __pyx_n_s_LN, __pyx_n_s_AS, __pyx_n_s_M5, __pyx_n_s_UR, __pyx_n_s_SP); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__83);
-  __Pyx_GIVEREF(__pyx_tuple__83);
-
-  /* "pysam/calignmentfile.pyx":228
- *                       "SQ" : ("SN", "LN", "AS", "M5",
- *                                "UR", "SP"),
- *                       "RG" : ("ID", "SM", "LB", "DS",             # <<<<<<<<<<<<<<
- *                               "PU", "PI", "CN", "DT",
- *                               "PL", "FO", "KS", "PG"),
- */
-  __pyx_tuple__84 = PyTuple_Pack(12, __pyx_n_s_ID, __pyx_n_s_SM, __pyx_n_s_LB, __pyx_n_s_DS, __pyx_n_s_PU, __pyx_n_s_PI, __pyx_n_s_CN, __pyx_n_s_DT, __pyx_n_s_PL, __pyx_n_s_FO, __pyx_n_s_KS, __pyx_n_s_PG); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__84);
-  __Pyx_GIVEREF(__pyx_tuple__84);
-
-  /* "pysam/calignmentfile.pyx":231
- *                               "PU", "PI", "CN", "DT",
- *                               "PL", "FO", "KS", "PG"),
- *                       "PG" : ("PN", "ID", "VN", "CL",             # <<<<<<<<<<<<<<
- *                               "PP"),}
- * 
- */
-  __pyx_tuple__85 = PyTuple_Pack(5, __pyx_n_s_PN, __pyx_n_s_ID, __pyx_n_s_VN, __pyx_n_s_CL, __pyx_n_s_PP); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__85);
-  __Pyx_GIVEREF(__pyx_tuple__85);
-
-  /* "pysam/calignmentfile.pyx":2052
- * 
- * 
- * def toQualityString(qualities):             # <<<<<<<<<<<<<<
- *     '''convert a list of quality score to the string
- *     representation used in the SAM format.'''
- */
-  __pyx_tuple__86 = PyTuple_Pack(2, __pyx_n_s_qualities, __pyx_n_s_x); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__86);
-  __Pyx_GIVEREF(__pyx_tuple__86);
-  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_toQualityString, 2052, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":2060
- * 
- * 
- * def fromQualityString(quality_string):             # <<<<<<<<<<<<<<
- *     '''return a list of quality scores from the
- *     stringn representation of quality scores used
- */
-  __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_quality_string, __pyx_n_s_x); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__88);
-  __Pyx_GIVEREF(__pyx_tuple__88);
-  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_fromQualityString, 2060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __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_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_8000 = PyInt_FromLong(8000); if (unlikely(!__pyx_int_8000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_32768 = PyInt_FromLong(32768L); if (unlikely(!__pyx_int_32768)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_65535 = PyInt_FromLong(65535L); if (unlikely(!__pyx_int_65535)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_536870912 = PyInt_FromLong(536870912L); if (unlikely(!__pyx_int_536870912)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_4294967296 = PyInt_FromString((char *)"4294967296", 0, 0); if (unlikely(!__pyx_int_4294967296)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_4 = PyInt_FromLong(-4); if (unlikely(!__pyx_int_neg_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_127 = PyInt_FromLong(-127); if (unlikely(!__pyx_int_neg_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_128 = PyInt_FromLong(-128); if (unlikely(!__pyx_int_neg_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_32767 = PyInt_FromLong(-32767L); if (unlikely(!__pyx_int_neg_32767)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_32768 = PyInt_FromLong(-32768L); if (unlikely(!__pyx_int_neg_32768)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_2147483648 = PyInt_FromLong(-2147483648L); if (unlikely(!__pyx_int_neg_2147483648)) {__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 initcalignmentfile(void); /*proto*/
-PyMODINIT_FUNC initcalignmentfile(void)
-#else
-PyMODINIT_FUNC PyInit_calignmentfile(void); /*proto*/
-PyMODINIT_FUNC PyInit_calignmentfile(void)
-#endif
-{
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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_calignmentfile(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("calignmentfile"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
-  #else
-  __pyx_m = PyModule_Create(&__pyx_moduledef);
-  #endif
-  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_d);
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  if (__pyx_module_is_main_pysam__calignmentfile) {
-    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;};
-  }
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pysam.calignmentfile")) {
-      if (unlikely(PyDict_SetItemString(modules, "pysam.calignmentfile", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  /*--- 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_5pysam_14calignmentfile__FILENAME_ENCODING = ((PyObject*)Py_None); Py_INCREF(Py_None);
-  /*--- Variable export code ---*/
-  /*--- Function export code ---*/
-  /*--- Type init code ---*/
-  __pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment = &__pyx_vtable_5pysam_14calignmentfile_AlignedSegment;
-  __pyx_vtable_5pysam_14calignmentfile_AlignedSegment.setTag = (PyObject *(*)(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag *__pyx_optional_args))__pyx_f_5pysam_14calignmentfile_14AlignedSegment_setTag;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_AlignedSegment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_AlignedSegment.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_AlignedSegment, "__str__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_14AlignedSegment_4__str__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_14AlignedSegment_4__str__.doc = __pyx_doc_5pysam_14calignmentfile_14AlignedSegment_4__str__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_14AlignedSegment_4__str__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_AlignedSegment.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "AlignedSegment", (PyObject *)&__pyx_type_5pysam_14calignmentfile_AlignedSegment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_AlignedSegment = &__pyx_type_5pysam_14calignmentfile_AlignedSegment;
-  __pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile = &__pyx_vtable_5pysam_14calignmentfile_AlignmentFile;
-  __pyx_vtable_5pysam_14calignmentfile_AlignmentFile._buildHeader = (bam_hdr_t *(*)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, PyObject *))__pyx_f_5pysam_14calignmentfile_13AlignmentFile__buildHeader;
-  __pyx_vtable_5pysam_14calignmentfile_AlignmentFile.getCurrent = (bam1_t *(*)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *))__pyx_f_5pysam_14calignmentfile_13AlignmentFile_getCurrent;
-  __pyx_vtable_5pysam_14calignmentfile_AlignmentFile.cnext = (int (*)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *))__pyx_f_5pysam_14calignmentfile_13AlignmentFile_cnext;
-  __pyx_vtable_5pysam_14calignmentfile_AlignmentFile.write = (int (*)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *, int __pyx_skip_dispatch))__pyx_f_5pysam_14calignmentfile_13AlignmentFile_write;
-  __pyx_vtable_5pysam_14calignmentfile_AlignmentFile._getrname = (char *(*)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, int))__pyx_f_5pysam_14calignmentfile_13AlignmentFile__getrname;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_AlignmentFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_AlignmentFile.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_AlignmentFile, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_13AlignmentFile_46__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_13AlignmentFile_46__next__.doc = __pyx_doc_5pysam_14calignmentfile_13AlignmentFile_46__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_13AlignmentFile_46__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_AlignmentFile.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "AlignmentFile", (PyObject *)&__pyx_type_5pysam_14calignmentfile_AlignmentFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_AlignmentFile = &__pyx_type_5pysam_14calignmentfile_AlignmentFile;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_PileupColumn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_PileupColumn.tp_print = 0;
-  if (__Pyx_SetAttrString(__pyx_m, "PileupColumn", (PyObject *)&__pyx_type_5pysam_14calignmentfile_PileupColumn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_PileupColumn = &__pyx_type_5pysam_14calignmentfile_PileupColumn;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_PileupRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_PileupRead.tp_print = 0;
-  if (__Pyx_SetAttrString(__pyx_m, "PileupRead", (PyObject *)&__pyx_type_5pysam_14calignmentfile_PileupRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_PileupRead = &__pyx_type_5pysam_14calignmentfile_PileupRead;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorRow) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorRow.tp_print = 0;
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorRow", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRow) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRow = &__pyx_type_5pysam_14calignmentfile_IteratorRow;
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion = &__pyx_vtable_5pysam_14calignmentfile_IteratorRowRegion;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorRowRegion.getCurrent = (bam1_t *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *))__pyx_f_5pysam_14calignmentfile_17IteratorRowRegion_getCurrent;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorRowRegion.cnext = (int (*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *))__pyx_f_5pysam_14calignmentfile_17IteratorRowRegion_cnext;
-  __pyx_type_5pysam_14calignmentfile_IteratorRowRegion.tp_base = __pyx_ptype_5pysam_14calignmentfile_IteratorRow;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorRowRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorRowRegion.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowRegion, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_17IteratorRowRegion_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_17IteratorRowRegion_4__next__.doc = __pyx_doc_5pysam_14calignmentfile_17IteratorRowRegion_4__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_17IteratorRowRegion_4__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_IteratorRowRegion.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorRowRegion", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion = &__pyx_type_5pysam_14calignmentfile_IteratorRowRegion;
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead = &__pyx_vtable_5pysam_14calignmentfile_IteratorRowHead;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorRowHead.getCurrent = (bam1_t *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *))__pyx_f_5pysam_14calignmentfile_15IteratorRowHead_getCurrent;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorRowHead.cnext = (int (*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *))__pyx_f_5pysam_14calignmentfile_15IteratorRowHead_cnext;
-  __pyx_type_5pysam_14calignmentfile_IteratorRowHead.tp_base = __pyx_ptype_5pysam_14calignmentfile_IteratorRow;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorRowHead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorRowHead.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowHead, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_15IteratorRowHead_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_15IteratorRowHead_4__next__.doc = __pyx_doc_5pysam_14calignmentfile_15IteratorRowHead_4__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_15IteratorRowHead_4__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_IteratorRowHead.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorRowHead", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowHead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowHead = &__pyx_type_5pysam_14calignmentfile_IteratorRowHead;
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll = &__pyx_vtable_5pysam_14calignmentfile_IteratorRowAll;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorRowAll.getCurrent = (bam1_t *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *))__pyx_f_5pysam_14calignmentfile_14IteratorRowAll_getCurrent;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorRowAll.cnext = (int (*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *))__pyx_f_5pysam_14calignmentfile_14IteratorRowAll_cnext;
-  __pyx_type_5pysam_14calignmentfile_IteratorRowAll.tp_base = __pyx_ptype_5pysam_14calignmentfile_IteratorRow;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorRowAll) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorRowAll.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowAll, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_14IteratorRowAll_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_14IteratorRowAll_4__next__.doc = __pyx_doc_5pysam_14calignmentfile_14IteratorRowAll_4__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_14IteratorRowAll_4__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_IteratorRowAll.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorRowAll", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowAll) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowAll = &__pyx_type_5pysam_14calignmentfile_IteratorRowAll;
-  __pyx_type_5pysam_14calignmentfile_IteratorRowAllRefs.tp_base = __pyx_ptype_5pysam_14calignmentfile_IteratorRow;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorRowAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorRowAllRefs.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowAllRefs, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__.doc = __pyx_doc_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_18IteratorRowAllRefs_6__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorRowAllRefs", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs = &__pyx_type_5pysam_14calignmentfile_IteratorRowAllRefs;
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection = &__pyx_vtable_5pysam_14calignmentfile_IteratorRowSelection;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorRowSelection.getCurrent = (bam1_t *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *))__pyx_f_5pysam_14calignmentfile_20IteratorRowSelection_getCurrent;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorRowSelection.cnext = (int (*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *))__pyx_f_5pysam_14calignmentfile_20IteratorRowSelection_cnext;
-  __pyx_type_5pysam_14calignmentfile_IteratorRowSelection.tp_base = __pyx_ptype_5pysam_14calignmentfile_IteratorRow;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorRowSelection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorRowSelection.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowSelection, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_20IteratorRowSelection_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_20IteratorRowSelection_4__next__.doc = __pyx_doc_5pysam_14calignmentfile_20IteratorRowSelection_4__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_20IteratorRowSelection_4__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_IteratorRowSelection.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorRowSelection", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorRowSelection) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection = &__pyx_type_5pysam_14calignmentfile_IteratorRowSelection;
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn = &__pyx_vtable_5pysam_14calignmentfile_IteratorColumn;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorColumn.cnext = (int (*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *))__pyx_f_5pysam_14calignmentfile_14IteratorColumn_cnext;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorColumn.getSequence = (char *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *))__pyx_f_5pysam_14calignmentfile_14IteratorColumn_getSequence;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorColumn.setMask = (PyObject *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, PyObject *))__pyx_f_5pysam_14calignmentfile_14IteratorColumn_setMask;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorColumn.setupIteratorData = (PyObject *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, int, int, int, struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData *__pyx_optional_args))__pyx_f_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorColumn.reset = (PyObject *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, PyObject *, PyObject *, PyObject *))__pyx_f_5pysam_14calignmentfile_14IteratorColumn_reset;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorColumn._free_pileup_iter = (PyObject *(*)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *))__pyx_f_5pysam_14calignmentfile_14IteratorColumn__free_pileup_iter;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorColumn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorColumn.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_IteratorColumn.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorColumn", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorColumn) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorColumn = &__pyx_type_5pysam_14calignmentfile_IteratorColumn;
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion = &__pyx_vtable_5pysam_14calignmentfile_IteratorColumnRegion;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorColumnRegion.__pyx_base = *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn;
-  __pyx_type_5pysam_14calignmentfile_IteratorColumnRegion.tp_base = __pyx_ptype_5pysam_14calignmentfile_IteratorColumn;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorColumnRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorColumnRegion.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorColumnRegion, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__.doc = __pyx_doc_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_20IteratorColumnRegion_2__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_IteratorColumnRegion.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorColumnRegion", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorColumnRegion) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion = &__pyx_type_5pysam_14calignmentfile_IteratorColumnRegion;
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs = &__pyx_vtable_5pysam_14calignmentfile_IteratorColumnAllRefs;
-  __pyx_vtable_5pysam_14calignmentfile_IteratorColumnAllRefs.__pyx_base = *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn;
-  __pyx_type_5pysam_14calignmentfile_IteratorColumnAllRefs.tp_base = __pyx_ptype_5pysam_14calignmentfile_IteratorColumn;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IteratorColumnAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IteratorColumnAllRefs.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorColumnAllRefs, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__.doc = __pyx_doc_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_14calignmentfile_21IteratorColumnAllRefs_2__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_14calignmentfile_IteratorColumnAllRefs.tp_dict, __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "IteratorColumnAllRefs", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IteratorColumnAllRefs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs = &__pyx_type_5pysam_14calignmentfile_IteratorColumnAllRefs;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_IndexedReads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_IndexedReads.tp_print = 0;
-  if (__Pyx_SetAttrString(__pyx_m, "IndexedReads", (PyObject *)&__pyx_type_5pysam_14calignmentfile_IndexedReads) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IndexedReads = &__pyx_type_5pysam_14calignmentfile_IndexedReads;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile_SNPCall) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile_SNPCall.tp_print = 0;
-  if (__Pyx_SetAttrString(__pyx_m, "SNPCall", (PyObject *)&__pyx_type_5pysam_14calignmentfile_SNPCall) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_SNPCall = &__pyx_type_5pysam_14calignmentfile_SNPCall;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile___pyx_scope_struct__genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile___pyx_scope_struct__genexpr.tp_print = 0;
-  __pyx_ptype_5pysam_14calignmentfile___pyx_scope_struct__genexpr = &__pyx_type_5pysam_14calignmentfile___pyx_scope_struct__genexpr;
-  if (PyType_Ready(&__pyx_type_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr.tp_print = 0;
-  __pyx_ptype_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr = &__pyx_type_5pysam_14calignmentfile___pyx_scope_struct_1_genexpr;
-  /*--- Type import code ---*/
-  __pyx_ptype_5pysam_6cfaidx_FastaFile = __Pyx_ImportType("pysam.cfaidx", "FastaFile", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastaFile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastaFile)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6cfaidx_FastaFile = (struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_FastaFile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_FastaFile)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_FastqProxy = __Pyx_ImportType("pysam.cfaidx", "FastqProxy", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastqProxy), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastqProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_FastqFile = __Pyx_ImportType("pysam.cfaidx", "FastqFile", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastqFile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastqFile)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6cfaidx_FastqFile = (struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_FastqFile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_FastqFile)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_Fastafile = __Pyx_ImportType("pysam.cfaidx", "Fastafile", sizeof(struct __pyx_obj_5pysam_6cfaidx_Fastafile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_Fastafile)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6cfaidx_Fastafile = (struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_Fastafile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_Fastafile)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_Fastqfile = __Pyx_ImportType("pysam.cfaidx", "Fastqfile", sizeof(struct __pyx_obj_5pysam_6cfaidx_Fastqfile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_Fastqfile)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6cfaidx_Fastqfile = (struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_Fastqfile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_Fastqfile)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
-  #if CYTHON_COMPILING_IN_PYPY
-  sizeof(PyTypeObject),
-  #else
-  sizeof(PyHeapTypeObject),
-  #endif
-  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_5array_array = __Pyx_ImportType("array", "array", sizeof(arrayobject), 0); if (unlikely(!__pyx_ptype_7cpython_5array_array)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Variable import code ---*/
-  /*--- Function import code ---*/
-  /*--- Execution code ---*/
-
-  /* "pysam/calignmentfile.pyx":4
- * # cython: profile=True
- * # adds doc-strings for sphinx
- * import tempfile             # <<<<<<<<<<<<<<
- * import os
- * import sys
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":5
- * # adds doc-strings for sphinx
- * import tempfile
- * import os             # <<<<<<<<<<<<<<
- * import sys
- * import types
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":6
- * import tempfile
- * import os
- * import sys             # <<<<<<<<<<<<<<
- * import types
- * import itertools
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":7
- * import os
- * import sys
- * import types             # <<<<<<<<<<<<<<
- * import itertools
- * import struct
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_types, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":8
- * import sys
- * import types
- * import itertools             # <<<<<<<<<<<<<<
- * import struct
- * import ctypes
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":9
- * import types
- * import itertools
- * import struct             # <<<<<<<<<<<<<<
- * import ctypes
- * import collections
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":10
- * import itertools
- * import struct
- * import ctypes             # <<<<<<<<<<<<<<
- * import collections
- * import re
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":11
- * import struct
- * import ctypes
- * import collections             # <<<<<<<<<<<<<<
- * import re
- * import platform
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":12
- * import ctypes
- * import collections
- * import re             # <<<<<<<<<<<<<<
- * import platform
- * import warnings
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":13
- * import collections
- * import re
- * import platform             # <<<<<<<<<<<<<<
- * import warnings
- * import array
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_platform, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":14
- * import re
- * import platform
- * import warnings             # <<<<<<<<<<<<<<
- * import array
- * 
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":15
- * import platform
- * import warnings
- * import array             # <<<<<<<<<<<<<<
- * 
- * from cpython cimport PyErr_SetString, \
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_array, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":31
- * ## Python 3 compatibility functions
- * ########################################################################
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3             # <<<<<<<<<<<<<<
- * cdef from_string_and_size(char* s, size_t length):
- *     if PY_MAJOR_VERSION < 3:
- */
-  __pyx_t_1 = __Pyx_PyBool_FromLong((PY_MAJOR_VERSION >= 3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IS_PYTHON3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":40
- * # filename encoding (copied from lxml.etree.pyx)
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_XGOTREF(__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":41
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- */
-  __pyx_t_3 = (__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_4 = (__pyx_t_3 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/calignmentfile.pyx":42
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XGOTREF(__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L2;
-  }
-  __pyx_L2:;
-
-  /* "pysam/calignmentfile.pyx":43
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = 'ascii'
- * 
- */
-  __pyx_t_4 = (__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_3 = (__pyx_t_4 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":44
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'             # <<<<<<<<<<<<<<
- * 
- * #cdef char* _C_FILENAME_ENCODING
- */
-    __Pyx_INCREF(__pyx_n_s_ascii);
-    __Pyx_XGOTREF(__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_14calignmentfile__FILENAME_ENCODING, __pyx_n_s_ascii);
-    __Pyx_GIVEREF(__pyx_n_s_ascii);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/calignmentfile.pyx":108
- * DEF SEEK_END = 2
- * 
- * cdef char* CODE2CIGAR= "MIDNSHP=X"             # <<<<<<<<<<<<<<
- * if IS_PYTHON3:
- *     CIGAR2CODE = dict( [y,x] for x,y in enumerate( CODE2CIGAR) )
- */
-  __pyx_v_5pysam_14calignmentfile_CODE2CIGAR = __pyx_k_MIDNSHP_X;
-
-  /* "pysam/calignmentfile.pyx":109
- * 
- * cdef char* CODE2CIGAR= "MIDNSHP=X"
- * if IS_PYTHON3:             # <<<<<<<<<<<<<<
- *     CIGAR2CODE = dict( [y,x] for x,y in enumerate( CODE2CIGAR) )
- * else:
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_IS_PYTHON3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_3) {
-
-    /* "pysam/calignmentfile.pyx":110
- * cdef char* CODE2CIGAR= "MIDNSHP=X"
- * if IS_PYTHON3:
- *     CIGAR2CODE = dict( [y,x] for x,y in enumerate( CODE2CIGAR) )             # <<<<<<<<<<<<<<
- * else:
- *     CIGAR2CODE = dict( [ord(y),x] for x,y in enumerate( CODE2CIGAR) )
- */
-    __pyx_t_1 = __pyx_pf_5pysam_14calignmentfile_4genexpr(NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (PyDict_SetItem(__pyx_d, __pyx_n_s_CIGAR2CODE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    goto __pyx_L4;
-  }
-  /*else*/ {
-
-    /* "pysam/calignmentfile.pyx":112
- *     CIGAR2CODE = dict( [y,x] for x,y in enumerate( CODE2CIGAR) )
- * else:
- *     CIGAR2CODE = dict( [ord(y),x] for x,y in enumerate( CODE2CIGAR) )             # <<<<<<<<<<<<<<
- * CIGAR_REGEX = re.compile( "(\d+)([MIDNSHP=X])" )
- * 
- */
-    __pyx_t_1 = __pyx_pf_5pysam_14calignmentfile_7genexpr(NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (PyDict_SetItem(__pyx_d, __pyx_n_s_CIGAR2CODE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-  __pyx_L4:;
-
-  /* "pysam/calignmentfile.pyx":113
- * else:
- *     CIGAR2CODE = dict( [ord(y),x] for x,y in enumerate( CODE2CIGAR) )
- * CIGAR_REGEX = re.compile( "(\d+)([MIDNSHP=X])" )             # <<<<<<<<<<<<<<
- * 
- * #####################################################################
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CIGAR_REGEX, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":117
- * #####################################################################
- * # hard-coded constants
- * cdef int max_pos = 2 << 29             # <<<<<<<<<<<<<<
- * 
- * #####################################################################
- */
-  __pyx_v_5pysam_14calignmentfile_max_pos = 1073741824;
-
-  /* "pysam/calignmentfile.pyx":204
- * 
- * # valid types for SAM headers
- * VALID_HEADER_TYPES = {"HD" : dict,             # <<<<<<<<<<<<<<
- *                       "SQ" : list,
- *                       "RG" : list,
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_HD, ((PyObject *)((PyObject*)(&PyDict_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":205
- * # valid types for SAM headers
- * VALID_HEADER_TYPES = {"HD" : dict,
- *                       "SQ" : list,             # <<<<<<<<<<<<<<
- *                       "RG" : list,
- *                       "PG" : list,
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_SQ, ((PyObject *)((PyObject*)(&PyList_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":206
- * VALID_HEADER_TYPES = {"HD" : dict,
- *                       "SQ" : list,
- *                       "RG" : list,             # <<<<<<<<<<<<<<
- *                       "PG" : list,
- *                       "CO" : list}
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_RG, ((PyObject *)((PyObject*)(&PyList_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":207
- *                       "SQ" : list,
- *                       "RG" : list,
- *                       "PG" : list,             # <<<<<<<<<<<<<<
- *                       "CO" : list}
- * 
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_PG, ((PyObject *)((PyObject*)(&PyList_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":208
- *                       "RG" : list,
- *                       "PG" : list,
- *                       "CO" : list}             # <<<<<<<<<<<<<<
- * 
- * # order of records within SAM headers
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_CO, ((PyObject *)((PyObject*)(&PyList_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VALID_HEADER_TYPES, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":211
- * 
- * # order of records within SAM headers
- * VALID_HEADERS = ("HD", "SQ", "RG", "PG", "CO")             # <<<<<<<<<<<<<<
- * 
- * # default type conversions within SAM header records
- */
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VALID_HEADERS, __pyx_tuple__81) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":214
- * 
- * # default type conversions within SAM header records
- * VALID_HEADER_FIELDS = {"HD" : {"VN" : str, "SO" : str, "GO" : str},             # <<<<<<<<<<<<<<
- *                        "SQ" : {"SN" : str, "LN" : int, "AS" : str,
- *                                "M5" : str, "SP" : str, "UR" : str,},
- */
-  __pyx_t_1 = PyDict_New(); 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 = PyDict_New(); 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);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_VN, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_SO, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_GO, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_HD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":215
- * # default type conversions within SAM header records
- * VALID_HEADER_FIELDS = {"HD" : {"VN" : str, "SO" : str, "GO" : str},
- *                        "SQ" : {"SN" : str, "LN" : int, "AS" : str,             # <<<<<<<<<<<<<<
- *                                "M5" : str, "SP" : str, "UR" : str,},
- *                        "RG" : {"ID" : str, "CN" : str, "DS" : str,
- */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_SN, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_LN, ((PyObject *)((PyObject*)(&PyInt_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_AS, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":216
- * VALID_HEADER_FIELDS = {"HD" : {"VN" : str, "SO" : str, "GO" : str},
- *                        "SQ" : {"SN" : str, "LN" : int, "AS" : str,
- *                                "M5" : str, "SP" : str, "UR" : str,},             # <<<<<<<<<<<<<<
- *                        "RG" : {"ID" : str, "CN" : str, "DS" : str,
- *                                "DT" : str, "FO" : str, "KS" : str,
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_M5, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_SP, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_UR, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_SQ, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":217
- *                        "SQ" : {"SN" : str, "LN" : int, "AS" : str,
- *                                "M5" : str, "SP" : str, "UR" : str,},
- *                        "RG" : {"ID" : str, "CN" : str, "DS" : str,             # <<<<<<<<<<<<<<
- *                                "DT" : str, "FO" : str, "KS" : str,
- *                                "LB" : str, "PG" : str, "PI" : str,
- */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ID, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_CN, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_DS, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":218
- *                                "M5" : str, "SP" : str, "UR" : str,},
- *                        "RG" : {"ID" : str, "CN" : str, "DS" : str,
- *                                "DT" : str, "FO" : str, "KS" : str,             # <<<<<<<<<<<<<<
- *                                "LB" : str, "PG" : str, "PI" : str,
- *                                "PL" : str, "PU" : str, "SM" : str,},
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_DT, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_FO, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_KS, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":219
- *                        "RG" : {"ID" : str, "CN" : str, "DS" : str,
- *                                "DT" : str, "FO" : str, "KS" : str,
- *                                "LB" : str, "PG" : str, "PI" : str,             # <<<<<<<<<<<<<<
- *                                "PL" : str, "PU" : str, "SM" : str,},
- *                        "PG" : {"ID" : str, "PN" : str, "CL" : str,
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_LB, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_PG, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_PI, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":220
- *                                "DT" : str, "FO" : str, "KS" : str,
- *                                "LB" : str, "PG" : str, "PI" : str,
- *                                "PL" : str, "PU" : str, "SM" : str,},             # <<<<<<<<<<<<<<
- *                        "PG" : {"ID" : str, "PN" : str, "CL" : str,
- *                                "PP" : str, "DS" : str, "VN" : str,},}
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_PL, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_PU, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_SM, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_RG, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/calignmentfile.pyx":221
- *                                "LB" : str, "PG" : str, "PI" : str,
- *                                "PL" : str, "PU" : str, "SM" : str,},
- *                        "PG" : {"ID" : str, "PN" : str, "CL" : str,             # <<<<<<<<<<<<<<
- *                                "PP" : str, "DS" : str, "VN" : str,},}
- * 
- */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ID, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_PN, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_CL, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":222
- *                                "PL" : str, "PU" : str, "SM" : str,},
- *                        "PG" : {"ID" : str, "PN" : str, "CL" : str,
- *                                "PP" : str, "DS" : str, "VN" : str,},}             # <<<<<<<<<<<<<<
- * 
- * # output order of fields within records
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_PP, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_DS, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_VN, ((PyObject *)((PyObject*)(&PyString_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_PG, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VALID_HEADER_FIELDS, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":225
- * 
- * # output order of fields within records
- * VALID_HEADER_ORDER = {"HD" : ("VN", "SO", "GO"),             # <<<<<<<<<<<<<<
- *                       "SQ" : ("SN", "LN", "AS", "M5",
- *                                "UR", "SP"),
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_HD, __pyx_tuple__82) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":226
- * # output order of fields within records
- * VALID_HEADER_ORDER = {"HD" : ("VN", "SO", "GO"),
- *                       "SQ" : ("SN", "LN", "AS", "M5",             # <<<<<<<<<<<<<<
- *                                "UR", "SP"),
- *                       "RG" : ("ID", "SM", "LB", "DS",
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_SQ, __pyx_tuple__83) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":228
- *                       "SQ" : ("SN", "LN", "AS", "M5",
- *                                "UR", "SP"),
- *                       "RG" : ("ID", "SM", "LB", "DS",             # <<<<<<<<<<<<<<
- *                               "PU", "PI", "CN", "DT",
- *                               "PL", "FO", "KS", "PG"),
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_RG, __pyx_tuple__84) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/calignmentfile.pyx":231
- *                               "PU", "PI", "CN", "DT",
- *                               "PL", "FO", "KS", "PG"),
- *                       "PG" : ("PN", "ID", "VN", "CL",             # <<<<<<<<<<<<<<
- *                               "PP"),}
- * 
- */
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_PG, __pyx_tuple__85) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VALID_HEADER_ORDER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1891
- *                   int tid = 0,
- *                   int start = 0,
- *                   int end = max_pos,             # <<<<<<<<<<<<<<
- *                   int truncate = False,
- *                   **kwargs ):
- */
-  __pyx_k__62 = __pyx_v_5pysam_14calignmentfile_max_pos;
-
-  /* "pysam/calignmentfile.pyx":2052
- * 
- * 
- * def toQualityString(qualities):             # <<<<<<<<<<<<<<
- *     '''convert a list of quality score to the string
- *     representation used in the SAM format.'''
- */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysam_14calignmentfile_1toQualityString, NULL, __pyx_n_s_pysam_calignmentfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_toQualityString, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":2060
- * 
- * 
- * def fromQualityString(quality_string):             # <<<<<<<<<<<<<<
- *     '''return a list of quality scores from the
- *     stringn representation of quality scores used
- */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysam_14calignmentfile_3fromQualityString, NULL, __pyx_n_s_pysam_calignmentfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromQualityString, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":3666
- *             bam_hdr_destroy(self.header)
- * 
- * __all__ = ["AlignmentFile",             # <<<<<<<<<<<<<<
- *            "IteratorRow",
- *            "IteratorColumn",
- */
-  __pyx_t_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_n_s_AlignmentFile);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AlignmentFile);
-  __Pyx_GIVEREF(__pyx_n_s_AlignmentFile);
-  __Pyx_INCREF(__pyx_n_s_IteratorRow);
-  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_IteratorRow);
-  __Pyx_GIVEREF(__pyx_n_s_IteratorRow);
-  __Pyx_INCREF(__pyx_n_s_IteratorColumn);
-  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_IteratorColumn);
-  __Pyx_GIVEREF(__pyx_n_s_IteratorColumn);
-  __Pyx_INCREF(__pyx_n_s_AlignedSegment);
-  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_AlignedSegment);
-  __Pyx_GIVEREF(__pyx_n_s_AlignedSegment);
-  __Pyx_INCREF(__pyx_n_s_PileupColumn);
-  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_PileupColumn);
-  __Pyx_GIVEREF(__pyx_n_s_PileupColumn);
-  __Pyx_INCREF(__pyx_n_s_PileupRead);
-  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_PileupRead);
-  __Pyx_GIVEREF(__pyx_n_s_PileupRead);
-  __Pyx_INCREF(__pyx_n_s_IndexedReads);
-  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_IndexedReads);
-  __Pyx_GIVEREF(__pyx_n_s_IndexedReads);
-  __Pyx_INCREF(__pyx_n_s_toQualityString);
-  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_toQualityString);
-  __Pyx_GIVEREF(__pyx_n_s_toQualityString);
-  __Pyx_INCREF(__pyx_n_s_fromQualityString);
-  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_fromQualityString);
-  __Pyx_GIVEREF(__pyx_n_s_fromQualityString);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/calignmentfile.pyx":1
- * # cython: embedsignature=True             # <<<<<<<<<<<<<<
- * # cython: profile=True
- * # adds doc-strings for sphinx
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "array.pxd":159
- *     return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
- * 
- * cdef inline void zero(array self):             # <<<<<<<<<<<<<<
- *     """ set all elements of array to zero. """
- *     memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
- */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  if (__pyx_m) {
-    __Pyx_AddTraceback("init pysam.calignmentfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
-    Py_DECREF(__pyx_m); __pyx_m = 0;
-  } else if (!PyErr_Occurred()) {
-    PyErr_SetString(PyExc_ImportError, "init pysam.calignmentfile");
-  }
-  __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_GetBuiltinName(PyObject *name) {
-    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
-    if (unlikely(!result)) {
-        PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
-            "name '%U' is not defined", name);
-#else
-            "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
-    }
-    return result;
-}
-
-#if CYTHON_PROFILE
-static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
-                                   PyFrameObject** frame,
-                                   const char *funcname,
-                                   const char *srcfile,
-                                   int firstlineno) {
-    int retval;
-    PyThreadState* tstate = PyThreadState_GET();
-    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
-        if (*code == NULL) {
-            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
-            if (*code == NULL) return 0;
-        }
-        *frame = PyFrame_New(
-            tstate,                          /*PyThreadState *tstate*/
-            *code,                           /*PyCodeObject *code*/
-            __pyx_d,                  /*PyObject *globals*/
-            0                                /*PyObject *locals*/
-        );
-        if (*frame == NULL) return 0;
-        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
-            Py_INCREF(Py_None);
-            (*frame)->f_trace = Py_None;
-        }
-#if PY_VERSION_HEX < 0x030400B1
-    } else {
-        (*frame)->f_tstate = tstate;
-#endif
-    }
-    (*frame)->f_lineno = firstlineno;
-    tstate->use_tracing = 0;
-    #if CYTHON_TRACE
-    if (tstate->c_tracefunc)
-        tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL);
-    if (!tstate->c_profilefunc)
-        retval = 1;
-    else
-    #endif
-        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
-    tstate->use_tracing = (tstate->c_profilefunc ||
-                           (CYTHON_TRACE && tstate->c_tracefunc));
-    return tstate->use_tracing && retval;
-}
-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 */
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyObject *result;
-    ternaryfunc call = func->ob_type->tp_call;
-    if (unlikely(!call))
-        return PyObject_Call(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
-        return NULL;
-#endif
-    result = (*call)(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    Py_LeaveRecursiveCall();
-#endif
-    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
-        PyErr_SetString(
-            PyExc_SystemError,
-            "NULL result without error in PyObject_Call");
-    }
-    return result;
-}
-#endif
-
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
-         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
-         const char* encoding, const char* errors,
-         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
-    Py_ssize_t length;
-    if (unlikely((start < 0) | (stop < 0))) {
-        length = strlen(cstring);
-        if (start < 0) {
-            start += length;
-            if (start < 0)
-                start = 0;
-        }
-        if (stop < 0)
-            stop += length;
-    }
-    length = stop - start;
-    if (unlikely(length <= 0))
-        return PyUnicode_FromUnicode(NULL, 0);
-    cstring += start;
-    if (decode_func) {
-        return decode_func(cstring, length, errors);
-    } else {
-        return PyUnicode_Decode(cstring, length, encoding, errors);
-    }
-}
-
-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);
-    if (!value || value == Py_None)
-        value = NULL;
-    else
-        Py_INCREF(value);
-    if (!tb || tb == Py_None)
-        tb = NULL;
-    else {
-        Py_INCREF(tb);
-        if (!PyTraceBack_Check(tb)) {
-            PyErr_SetString(PyExc_TypeError,
-                "raise: arg 3 must be a traceback or None");
-            goto raise_error;
-        }
-    }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
-    if (PyType_Check(type)) {
-    #endif
-#if CYTHON_COMPILING_IN_PYPY
-        if (!value) {
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-#endif
-        PyErr_NormalizeException(&type, &value, &tb);
-    } else {
-        if (value) {
-            PyErr_SetString(PyExc_TypeError,
-                "instance exception may not have a separate value");
-            goto raise_error;
-        }
-        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) {
-    PyObject* owned_instance = NULL;
-    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)) {
-        PyObject *instance_class = NULL;
-        if (value && PyExceptionInstance_Check(value)) {
-            instance_class = (PyObject*) Py_TYPE(value);
-            if (instance_class != type) {
-                if (PyObject_IsSubclass(instance_class, type)) {
-                    type = instance_class;
-                } else {
-                    instance_class = NULL;
-                }
-            }
-        }
-        if (!instance_class) {
-            PyObject *args;
-            if (!value)
-                args = PyTuple_New(0);
-            else if (PyTuple_Check(value)) {
-                Py_INCREF(value);
-                args = value;
-            } else
-                args = PyTuple_Pack(1, value);
-            if (!args)
-                goto bad;
-            owned_instance = PyObject_Call(type, args, NULL);
-            Py_DECREF(args);
-            if (!owned_instance)
-                goto bad;
-            value = owned_instance;
-            if (!PyExceptionInstance_Check(value)) {
-                PyErr_Format(PyExc_TypeError,
-                             "calling %R should have returned an instance of "
-                             "BaseException, not %R",
-                             type, Py_TYPE(value));
-                goto bad;
-            }
-        }
-    } else {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: exception class must be a subclass of BaseException");
-        goto bad;
-    }
-#if PY_VERSION_HEX >= 0x03030000
-    if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
-        PyObject *fixed_cause;
-        if (cause == Py_None) {
-            fixed_cause = NULL;
-        } else 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;
-        }
-        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:
-    Py_XDECREF(owned_instance);
-    return;
-}
-#endif
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
-    if (unlikely(!type)) {
-        PyErr_SetString(PyExc_SystemError, "Missing type object");
-        return 0;
-    }
-    if (likely(PyObject_TypeCheck(obj, type)))
-        return 1;
-    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
-                 Py_TYPE(obj)->tp_name, type->tp_name);
-    return 0;
-}
-
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
-    PyObject *kwdict,
-    const char* function_name,
-    int kw_allowed)
-{
-    PyObject* key = 0;
-    Py_ssize_t pos = 0;
-#if CPYTHON_COMPILING_IN_PYPY
-    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
-        goto invalid_keyword;
-    return 1;
-#else
-    while (PyDict_Next(kwdict, &pos, &key, 0)) {
-        #if PY_MAJOR_VERSION < 3
-        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
-        #endif
-            if (unlikely(!PyUnicode_Check(key)))
-                goto invalid_keyword_type;
-    }
-    if ((!kw_allowed) && unlikely(key))
-        goto invalid_keyword;
-    return 1;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    return 0;
-#endif
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-    return 0;
-}
-
-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_AsString(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;
-            continue;
-        }
-        name = first_kw_arg;
-        #if PY_MAJOR_VERSION < 3
-        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
-            while (*name) {
-                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
-                        && _PyString_Eq(**name, key)) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    if ((**argname == key) || (
-                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
-                             && _PyString_Eq(**argname, key))) {
-                        goto arg_passed_twice;
-                    }
-                    argname++;
-                }
-            }
-        } else
-        #endif
-        if (likely(PyUnicode_Check(key))) {
-            while (*name) {
-                int cmp = (**name == key) ? 0 :
-                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
-                #endif
-                    PyUnicode_Compare(**name, key);
-                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                if (cmp == 0) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    int cmp = (**argname == key) ? 0 :
-                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
-                    #endif
-                        PyUnicode_Compare(**argname, key);
-                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                    if (cmp == 0) goto arg_passed_twice;
-                    argname++;
-                }
-            }
-        } else
-            goto invalid_keyword_type;
-        if (kwds2) {
-            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
-        } else {
-            goto invalid_keyword;
-        }
-    }
-    return 0;
-arg_passed_twice:
-    __Pyx_RaiseDoubleKeywordsError(function_name, key);
-    goto bad;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    goto bad;
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-bad:
-    return -1;
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
-    const char* func_name,
-    int exact,
-    Py_ssize_t num_min,
-    Py_ssize_t num_max,
-    Py_ssize_t num_found)
-{
-    Py_ssize_t num_expected;
-    const char *more_or_less;
-    if (num_found < num_min) {
-        num_expected = num_min;
-        more_or_less = "at least";
-    } else {
-        num_expected = num_max;
-        more_or_less = "at most";
-    }
-    if (exact) {
-        more_or_less = "exactly";
-    }
-    PyErr_Format(PyExc_TypeError,
-                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
-                 func_name, more_or_less, num_expected,
-                 (num_expected == 1) ? "" : "s", num_found);
-}
-
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
-}
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact)
-{
-    if (unlikely(!type)) {
-        PyErr_SetString(PyExc_SystemError, "Missing type object");
-        return 0;
-    }
-    if (none_allowed && obj == Py_None) return 1;
-    else if (exact) {
-        if (likely(Py_TYPE(obj) == type)) return 1;
-        #if PY_MAJOR_VERSION == 2
-        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
-        #endif
-    }
-    else {
-        if (likely(PyObject_TypeCheck(obj, type))) return 1;
-    }
-    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
-    return 0;
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    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);
-#else
-    PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(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->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);
-#else
-    PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
-    PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
-    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (unlikely(tstate->curexc_type))
-#else
-    if (unlikely(PyErr_Occurred()))
-#endif
-        goto bad;
-    #if PY_MAJOR_VERSION >= 3
-    if (local_tb) {
-        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
-            goto bad;
-    }
-    #endif
-    Py_XINCREF(local_tb);
-    Py_XINCREF(local_type);
-    Py_XINCREF(local_value);
-    *type = local_type;
-    *value = local_value;
-    *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-    Py_XDECREF(tmp_type);
-    Py_XDECREF(tmp_value);
-    Py_XDECREF(tmp_tb);
-#else
-    PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
-    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 int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-    if (s1 == s2) {
-        return (equals == Py_EQ);
-    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
-        const char *ps1, *ps2;
-        Py_ssize_t length = PyBytes_GET_SIZE(s1);
-        if (length != PyBytes_GET_SIZE(s2))
-            return (equals == Py_NE);
-        ps1 = PyBytes_AS_STRING(s1);
-        ps2 = PyBytes_AS_STRING(s2);
-        if (ps1[0] != ps2[0]) {
-            return (equals == Py_NE);
-        } else if (length == 1) {
-            return (equals == Py_EQ);
-        } else {
-            int result = memcmp(ps1, ps2, (size_t)length);
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
-        return (equals == Py_NE);
-    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
-        return (equals == Py_NE);
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-#endif
-}
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-#if PY_MAJOR_VERSION < 3
-    PyObject* owned_ref = NULL;
-#endif
-    int s1_is_unicode, s2_is_unicode;
-    if (s1 == s2) {
-        goto return_eq;
-    }
-    s1_is_unicode = PyUnicode_CheckExact(s1);
-    s2_is_unicode = PyUnicode_CheckExact(s2);
-#if PY_MAJOR_VERSION < 3
-    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
-        owned_ref = PyUnicode_FromObject(s2);
-        if (unlikely(!owned_ref))
-            return -1;
-        s2 = owned_ref;
-        s2_is_unicode = 1;
-    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
-        owned_ref = PyUnicode_FromObject(s1);
-        if (unlikely(!owned_ref))
-            return -1;
-        s1 = owned_ref;
-        s1_is_unicode = 1;
-    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
-        return __Pyx_PyBytes_Equals(s1, s2, equals);
-    }
-#endif
-    if (s1_is_unicode & s2_is_unicode) {
-        Py_ssize_t length;
-        int kind;
-        void *data1, *data2;
-        #if CYTHON_PEP393_ENABLED
-        if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
-            return -1;
-        #endif
-        length = __Pyx_PyUnicode_GET_LENGTH(s1);
-        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
-            goto return_ne;
-        }
-        kind = __Pyx_PyUnicode_KIND(s1);
-        if (kind != __Pyx_PyUnicode_KIND(s2)) {
-            goto return_ne;
-        }
-        data1 = __Pyx_PyUnicode_DATA(s1);
-        data2 = __Pyx_PyUnicode_DATA(s2);
-        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
-            goto return_ne;
-        } else if (length == 1) {
-            goto return_eq;
-        } else {
-            int result = memcmp(data1, data2, length * kind);
-            #if PY_MAJOR_VERSION < 3
-            Py_XDECREF(owned_ref);
-            #endif
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & s2_is_unicode) {
-        goto return_ne;
-    } else if ((s2 == Py_None) & s1_is_unicode) {
-        goto return_ne;
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-return_eq:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_EQ);
-return_ne:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_NE);
-#endif
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
-    PyObject *r;
-    if (!j) return NULL;
-    r = PyObject_GetItem(o, j);
-    Py_DECREF(j);
-    return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        PyObject *r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        PyObject *r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (is_list || PyList_CheckExact(o)) {
-        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if ((!boundscheck) || (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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
-        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    } else {
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_item)) {
-            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (likely(l >= 0)) {
-                    i += l;
-                } else {
-                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                        PyErr_Clear();
-                    else
-                        return NULL;
-                }
-            }
-            return m->sq_item(o, i);
-        }
-    }
-#else
-    if (is_list || PySequence_Check(o)) {
-        return PySequence_GetItem(o, i);
-    }
-#endif
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
-    if (likely(PyList_CheckExact(L))) {
-        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
-    } else {
-        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
-        if (unlikely(!retval))
-            return -1;
-        Py_DECREF(retval);
-    }
-    return 0;
-}
-
-#if !CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
-    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL)
-}
-#endif
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
-    PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
-    result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
-        Py_INCREF(result);
-    } else {
-#else
-    result = PyObject_GetItem(__pyx_d, name);
-    if (!result) {
-        PyErr_Clear();
-#endif
-        result = __Pyx_GetBuiltinName(name);
-    }
-    return result;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
-        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
-        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
-        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
-    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
-    if (likely(ms && ms->sq_slice)) {
-        if (!has_cstart) {
-            if (_py_start && (*_py_start != Py_None)) {
-                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
-                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
-            } else
-                cstart = 0;
-        }
-        if (!has_cstop) {
-            if (_py_stop && (*_py_stop != Py_None)) {
-                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
-                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
-            } else
-                cstop = PY_SSIZE_T_MAX;
-        }
-        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
-            Py_ssize_t l = ms->sq_length(obj);
-            if (likely(l >= 0)) {
-                if (cstop < 0) {
-                    cstop += l;
-                    if (cstop < 0) cstop = 0;
-                }
-                if (cstart < 0) {
-                    cstart += l;
-                    if (cstart < 0) cstart = 0;
-                }
-            } else {
-                if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                    PyErr_Clear();
-                else
-                    goto bad;
-            }
-        }
-        return ms->sq_slice(obj, cstart, cstop);
-    }
-#endif
-    mp = Py_TYPE(obj)->tp_as_mapping;
-    if (likely(mp && mp->mp_subscript))
-#endif
-    {
-        PyObject* result;
-        PyObject *py_slice, *py_start, *py_stop;
-        if (_py_slice) {
-            py_slice = *_py_slice;
-        } else {
-            PyObject* owned_start = NULL;
-            PyObject* owned_stop = NULL;
-            if (_py_start) {
-                py_start = *_py_start;
-            } else {
-                if (has_cstart) {
-                    owned_start = py_start = PyInt_FromSsize_t(cstart);
-                    if (unlikely(!py_start)) goto bad;
-                } else
-                    py_start = Py_None;
-            }
-            if (_py_stop) {
-                py_stop = *_py_stop;
-            } else {
-                if (has_cstop) {
-                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
-                    if (unlikely(!py_stop)) {
-                        Py_XDECREF(owned_start);
-                        goto bad;
-                    }
-                } else
-                    py_stop = Py_None;
-            }
-            py_slice = PySlice_New(py_start, py_stop, Py_None);
-            Py_XDECREF(owned_start);
-            Py_XDECREF(owned_stop);
-            if (unlikely(!py_slice)) goto bad;
-        }
-#if CYTHON_COMPILING_IN_CPYTHON
-        result = mp->mp_subscript(obj, py_slice);
-#else
-        result = PyObject_GetItem(obj, py_slice);
-#endif
-        if (!_py_slice) {
-            Py_DECREF(py_slice);
-        }
-        return result;
-    }
-    PyErr_Format(PyExc_TypeError,
-        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
-bad:
-    return NULL;
-}
-
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
-                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
-                                  int full_traceback) {
-    PyObject *old_exc, *old_val, *old_tb;
-    PyObject *ctx;
-    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
-    if (full_traceback) {
-        Py_XINCREF(old_exc);
-        Py_XINCREF(old_val);
-        Py_XINCREF(old_tb);
-        __Pyx_ErrRestore(old_exc, old_val, old_tb);
-        PyErr_PrintEx(1);
-    }
-    #if PY_MAJOR_VERSION < 3
-    ctx = PyString_FromString(name);
-    #else
-    ctx = PyUnicode_FromString(name);
-    #endif
-    __Pyx_ErrRestore(old_exc, old_val, old_tb);
-    if (!ctx) {
-        PyErr_WriteUnraisable(Py_None);
-    } else {
-        PyErr_WriteUnraisable(ctx);
-        Py_DECREF(ctx);
-    }
-}
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
-    PyErr_Format(PyExc_ValueError,
-                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
-    PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
-                 index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyThreadState *tstate = PyThreadState_GET();
-    PyObject* exc_type = tstate->curexc_type;
-    if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
-            PyObject *exc_value, *exc_tb;
-            exc_value = tstate->curexc_value;
-            exc_tb = tstate->curexc_traceback;
-            tstate->curexc_type = 0;
-            tstate->curexc_value = 0;
-            tstate->curexc_traceback = 0;
-            Py_DECREF(exc_type);
-            Py_XDECREF(exc_value);
-            Py_XDECREF(exc_tb);
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#endif
-}
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
-    if (unlikely(retval)) {
-        Py_DECREF(retval);
-        __Pyx_RaiseTooManyValuesError(expected);
-        return -1;
-    } else {
-        return __Pyx_IterFinish();
-    }
-    return 0;
-}
-
-static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
-    PyObject* value;
-#if PY_MAJOR_VERSION >= 3
-    value = PyDict_GetItemWithError(d, key);
-    if (unlikely(!value)) {
-        if (unlikely(PyErr_Occurred()))
-            return NULL;
-        value = default_value;
-    }
-    Py_INCREF(value);
-#else
-    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
-        value = PyDict_GetItem(d, key);
-        if (unlikely(!value)) {
-            value = default_value;
-        }
-        Py_INCREF(value);
-    } else {
-        if (default_value == Py_None)
-            default_value = NULL;
-        value = PyObject_CallMethodObjArgs(
-            d, __pyx_n_s_get, key, default_value, NULL);
-    }
-#endif
-    return value;
-}
-
-static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
-    long q = a / b;
-    long r = a - q*b;
-    q -= ((r != 0) & ((r ^ b) < 0));
-    return q;
-}
-
-static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
-    long r = a % b;
-    r += ((r != 0) & ((r ^ b) < 0)) * b;
-    return r;
-}
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
-    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
-}
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
-    PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
-    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
-    if (!ob)
-        goto bad;
-    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
-        goto bad;
-    Py_DECREF(ob);
-    return 0;
-bad:
-    Py_XDECREF(ob);
-    return -1;
-}
-
-static void* __Pyx_GetVtable(PyObject *dict) {
-    void* ptr;
-    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_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;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
-    PyObject *empty_list = 0;
-    PyObject *module = 0;
-    PyObject *global_dict = 0;
-    PyObject *empty_dict = 0;
-    PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
-    PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
-    if (!py_import)
-        goto bad;
-    #endif
-    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, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                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);
-                #else
-                module = PyImport_ImportModuleLevelObject(
-                    name, global_dict, empty_dict, list, 1);
-                #endif
-                if (!module) {
-                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
-                        goto bad;
-                    PyErr_Clear();
-                }
-            }
-            level = 0; /* try absolute import on failure */
-        }
-        #endif
-        if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
-            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
-            module = PyImport_ImportModuleLevelObject(
-                name, global_dict, empty_dict, list, level);
-            #endif
-        }
-    }
-    #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:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
-}
-
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
-    {                                                                     \
-        func_type value = func(x);                                        \
-        if (sizeof(target_type) < sizeof(func_type)) {                    \
-            if (unlikely(value != (func_type) (target_type) value)) {     \
-                func_type zero = 0;                                       \
-                PyErr_SetString(PyExc_OverflowError,                      \
-                    (is_unsigned && unlikely(value < zero)) ?             \
-                    "can't convert negative value to " #target_type :     \
-                    "value too large to convert to " #target_type);       \
-                return (target_type) -1;                                  \
-            }                                                             \
-        }                                                                 \
-        return (target_type) value;                                       \
-    }
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
-    const uint64_t neg_one = (uint64_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(uint64_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint64_t");
-                return (uint64_t) -1;
-            }
-            return (uint64_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint64_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (uint64_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint64_t");
-                return (uint64_t) -1;
-            }
-            if (sizeof(uint64_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(uint64_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint64_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(uint64_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(uint64_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(uint64_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(uint64_t, long, PyLong_AsLong)
-            } else if (sizeof(uint64_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(uint64_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            uint64_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (uint64_t) -1;
-        }
-    } else {
-        uint64_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (uint64_t) -1;
-        val = __Pyx_PyInt_As_uint64_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            return (int) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            if (sizeof(int) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
-            } else if (sizeof(int) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int) -1;
-        }
-    } else {
-        int val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int) -1;
-        val = __Pyx_PyInt_As_int(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
-    const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(uint32_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint32_t");
-                return (uint32_t) -1;
-            }
-            return (uint32_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint32_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (uint32_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint32_t");
-                return (uint32_t) -1;
-            }
-            if (sizeof(uint32_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint32_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(uint32_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(uint32_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(uint32_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(uint32_t, long, PyLong_AsLong)
-            } else if (sizeof(uint32_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(uint32_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            uint32_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (uint32_t) -1;
-        }
-    } else {
-        uint32_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (uint32_t) -1;
-        val = __Pyx_PyInt_As_uint32_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) {
-    const int8_t neg_one = (int8_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int8_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int8_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int8_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int8_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int8_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int8_t),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
-    const uint8_t neg_one = (uint8_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(uint8_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(uint8_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(uint8_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint8_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
-    const int16_t neg_one = (int16_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int16_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int16_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int16_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int16_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int16_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int16_t),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
-    const uint16_t neg_one = (uint16_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(uint16_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint16_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(uint16_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(uint16_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint16_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(uint16_t),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
-    const int32_t neg_one = (int32_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int32_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int32_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int32_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int32_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int32_t),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
-    const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(uint32_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(uint32_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint32_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(long) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(long) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(long),
-                                     little, !is_unsigned);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
-    const size_t neg_one = (size_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(size_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to size_t");
-                return (size_t) -1;
-            }
-            return (size_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(size_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (size_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to size_t");
-                return (size_t) -1;
-            }
-            if (sizeof(size_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(size_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(size_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(size_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(size_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong)
-            } else if (sizeof(size_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            size_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (size_t) -1;
-        }
-    } else {
-        size_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (size_t) -1;
-        val = __Pyx_PyInt_As_size_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int),
-                                     little, !is_unsigned);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(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_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to PY_LONG_LONG");
-                return (PY_LONG_LONG) -1;
-            }
-            if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyLong_AsLong)
-            } else if (sizeof(PY_LONG_LONG) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            PY_LONG_LONG val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (PY_LONG_LONG) -1;
-        }
-    } else {
-        PY_LONG_LONG val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (PY_LONG_LONG) -1;
-        val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
-    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(PY_LONG_LONG) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
-    const int64_t neg_one = (int64_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int64_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int64_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int64_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int64_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
-    const uint64_t neg_one = (uint64_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(uint64_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(uint64_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(uint64_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint64_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
-                                     little, !is_unsigned);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
-    const int64_t neg_one = (int64_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int64_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int64_t");
-                return (int64_t) -1;
-            }
-            return (int64_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int64_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int64_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int64_t");
-                return (int64_t) -1;
-            }
-            if (sizeof(int64_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int64_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int64_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int64_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int64_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int64_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int64_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int64_t, long, PyLong_AsLong)
-            } else if (sizeof(int64_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int64_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int64_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int64_t) -1;
-        }
-    } else {
-        int64_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int64_t) -1;
-        val = __Pyx_PyInt_As_int64_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) {
-    const uint16_t neg_one = (uint16_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(uint16_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint16_t");
-                return (uint16_t) -1;
-            }
-            return (uint16_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint16_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (uint16_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint16_t");
-                return (uint16_t) -1;
-            }
-            if (sizeof(uint16_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(uint16_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint16_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(uint16_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(uint16_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(uint16_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(uint16_t, long, PyLong_AsLong)
-            } else if (sizeof(uint16_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(uint16_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            uint16_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (uint16_t) -1;
-        }
-    } else {
-        uint16_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (uint16_t) -1;
-        val = __Pyx_PyInt_As_uint16_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
-    const int32_t neg_one = (int32_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int32_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int32_t");
-                return (int32_t) -1;
-            }
-            return (int32_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int32_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int32_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int32_t");
-                return (int32_t) -1;
-            }
-            if (sizeof(int32_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int32_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int32_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int32_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int32_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int32_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int32_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int32_t, long, PyLong_AsLong)
-            } else if (sizeof(int32_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int32_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int32_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int32_t) -1;
-        }
-    } else {
-        int32_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int32_t) -1;
-        val = __Pyx_PyInt_As_int32_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
-    const uint8_t neg_one = (uint8_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(uint8_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint8_t");
-                return (uint8_t) -1;
-            }
-            return (uint8_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint8_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (uint8_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to uint8_t");
-                return (uint8_t) -1;
-            }
-            if (sizeof(uint8_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(uint8_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(uint8_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(uint8_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(uint8_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(uint8_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(uint8_t, long, PyLong_AsLong)
-            } else if (sizeof(uint8_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(uint8_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            uint8_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (uint8_t) -1;
-        }
-    } else {
-        uint8_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (uint8_t) -1;
-        val = __Pyx_PyInt_As_uint8_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
-    const char neg_one = (char) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(char) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(char) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(char) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(char) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(char) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(char),
-                                     little, !is_unsigned);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(long) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long) -1;
-            }
-            if (sizeof(long) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(long) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(long) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
-            } else if (sizeof(long) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            long val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (long) -1;
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long) -1;
-        val = __Pyx_PyInt_As_long(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
-    PyObject* fake_module;
-    PyTypeObject* cached_type = NULL;
-    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
-    if (!fake_module) return NULL;
-    Py_INCREF(fake_module);
-    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
-    if (cached_type) {
-        if (!PyType_Check((PyObject*)cached_type)) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s is not a type object",
-                type->tp_name);
-            goto bad;
-        }
-        if (cached_type->tp_basicsize != type->tp_basicsize) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s has the wrong size, try recompiling",
-                type->tp_name);
-            goto bad;
-        }
-    } else {
-        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
-        PyErr_Clear();
-        if (PyType_Ready(type) < 0) goto bad;
-        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
-            goto bad;
-        Py_INCREF(type);
-        cached_type = type;
-    }
-done:
-    Py_DECREF(fake_module);
-    return cached_type;
-bad:
-    Py_XDECREF(cached_type);
-    cached_type = NULL;
-    goto done;
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
-    PyObject *tmp_type, *tmp_value, *tmp_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
-    PyErr_SetExcInfo(*type, *value, *tb);
-#endif
-    *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 PyTypeObject *__pyx_GeneratorType = 0;
-#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
-#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
-    PyObject *et, *ev, *tb;
-    PyObject *value = NULL;
-    __Pyx_ErrFetch(&et, &ev, &tb);
-    if (!et) {
-        Py_XDECREF(tb);
-        Py_XDECREF(ev);
-        Py_INCREF(Py_None);
-        *pvalue = Py_None;
-        return 0;
-    }
-    if (unlikely(et != PyExc_StopIteration) &&
-            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
-        __Pyx_ErrRestore(et, ev, tb);
-        return -1;
-    }
-    if (likely(et == PyExc_StopIteration)) {
-        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
-            if (!ev) {
-                Py_INCREF(Py_None);
-                ev = Py_None;
-            }
-            Py_XDECREF(tb);
-            Py_DECREF(et);
-            *pvalue = ev;
-            return 0;
-        }
-    }
-    PyErr_NormalizeException(&et, &ev, &tb);
-    if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
-        __Pyx_ErrRestore(et, ev, tb);
-        return -1;
-    }
-    Py_XDECREF(tb);
-    Py_DECREF(et);
-#if PY_VERSION_HEX >= 0x030300A0
-    value = ((PyStopIterationObject *)ev)->value;
-    Py_INCREF(value);
-    Py_DECREF(ev);
-#else
-    {
-        PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args);
-        Py_DECREF(ev);
-        if (likely(args)) {
-            value = PyObject_GetItem(args, 0);
-            Py_DECREF(args);
-        }
-        if (unlikely(!value)) {
-            __Pyx_ErrRestore(NULL, NULL, NULL);
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-    }
-#endif
-    *pvalue = value;
-    return 0;
-}
-#endif
-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
-int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
-    if (unlikely(gen->is_running)) {
-        PyErr_SetString(PyExc_ValueError,
-                        "generator already executing");
-        return 1;
-    }
-    return 0;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
-    PyObject *retval;
-    assert(!self->is_running);
-    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) {
-#if CYTHON_COMPILING_IN_PYPY
-#else
-        /* Generators always return to their most recent caller, not
-         * necessarily their creator. */
-        if (self->exc_traceback) {
-            PyThreadState *tstate = PyThreadState_GET();
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_XINCREF(tstate->frame);
-            assert(f->f_back == NULL);
-            f->f_back = tstate->frame;
-        }
-#endif
-        __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);
-#if CYTHON_COMPILING_IN_PYPY
-#else
-        /* Don't keep the reference to f_back any longer than necessary.  It
-         * may keep a chain of frames alive or it could create a reference
-         * cycle. */
-        if (self->exc_traceback) {
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_CLEAR(f->f_back);
-        }
-#endif
-    } else {
-        __Pyx_Generator_ExceptionClear(self);
-    }
-    return retval;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
-    PyObject *ret;
-    PyObject *val = NULL;
-    __Pyx_Generator_Undelegate(gen);
-    __Pyx_PyGen_FetchStopIterationValue(&val);
-    ret = __Pyx_Generator_SendEx(gen, val);
-    Py_XDECREF(val);
-    return ret;
-}
-static PyObject *__Pyx_Generator_Next(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
-    PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        gen->is_running = 1;
-        ret = Py_TYPE(yf)->tp_iternext(yf);
-        gen->is_running = 0;
-        if (likely(ret)) {
-            return ret;
-        }
-        return __Pyx_Generator_FinishDelegation(gen);
-    }
-    return __Pyx_Generator_SendEx(gen, Py_None);
-}
-static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
-    PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        gen->is_running = 1;
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Generator_Send(yf, value);
-        } else {
-            if (value == Py_None)
-                ret = PyIter_Next(yf);
-            else
-                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
-        }
-        gen->is_running = 0;
-        if (likely(ret)) {
-            return ret;
-        }
-        return __Pyx_Generator_FinishDelegation(gen);
-    }
-    return __Pyx_Generator_SendEx(gen, value);
-}
-static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
-    PyObject *retval = NULL;
-    int err = 0;
-    if (__Pyx_Generator_CheckExact(yf)) {
-        retval = __Pyx_Generator_Close(yf);
-        if (!retval)
-            return -1;
-    } else {
-        PyObject *meth;
-        gen->is_running = 1;
-        meth = PyObject_GetAttr(yf, __pyx_n_s_close);
-        if (unlikely(!meth)) {
-            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
-                PyErr_WriteUnraisable(yf);
-            }
-            PyErr_Clear();
-        } else {
-            retval = PyObject_CallFunction(meth, NULL);
-            Py_DECREF(meth);
-            if (!retval)
-                err = -1;
-        }
-        gen->is_running = 0;
-    }
-    Py_XDECREF(retval);
-    return err;
-}
-static PyObject *__Pyx_Generator_Close(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
-    PyObject *retval, *raised_exception;
-    PyObject *yf = gen->yieldfrom;
-    int err = 0;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        Py_INCREF(yf);
-        err = __Pyx_Generator_CloseIter(gen, yf);
-        __Pyx_Generator_Undelegate(gen);
-        Py_DECREF(yf);
-    }
-    if (err == 0)
-#if PY_VERSION_HEX < 0x02050000
-        PyErr_SetNone(PyExc_StopIteration);
-#else
-        PyErr_SetNone(PyExc_GeneratorExit);
-#endif
-    retval = __Pyx_Generator_SendEx(gen, NULL);
-    if (retval) {
-        Py_DECREF(retval);
-        PyErr_SetString(PyExc_RuntimeError,
-                        "generator ignored GeneratorExit");
-        return NULL;
-    }
-    raised_exception = PyErr_Occurred();
-    if (!raised_exception
-        || raised_exception == PyExc_StopIteration
-#if PY_VERSION_HEX >= 0x02050000
-        || raised_exception == PyExc_GeneratorExit
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
-#endif
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
-    {
-        if (raised_exception) 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 *gen = (__pyx_GeneratorObject *) self;
-    PyObject *typ;
-    PyObject *tb = NULL;
-    PyObject *val = NULL;
-    PyObject *yf = gen->yieldfrom;
-    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
-        return NULL;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        Py_INCREF(yf);
-#if PY_VERSION_HEX >= 0x02050000
-        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
-            int err = __Pyx_Generator_CloseIter(gen, yf);
-            Py_DECREF(yf);
-            __Pyx_Generator_Undelegate(gen);
-            if (err < 0)
-                return __Pyx_Generator_SendEx(gen, NULL);
-            goto throw_here;
-        }
-#endif
-        gen->is_running = 1;
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Generator_Throw(yf, args);
-        } else {
-            PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw);
-            if (unlikely(!meth)) {
-                Py_DECREF(yf);
-                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
-                    gen->is_running = 0;
-                    return NULL;
-                }
-                PyErr_Clear();
-                __Pyx_Generator_Undelegate(gen);
-                gen->is_running = 0;
-                goto throw_here;
-            }
-            ret = PyObject_CallObject(meth, args);
-            Py_DECREF(meth);
-        }
-        gen->is_running = 0;
-        Py_DECREF(yf);
-        if (!ret) {
-            ret = __Pyx_Generator_FinishDelegation(gen);
-        }
-        return ret;
-    }
-throw_here:
-    __Pyx_Raise(typ, val, tb, NULL);
-    return __Pyx_Generator_SendEx(gen, 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->yieldfrom);
-    Py_VISIT(gen->exc_type);
-    Py_VISIT(gen->exc_value);
-    Py_VISIT(gen->exc_traceback);
-    return 0;
-}
-static int __Pyx_Generator_clear(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
-    Py_CLEAR(gen->closure);
-    Py_CLEAR(gen->classobj);
-    Py_CLEAR(gen->yieldfrom);
-    Py_CLEAR(gen->exc_type);
-    Py_CLEAR(gen->exc_value);
-    Py_CLEAR(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);
-    if (gen->resume_label > 0) {
-        PyObject_GC_Track(self);
-#if PY_VERSION_HEX >= 0x030400a1
-        if (PyObject_CallFinalizerFromDealloc(self))
-#else
-        Py_TYPE(gen)->tp_del(self);
-        if (self->ob_refcnt > 0)
-#endif
-            return;                     /* resurrected.  :( */
-        PyObject_GC_UnTrack(self);
-    }
-    __Pyx_Generator_clear(self);
-    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 ;
-#if PY_VERSION_HEX < 0x030400a1
-    assert(self->ob_refcnt == 0);
-    self->ob_refcnt = 1;
-#endif
-    __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);
-#if PY_VERSION_HEX < 0x030400a1
-    /* 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;
-    }
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#endif
-    /* 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
-    --Py_TYPE(self)->tp_frees;
-    --Py_TYPE(self)->tp_allocs;
-#endif
-#endif
-}
-static PyMemberDef __pyx_Generator_memberlist[] = {
-    {(char *) "gi_running",
-#if PY_VERSION_HEX >= 0x02060000
-     T_BOOL,
-#else
-     T_BYTE,
-#endif
-     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_type = {
-    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*/
-    0,                                  /*tp_getattro*/
-    0,                                  /*tp_setattro*/
-    0,                                  /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/
-    0,                                  /*tp_doc*/
-    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
-    0,                                  /*tp_clear*/
-    0,                                  /*tp_richcompare*/
-    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
-    0,                                  /*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*/
-#if PY_VERSION_HEX >= 0x030400a1
-    0,                                  /*tp_del*/
-#else
-    __Pyx_Generator_del,                /*tp_del*/
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-    0,                                  /*tp_version_tag*/
-#endif
-#if PY_VERSION_HEX >= 0x030400a1
-    __Pyx_Generator_del,                /*tp_finalize*/
-#endif
-};
-static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
-                                                  PyObject *closure) {
-    __pyx_GeneratorObject *gen =
-        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
-    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->yieldfrom = 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) {
-    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
-    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
-    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
-    if (__pyx_GeneratorType == NULL) {
-        return -1;
-    }
-    return 0;
-}
-
-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;
-}
-
-#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
-
-#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_ssize_t basicsize;
-#ifdef Py_LIMITED_API
-    PyObject *py_basicsize;
-#endif
-    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,
-            "%.200s.%.200s is not a type object",
-            module_name, class_name);
-        goto bad;
-    }
-#ifndef Py_LIMITED_API
-    basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
-    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
-    if (!py_basicsize)
-        goto bad;
-    basicsize = PyLong_AsSsize_t(py_basicsize);
-    Py_DECREF(py_basicsize);
-    py_basicsize = 0;
-    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
-        goto bad;
-#endif
-    if (!strict && (size_t)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)basicsize != size) {
-        PyErr_Format(PyExc_ValueError,
-            "%.200s.%.200s 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
-
-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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
-    Py_ssize_t ignore;
-    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
-            }
-        }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-        return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
-    } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
-#if !CYTHON_COMPILING_IN_PYPY
-#if PY_VERSION_HEX >= 0x02060000
-    if (PyByteArray_Check(o)) {
-        *length = PyByteArray_GET_SIZE(o);
-        return PyByteArray_AS_STRING(o);
-    } else
-#endif
-#endif
-    {
-        char* result;
-        int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (unlikely(r < 0)) {
-            return NULL;
-        } else {
-            return result;
-        }
-    }
-}
-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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
-    if (!PyLong_Check(res)) {
-#endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (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;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
-  Py_ssize_t ival;
-  PyObject *x;
-#if PY_MAJOR_VERSION < 3
-  if (likely(PyInt_CheckExact(b)))
-      return PyInt_AS_LONG(b);
-#endif
-  if (likely(PyLong_CheckExact(b))) {
-    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-     #if CYTHON_USE_PYLONG_INTERNALS
-       switch (Py_SIZE(b)) {
-       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
-       case  0: return 0;
-       case  1: return ((PyLongObject*)b)->ob_digit[0];
-       }
-     #endif
-    #endif
-  #if PY_VERSION_HEX < 0x02060000
-    return PyInt_AsSsize_t(b);
-  #else
-    return PyLong_AsSsize_t(b);
-  #endif
-  }
-  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
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/pysam/cfaidx.c b/pysam/cfaidx.c
deleted file mode 100644
index 80a55a2..0000000
--- a/pysam/cfaidx.c
+++ /dev/null
@@ -1,8717 +0,0 @@
-/* Generated by Cython 0.20.1 on Fri Nov 21 19:49:04 2014 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#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
-#define CYTHON_ABI "0_20_1"
-#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 Py_OptimizeFlag 0
-#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 CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #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"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-  #define __Pyx_DefaultClassType PyClass_Type
-#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)
-  #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #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 < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
-  #define Py_TPFLAGS_IS_ABSTRACT 0
-#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
-  #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
-  #define CYTHON_PEP393_ENABLED 1
-  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
-                                              0 : _PyUnicode_Ready((PyObject *)(op)))
-  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
-  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
-  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
-  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
-  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
-#else
-  #define CYTHON_PEP393_ENABLED 0
-  #define __Pyx_PyUnicode_READY(op)       (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]))
-  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
-  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
-  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
-#else
-  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
-      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
-#else
-  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
-#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_MAJOR_VERSION >= 3
-  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
-  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#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
-  #define PyNumber_Int                 PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyBoolObject                 PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x030200A4
-  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
-#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
-#ifndef CYTHON_RESTRICT
-  #if defined(__GNUC__)
-    #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER) && _MSC_VER >= 1400
-    #define CYTHON_RESTRICT __restrict
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_RESTRICT restrict
-  #else
-    #define CYTHON_RESTRICT
-  #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
-  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
-   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
-   a quiet NaN. */
-  float value;
-  memset(&value, 0xFF, sizeof(value));
-  return value;
-}
-#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__pysam__cfaidx
-#define __PYX_HAVE_API__pysam__cfaidx
-#include "stdint.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
-#include "zlib.h"
-#include "htslib/kstring.h"
-#include "htslib/hfile.h"
-#include "htslib/bgzf.h"
-#include "htslib/hts.h"
-#include "htslib/sam.h"
-#include "pysam_stream.h"
-#include "htslib/faidx.h"
-#include "htslib/tbx.h"
-#include "pythread.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#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 Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
-    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
-    (sizeof(type) > sizeof(Py_ssize_t) &&               \
-          likely(v < (type)PY_SSIZE_T_MAX ||            \
-                 v == (type)PY_SSIZE_T_MAX)  &&         \
-          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
-                                v == (type)PY_SSIZE_T_MIN)))  ||  \
-    (sizeof(type) == sizeof(Py_ssize_t) &&              \
-          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
-                               v == (type)PY_SSIZE_T_MAX)))  )
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString        PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
-    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
-    const Py_UNICODE *u_end = u;
-    while (*u_end++) ;
-    return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
-#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);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    PyObject* ascii_chars_u = NULL;
-    PyObject* ascii_chars_b = NULL;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
-        __Pyx_sys_getdefaultencoding_not_ascii = 0;
-    } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
-        char ascii_chars[128];
-        int c;
-        for (c = 0; c < 128; c++) {
-            ascii_chars[c] = c;
-        }
-        __Pyx_sys_getdefaultencoding_not_ascii = 1;
-        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
-        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
-            PyErr_Format(
-                PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
-                default_encoding_c);
-            goto bad;
-        }
-    }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    char* default_encoding_c;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
-    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
-    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
-    Py_DECREF(default_encoding);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    return -1;
-}
-#endif
-#endif
-
-
-#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_d;
-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[] = {
-  "cfaidx.pyx",
-  "type.pxd",
-  "bool.pxd",
-  "complex.pxd",
-};
-
-/*--- Type declarations ---*/
-struct __pyx_obj_5pysam_6cfaidx_FastaFile;
-struct __pyx_obj_5pysam_6cfaidx_FastqProxy;
-struct __pyx_obj_5pysam_6cfaidx_FastqFile;
-struct __pyx_obj_5pysam_6cfaidx_Fastafile;
-struct __pyx_obj_5pysam_6cfaidx_Fastqfile;
-struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open;
-struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr;
-struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr;
-
-/* "pysam/cfaidx.pxd":14
- *         char *s
- * 
- * cdef class FastaFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename, _references, _lengths, reference2length
- *     cdef faidx_t* fastafile
- */
-struct __pyx_obj_5pysam_6cfaidx_FastaFile {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile *__pyx_vtab;
-  PyObject *_filename;
-  PyObject *_references;
-  PyObject *_lengths;
-  PyObject *reference2length;
-  faidx_t *fastafile;
-};
-
-
-/* "pysam/cfaidx.pxd":21
- * 
- * 
- * cdef class FastqProxy:             # <<<<<<<<<<<<<<
- *     cdef kseq_t * _delegate
- * 
- */
-struct __pyx_obj_5pysam_6cfaidx_FastqProxy {
-  PyObject_HEAD
-  kseq_t *_delegate;
-};
-
-
-/* "pysam/cfaidx.pxd":25
- * 
- * 
- * cdef class FastqFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename
- *     cdef gzFile fastqfile
- */
-struct __pyx_obj_5pysam_6cfaidx_FastqFile {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile *__pyx_vtab;
-  PyObject *_filename;
-  gzFile fastqfile;
-  kseq_t *entry;
-};
-
-
-/* "pysam/cfaidx.pxd":35
- * 
- * # Compatibility Layer for pysam < 0.8
- * cdef class Fastafile(FastaFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6cfaidx_Fastafile {
-  struct __pyx_obj_5pysam_6cfaidx_FastaFile __pyx_base;
-};
-
-
-/* "pysam/cfaidx.pxd":38
- *     pass
- * 
- * cdef class Fastqfile(FastqFile):             # <<<<<<<<<<<<<<
- *     pass
- */
-struct __pyx_obj_5pysam_6cfaidx_Fastqfile {
-  struct __pyx_obj_5pysam_6cfaidx_FastqFile __pyx_base;
-};
-
-
-/* "pysam/cfaidx.pyx":93
- *         return faidx_nseq(self.fastafile)
- * 
- *     def _open(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an indexed fasta file.
- * 
- */
-struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open {
-  PyObject_HEAD
-  PyObject *__pyx_v_data;
-};
-
-
-/* "pysam/cfaidx.pyx":113
- *         with open( self._filename + b".fai" ) as inf:
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)             # <<<<<<<<<<<<<<
- *             self._lengths = tuple(int(x[1]) for x in data)
- *             self.reference2length = dict(zip(self._references, self._lengths))
- */
-struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr {
-  PyObject_HEAD
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *__pyx_outer_scope;
-  PyObject *__pyx_v_x;
-  PyObject *__pyx_t_0;
-  Py_ssize_t __pyx_t_1;
-};
-
-
-/* "pysam/cfaidx.pyx":114
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)
- *             self._lengths = tuple(int(x[1]) for x in data)             # <<<<<<<<<<<<<<
- *             self.reference2length = dict(zip(self._references, self._lengths))
- * 
- */
-struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr {
-  PyObject_HEAD
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *__pyx_outer_scope;
-  PyObject *__pyx_v_x;
-  PyObject *__pyx_t_0;
-  Py_ssize_t __pyx_t_1;
-};
-
-
-
-/* "pysam/cfaidx.pyx":66
- * ##        add automatic indexing.
- * ##        add function to get sequence names.
- * cdef class FastaFile:             # <<<<<<<<<<<<<<
- *     '''*(filename)*
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile {
-  char *(*_fetch)(struct __pyx_obj_5pysam_6cfaidx_FastaFile *, char *, int, int, int *);
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile *__pyx_vtabptr_5pysam_6cfaidx_FastaFile;
-
-
-/* "pysam/cfaidx.pyx":269
- *             else: return None
- * 
- * cdef class FastqFile:             # <<<<<<<<<<<<<<
- *     '''*(filename)*
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile {
-  kseq_t *(*getCurrent)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *);
-  int (*cnext)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *);
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile *__pyx_vtabptr_5pysam_6cfaidx_FastqFile;
-
-
-/* "pysam/cfaidx.pyx":344
- * 
- * # Compatibility Layer for pysam < 0.8
- * cdef class Fastafile(FastaFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile {
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile *__pyx_vtabptr_5pysam_6cfaidx_Fastafile;
-
-
-/* "pysam/cfaidx.pyx":347
- *     pass
- * 
- * cdef class Fastqfile(FastqFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile {
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile *__pyx_vtabptr_5pysam_6cfaidx_Fastqfile;
-#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_XDECREF_SET(r, v) do {                            \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_XDECREF(tmp);                              \
-    } while (0)
-#define __Pyx_DECREF_SET(r, v) do {                             \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_DECREF(tmp);                               \
-    } while (0)
-#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)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_getattro))
-        return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_getattr))
-        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
-    return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-#ifndef CYTHON_PROFILE
-  #define CYTHON_PROFILE 1
-#endif
-#ifndef CYTHON_TRACE
-  #define CYTHON_TRACE 0
-#endif
-#if CYTHON_TRACE
-  #undef CYTHON_PROFILE_REUSE_FRAME
-#endif
-#ifndef CYTHON_PROFILE_REUSE_FRAME
-  #define CYTHON_PROFILE_REUSE_FRAME 0
-#endif
-#if CYTHON_PROFILE || CYTHON_TRACE
-  #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_CLEAR(__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 || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc)))) {      \
-      __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 || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc))) {  \
-      PyThreadState* tstate = PyThreadState_GET();                                         \
-      tstate->use_tracing = 0;                                                             \
-      PyObject *exc_info = __Pyx_GetExceptionTuple();                                      \
-      if (exc_info) {                                                                      \
-          if (CYTHON_TRACE && tstate->c_tracefunc)                                         \
-              tstate->c_tracefunc(                                                         \
-                  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);          \
-          tstate->c_profilefunc(                                                           \
-              tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);            \
-          Py_DECREF(exc_info);                                                             \
-      }                                                                                    \
-      tstate->use_tracing = 1;                                                             \
-  }
-  #define __Pyx_TraceReturn(result)                                                  \
-  if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing) {             \
-      PyThreadState* tstate = PyThreadState_GET();                                   \
-      tstate->use_tracing = 0;                                                        \
-      if (CYTHON_TRACE && tstate->c_tracefunc)                                       \
-          tstate->c_tracefunc(                                                       \
-              tstate->c_traceobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);  \
-      if (tstate->c_profilefunc)                                                     \
-          tstate->c_profilefunc(                                                     \
-              tstate->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);  \
-      CYTHON_FRAME_DEL;                                                              \
-      tstate->use_tracing = 1;                                                       \
-  }
-  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 */
-#if CYTHON_TRACE
-  #define __Pyx_TraceLine(lineno)                                                          \
-  if (unlikely(__Pyx_use_tracing) && unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_tracefunc)) {    \
-      PyThreadState* tstate = PyThreadState_GET();                                         \
-      __pyx_frame->f_lineno = lineno;                                                     \
-      tstate->use_tracing = 0;                                                             \
-      tstate->c_tracefunc(tstate->c_traceobj, __pyx_frame, PyTrace_LINE, NULL);           \
-      tstate->use_tracing = 1;                                                             \
-  }
-#else
-  #define __Pyx_TraceLine(lineno)
-#endif
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
-#else
-#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
-#endif
-
-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 int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
-
-static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
-
-#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
-    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
-               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck);
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000)
-static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
-    PyObject *res;
-    PyTypeObject *tp = Py_TYPE(obj);
-#if PY_MAJOR_VERSION < 3
-    if (unlikely(PyInstance_Check(obj)))
-        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
-#endif
-    res = _PyType_Lookup(tp, attr_name);
-    if (likely(res)) {
-        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
-        if (!f) {
-            Py_INCREF(res);
-        } else {
-            res = f(res, obj, (PyObject *)tp);
-        }
-    } else {
-        PyErr_SetObject(PyExc_AttributeError, attr_name);
-    }
-    return res;
-}
-#else
-#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
-#endif
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len)) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
-#endif
-
-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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_WriteUnraisable(const char *name, int clineno,
-                                  int lineno, const char *filename,
-                                  int full_traceback); /*proto*/
-
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
-    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
-    int result = PySequence_Contains(seq, item);
-    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-#include <string.h>
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-
-static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
-    PyObject *method, *result = NULL;
-    if (unlikely(!args)) return NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto bad;
-    result = __Pyx_PyObject_Call(method, args, NULL);
-    Py_DECREF(method);
-bad:
-    Py_DECREF(args);
-    return result;
-}
-#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
-#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
-#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
-#define __Pyx_PyObject_CallMethod0(obj, name) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))
-
-#define __Pyx_Generator_USED
-#include <structmember.h>
-#include <frameobject.h>
-typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
-typedef struct {
-    PyObject_HEAD
-    __pyx_generator_body_t body;
-    PyObject *closure;
-    PyObject *exc_type;
-    PyObject *exc_value;
-    PyObject *exc_traceback;
-    PyObject *gi_weakreflist;
-    PyObject *classobj;
-    PyObject *yieldfrom;
-    int resume_label;
-    char is_running;
-} __pyx_GeneratorObject;
-static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
-                                                  PyObject *closure);
-static int __pyx_Generator_init(void);
-static int __Pyx_Generator_clear(PyObject* self);
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
-#else
-#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
-#endif
-
-static int __Pyx_check_binary_version(void);
-
-#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 PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*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 'libc.stdint' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdlib' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'pysam.chtslib' */
-
-/* Module declarations from 'cpython.version' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'cpython.exc' */
-
-/* Module declarations from 'cpython.module' */
-
-/* Module declarations from 'cpython.mem' */
-
-/* Module declarations from 'cpython.tuple' */
-
-/* Module declarations from 'cpython.list' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from 'cpython.sequence' */
-
-/* Module declarations from 'cpython.mapping' */
-
-/* Module declarations from 'cpython.iterator' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'cpython.number' */
-
-/* Module declarations from 'cpython.int' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.bool' */
-static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
-
-/* Module declarations from 'cpython.long' */
-
-/* Module declarations from 'cpython.float' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.complex' */
-static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
-
-/* Module declarations from 'cpython.string' */
-
-/* Module declarations from 'cpython.unicode' */
-
-/* Module declarations from 'cpython.dict' */
-
-/* Module declarations from 'cpython.instance' */
-
-/* Module declarations from 'cpython.function' */
-
-/* Module declarations from 'cpython.method' */
-
-/* Module declarations from 'cpython.weakref' */
-
-/* Module declarations from 'cpython.getargs' */
-
-/* Module declarations from 'cpython.pythread' */
-
-/* Module declarations from 'cpython.pystate' */
-
-/* Module declarations from 'cpython.cobject' */
-
-/* Module declarations from 'cpython.oldbuffer' */
-
-/* Module declarations from 'cpython.set' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.bytes' */
-
-/* Module declarations from 'cpython.pycapsule' */
-
-/* Module declarations from 'cpython' */
-
-/* Module declarations from 'pysam.cfaidx' */
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastaFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastqProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastqFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_Fastafile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_Fastqfile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx___pyx_scope_struct___open = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx___pyx_scope_struct_1_genexpr = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx___pyx_scope_struct_2_genexpr = 0;
-static PyObject *__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING = 0;
-static int __pyx_v_5pysam_6cfaidx_max_pos;
-static PyObject *__pyx_f_5pysam_6cfaidx_makeFastqProxy(kseq_t *); /*proto*/
-static PyObject *__pyx_f_5pysam_6cfaidx__encodeFilename(PyObject *); /*proto*/
-#define __Pyx_MODULE_NAME "pysam.cfaidx"
-int __pyx_module_is_main_pysam__cfaidx = 0;
-
-/* Implementation of 'pysam.cfaidx' */
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_IOError;
-static PyObject *__pyx_builtin_open;
-static PyObject *__pyx_builtin_zip;
-static PyObject *__pyx_builtin_IndexError;
-static PyObject *__pyx_builtin_StopIteration;
-static int __pyx_pf_5pysam_6cfaidx_9FastaFile___cinit__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_2_isOpen(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self); /* proto */
-static Py_ssize_t __pyx_pf_5pysam_6cfaidx_9FastaFile_4__len__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_5_open_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_5_open_3genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_6_open(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_8close(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_6cfaidx_9FastaFile_10__dealloc__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_8filename___get__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_10references___get__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_11nreferences___get__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_7lengths___get__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_12fetch(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_14get_reference_length(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_16__getitem__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference); /* proto */
-static int __pyx_pf_5pysam_6cfaidx_9FastaFile_18__contains__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference); /* proto */
-static int __pyx_pf_5pysam_6cfaidx_10FastqProxy___init__(CYTHON_UNUSED struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_10FastqProxy_4name___get__(struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_10FastqProxy_8sequence___get__(struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_10FastqProxy_7comment___get__(struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_10FastqProxy_7quality___get__(struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_6cfaidx_9FastqFile___cinit__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_2_isOpen(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_4_open(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_6close(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_6cfaidx_9FastqFile_8__dealloc__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_8filename___get__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_10__iter__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_12__next__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_FastaFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_FastqProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_FastqFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_Fastafile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_Fastqfile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct___open(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_r[] = "r";
-static char __pyx_k__3[] = "\t";
-static char __pyx_k__8[] = "";
-static char __pyx_k_os[] = "os";
-static char __pyx_k_all[] = "__all__";
-static char __pyx_k_end[] = "end";
-static char __pyx_k_fai[] = ".fai";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_zip[] = "zip";
-static char __pyx_k_args[] = "args";
-static char __pyx_k_exit[] = "__exit__";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_open[] = "open";
-static char __pyx_k_path[] = "path";
-static char __pyx_k_send[] = "send";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_ascii[] = "ascii";
-static char __pyx_k_close[] = "close";
-static char __pyx_k_enter[] = "__enter__";
-static char __pyx_k_fetch[] = "fetch";
-static char __pyx_k_s_i_i[] = "%s:%i-%i";
-static char __pyx_k_split[] = "split";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_throw[] = "throw";
-static char __pyx_k_encode[] = "encode";
-static char __pyx_k_exists[] = "exists";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_isOpen[] = "_isOpen";
-static char __pyx_k_open_2[] = "_open";
-static char __pyx_k_region[] = "region";
-static char __pyx_k_IOError[] = "IOError";
-static char __pyx_k_FastaFile[] = "FastaFile";
-static char __pyx_k_Fastafile[] = "Fastafile";
-static char __pyx_k_FastqFile[] = "FastqFile";
-static char __pyx_k_Fastqfile[] = "Fastqfile";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_reference[] = "reference";
-static char __pyx_k_IS_PYTHON3[] = "IS_PYTHON3";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_references[] = "references";
-static char __pyx_k_StopIteration[] = "StopIteration";
-static char __pyx_k_end_out_of_range_i[] = "end out of range (%i)";
-static char __pyx_k_getdefaultencoding[] = "getdefaultencoding";
-static char __pyx_k_start_out_of_range_i[] = "start out of range (%i)";
-static char __pyx_k_could_not_open_file_s[] = "could not open file `%s`";
-static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding";
-static char __pyx_k_calling_len_on_closed_file[] = "calling len() on closed file";
-static char __pyx_k_No_such_file_or_directory_s[] = "No such file or directory: %s";
-static char __pyx_k_could_not_locate_index_file[] = "could not locate index file";
-static char __pyx_k_no_sequence_region_supplied[] = "no sequence/region supplied.";
-static char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file";
-static char __pyx_k_invalid_region_start_i_end_i[] = "invalid region: start (%i) > end (%i)";
-static char __pyx_k_Argument_must_be_string_or_unico[] = "Argument must be string or unicode.";
-static char __pyx_k_number_of_term_filename_associat[] = "number of :term:`filename` associated with this object.";
-static char __pyx_k_number_of_term_reference_sequenc[] = "number of :term:`reference` sequences in the file.";
-static char __pyx_k_tuple_with_the_lengths_of_term_r[] = "tuple with the lengths of :term:`reference` sequences.";
-static char __pyx_k_tuple_with_the_names_of_term_ref[] = "tuple with the names of :term:`reference` sequences.";
-static PyObject *__pyx_kp_u_Argument_must_be_string_or_unico;
-static PyObject *__pyx_n_s_FastaFile;
-static PyObject *__pyx_n_s_Fastafile;
-static PyObject *__pyx_n_s_FastqFile;
-static PyObject *__pyx_n_s_Fastqfile;
-static PyObject *__pyx_n_s_IOError;
-static PyObject *__pyx_n_s_IS_PYTHON3;
-static PyObject *__pyx_kp_s_I_O_operation_on_closed_file;
-static PyObject *__pyx_n_s_IndexError;
-static PyObject *__pyx_kp_s_No_such_file_or_directory_s;
-static PyObject *__pyx_n_s_StopIteration;
-static PyObject *__pyx_n_s_TypeError;
-static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_kp_s__3;
-static PyObject *__pyx_kp_b__8;
-static PyObject *__pyx_n_s_all;
-static PyObject *__pyx_n_s_args;
-static PyObject *__pyx_n_s_ascii;
-static PyObject *__pyx_kp_s_calling_len_on_closed_file;
-static PyObject *__pyx_n_s_close;
-static PyObject *__pyx_kp_s_could_not_locate_index_file;
-static PyObject *__pyx_kp_s_could_not_open_file_s;
-static PyObject *__pyx_n_s_encode;
-static PyObject *__pyx_n_s_end;
-static PyObject *__pyx_kp_s_end_out_of_range_i;
-static PyObject *__pyx_n_s_enter;
-static PyObject *__pyx_n_s_exists;
-static PyObject *__pyx_n_s_exit;
-static PyObject *__pyx_kp_b_fai;
-static PyObject *__pyx_n_s_fetch;
-static PyObject *__pyx_n_s_getdefaultencoding;
-static PyObject *__pyx_n_s_getfilesystemencoding;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_kp_s_invalid_region_start_i_end_i;
-static PyObject *__pyx_n_s_isOpen;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_kp_s_no_sequence_region_supplied;
-static PyObject *__pyx_n_s_open;
-static PyObject *__pyx_n_s_open_2;
-static PyObject *__pyx_n_s_os;
-static PyObject *__pyx_n_s_path;
-static PyObject *__pyx_n_s_pyx_vtable;
-static PyObject *__pyx_n_s_reference;
-static PyObject *__pyx_n_s_references;
-static PyObject *__pyx_n_s_region;
-static PyObject *__pyx_kp_s_s_i_i;
-static PyObject *__pyx_n_s_send;
-static PyObject *__pyx_n_s_split;
-static PyObject *__pyx_n_s_start;
-static PyObject *__pyx_kp_s_start_out_of_range_i;
-static PyObject *__pyx_n_s_sys;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_n_s_throw;
-static PyObject *__pyx_n_s_zip;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_tuple_;
-static PyObject *__pyx_tuple__2;
-static PyObject *__pyx_tuple__4;
-static PyObject *__pyx_tuple__5;
-static PyObject *__pyx_tuple__6;
-static PyObject *__pyx_tuple__7;
-static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_tuple__10;
-
-/* "pysam/cfaidx.pyx":8
- * 
- * cdef class FastqProxy
- * cdef makeFastqProxy(kseq_t * src):             # <<<<<<<<<<<<<<
- *     '''enter src into AlignedRead.'''
- *     cdef FastqProxy dest = FastqProxy.__new__(FastqProxy)
- */
-
-static PyObject *__pyx_f_5pysam_6cfaidx_makeFastqProxy(kseq_t *__pyx_v_src) {
-  struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_dest = 0;
-  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("makeFastqProxy", 0);
-  __Pyx_TraceCall("makeFastqProxy", __pyx_f[0], 8);
-
-  /* "pysam/cfaidx.pyx":10
- * cdef makeFastqProxy(kseq_t * src):
- *     '''enter src into AlignedRead.'''
- *     cdef FastqProxy dest = FastqProxy.__new__(FastqProxy)             # <<<<<<<<<<<<<<
- *     dest._delegate = src
- *     return dest
- */
-  __pyx_t_1 = __pyx_tp_new_5pysam_6cfaidx_FastqProxy(((PyTypeObject *)((PyObject*)__pyx_ptype_5pysam_6cfaidx_FastqProxy)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysam_6cfaidx_FastqProxy)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_dest = ((struct __pyx_obj_5pysam_6cfaidx_FastqProxy *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/cfaidx.pyx":11
- *     '''enter src into AlignedRead.'''
- *     cdef FastqProxy dest = FastqProxy.__new__(FastqProxy)
- *     dest._delegate = src             # <<<<<<<<<<<<<<
- *     return dest
- * 
- */
-  __pyx_v_dest->_delegate = __pyx_v_src;
-
-  /* "pysam/cfaidx.pyx":12
- *     cdef FastqProxy dest = FastqProxy.__new__(FastqProxy)
- *     dest._delegate = src
- *     return dest             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_dest));
-  __pyx_r = ((PyObject *)__pyx_v_dest);
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":8
- * 
- * cdef class FastqProxy
- * cdef makeFastqProxy(kseq_t * src):             # <<<<<<<<<<<<<<
- *     '''enter src into AlignedRead.'''
- *     cdef FastqProxy dest = FastqProxy.__new__(FastqProxy)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cfaidx.makeFastqProxy", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_dest);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":46
- * #_C_FILENAME_ENCODING = <char*>_FILENAME_ENCODING
- * 
- * cdef bytes _encodeFilename(object filename):             # <<<<<<<<<<<<<<
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- */
-
-static PyObject *__pyx_f_5pysam_6cfaidx__encodeFilename(PyObject *__pyx_v_filename) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_encodeFilename", 0);
-  __Pyx_TraceCall("_encodeFilename", __pyx_f[0], 46);
-
-  /* "pysam/cfaidx.pyx":48
- * cdef bytes _encodeFilename(object filename):
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(filename):
- */
-  __pyx_t_1 = (__pyx_v_filename == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/cfaidx.pyx":49
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(filename):
- *         return filename
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cfaidx.pyx":50
- *     if filename is None:
- *         return None
- *     elif PyBytes_Check(filename):             # <<<<<<<<<<<<<<
- *         return filename
- *     elif PyUnicode_Check(filename):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_filename) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/cfaidx.pyx":51
- *         return None
- *     elif PyBytes_Check(filename):
- *         return filename             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(filename):
- *         return filename.encode(_FILENAME_ENCODING)
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_filename))||((__pyx_v_filename) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_filename)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_filename);
-    __pyx_r = ((PyObject*)__pyx_v_filename);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cfaidx.pyx":52
- *     elif PyBytes_Check(filename):
- *         return filename
- *     elif PyUnicode_Check(filename):             # <<<<<<<<<<<<<<
- *         return filename.encode(_FILENAME_ENCODING)
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_filename) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/cfaidx.pyx":53
- *         return filename
- *     elif PyUnicode_Check(filename):
- *         return filename.encode(_FILENAME_ENCODING)             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_5pysam_6cfaidx__FILENAME_ENCODING);
-    __Pyx_GIVEREF(__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_5);
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/cfaidx.pyx":55
- *         return filename.encode(_FILENAME_ENCODING)
- *     else:
- *         raise TypeError, u"Argument must be string or unicode."             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_or_unico, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cfaidx.pyx":46
- * #_C_FILENAME_ENCODING = <char*>_FILENAME_ENCODING
- * 
- * cdef bytes _encodeFilename(object filename):             # <<<<<<<<<<<<<<
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.cfaidx._encodeFilename", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":75
- *     '''
- * 
- *     def __cinit__(self, *args, **kwargs ):             # <<<<<<<<<<<<<<
- *         self.fastafile = NULL
- *         self._filename = None
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6cfaidx_9FastaFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6cfaidx_9FastaFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_args = 0;
-  PyObject *__pyx_v_kwargs = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
-  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
-  if (unlikely(!__pyx_v_kwargs)) return -1;
-  __Pyx_GOTREF(__pyx_v_kwargs);
-  __Pyx_INCREF(__pyx_args);
-  __pyx_v_args = __pyx_args;
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile___cinit__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
-  /* function exit code */
-  __Pyx_XDECREF(__pyx_v_args);
-  __Pyx_XDECREF(__pyx_v_kwargs);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6cfaidx_9FastaFile___cinit__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-  __Pyx_TraceCall("__cinit__", __pyx_f[0], 75);
-
-  /* "pysam/cfaidx.pyx":76
- * 
- *     def __cinit__(self, *args, **kwargs ):
- *         self.fastafile = NULL             # <<<<<<<<<<<<<<
- *         self._filename = None
- *         self._references = None
- */
-  __pyx_v_self->fastafile = NULL;
-
-  /* "pysam/cfaidx.pyx":77
- *     def __cinit__(self, *args, **kwargs ):
- *         self.fastafile = NULL
- *         self._filename = None             # <<<<<<<<<<<<<<
- *         self._references = None
- *         self._lengths = None
- */
-  __Pyx_INCREF(Py_None);
-  __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(__pyx_v_self->_filename);
-  __Pyx_DECREF(__pyx_v_self->_filename);
-  __pyx_v_self->_filename = Py_None;
-
-  /* "pysam/cfaidx.pyx":78
- *         self.fastafile = NULL
- *         self._filename = None
- *         self._references = None             # <<<<<<<<<<<<<<
- *         self._lengths = None
- *         self.reference2length = None
- */
-  __Pyx_INCREF(Py_None);
-  __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(__pyx_v_self->_references);
-  __Pyx_DECREF(__pyx_v_self->_references);
-  __pyx_v_self->_references = Py_None;
-
-  /* "pysam/cfaidx.pyx":79
- *         self._filename = None
- *         self._references = None
- *         self._lengths = None             # <<<<<<<<<<<<<<
- *         self.reference2length = None
- *         self._open( *args, **kwargs )
- */
-  __Pyx_INCREF(Py_None);
-  __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(__pyx_v_self->_lengths);
-  __Pyx_DECREF(__pyx_v_self->_lengths);
-  __pyx_v_self->_lengths = Py_None;
-
-  /* "pysam/cfaidx.pyx":80
- *         self._references = None
- *         self._lengths = None
- *         self.reference2length = None             # <<<<<<<<<<<<<<
- *         self._open( *args, **kwargs )
- * 
- */
-  __Pyx_INCREF(Py_None);
-  __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(__pyx_v_self->reference2length);
-  __Pyx_DECREF(__pyx_v_self->reference2length);
-  __pyx_v_self->reference2length = Py_None;
-
-  /* "pysam/cfaidx.pyx":81
- *         self._lengths = None
- *         self.reference2length = None
- *         self._open( *args, **kwargs )             # <<<<<<<<<<<<<<
- * 
- *     def _isOpen( self ):
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open_2); 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 = PySequence_Tuple(__pyx_v_args); 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_t_3 = __pyx_v_kwargs;
-  __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/cfaidx.pyx":75
- *     '''
- * 
- *     def __cinit__(self, *args, **kwargs ):             # <<<<<<<<<<<<<<
- *         self.fastafile = NULL
- *         self._filename = None
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":83
- *         self._open( *args, **kwargs )
- * 
- *     def _isOpen( self ):             # <<<<<<<<<<<<<<
- *         '''return true if samfile has been opened.'''
- *         return self.fastafile != NULL
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_3_isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastaFile_2_isOpen[] = "FastaFile._isOpen(self)\nreturn true if samfile has been opened.";
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_3_isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_isOpen (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_2_isOpen(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_2_isOpen(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_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("_isOpen", 0);
-  __Pyx_TraceCall("_isOpen", __pyx_f[0], 83);
-
-  /* "pysam/cfaidx.pyx":85
- *     def _isOpen( self ):
- *         '''return true if samfile has been opened.'''
- *         return self.fastafile != NULL             # <<<<<<<<<<<<<<
- * 
- *     def __len__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->fastafile != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":83
- *         self._open( *args, **kwargs )
- * 
- *     def _isOpen( self ):             # <<<<<<<<<<<<<<
- *         '''return true if samfile has been opened.'''
- *         return self.fastafile != NULL
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile._isOpen", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":87
- *         return self.fastafile != NULL
- * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         if self.fastafile == NULL:
- *             raise ValueError("calling len() on closed file")
- */
-
-/* Python wrapper */
-static Py_ssize_t __pyx_pw_5pysam_6cfaidx_9FastaFile_5__len__(PyObject *__pyx_v_self); /*proto*/
-static Py_ssize_t __pyx_pw_5pysam_6cfaidx_9FastaFile_5__len__(PyObject *__pyx_v_self) {
-  Py_ssize_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_4__len__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static Py_ssize_t __pyx_pf_5pysam_6cfaidx_9FastaFile_4__len__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self) {
-  Py_ssize_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__len__", 0);
-  __Pyx_TraceCall("__len__", __pyx_f[0], 87);
-
-  /* "pysam/cfaidx.pyx":88
- * 
- *     def __len__(self):
- *         if self.fastafile == NULL:             # <<<<<<<<<<<<<<
- *             raise ValueError("calling len() on closed file")
- * 
- */
-  __pyx_t_1 = ((__pyx_v_self->fastafile == NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/cfaidx.pyx":89
- *     def __len__(self):
- *         if self.fastafile == NULL:
- *             raise ValueError("calling len() on closed file")             # <<<<<<<<<<<<<<
- * 
- *         return faidx_nseq(self.fastafile)
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cfaidx.pyx":91
- *             raise ValueError("calling len() on closed file")
- * 
- *         return faidx_nseq(self.fastafile)             # <<<<<<<<<<<<<<
- * 
- *     def _open(self, filename):
- */
-  __pyx_r = faidx_nseq(__pyx_v_self->fastafile);
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":87
- *         return self.fastafile != NULL
- * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         if self.fastafile == NULL:
- *             raise ValueError("calling len() on closed file")
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":93
- *         return faidx_nseq(self.fastafile)
- * 
- *     def _open(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an indexed fasta file.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_7_open(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastaFile_6_open[] = "FastaFile._open(self, filename)\nopen an indexed fasta file.\n\n        This method expects an indexed fasta file.\n        ";
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_7_open(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_6_open(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self), ((PyObject *)__pyx_v_filename));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-static PyObject *__pyx_gb_5pysam_6cfaidx_9FastaFile_5_open_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-
-/* "pysam/cfaidx.pyx":113
- *         with open( self._filename + b".fai" ) as inf:
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)             # <<<<<<<<<<<<<<
- *             self._lengths = tuple(int(x[1]) for x in data)
- *             self.reference2length = dict(zip(self._references, self._lengths))
- */
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_5_open_genexpr(PyObject *__pyx_self) {
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *__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("genexpr", 0);
-  __pyx_cur_scope = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *)__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct_1_genexpr(__pyx_ptype_5pysam_6cfaidx___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
-  if (unlikely(!__pyx_cur_scope)) {
-    __Pyx_RefNannyFinishContext();
-    return NULL;
-  }
-  __Pyx_GOTREF(__pyx_cur_scope);
-  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *) __pyx_self;
-  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
-  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
-  __Pyx_TraceCall("genexpr", __pyx_f[0], 113);
-  {
-    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_5pysam_6cfaidx_9FastaFile_5_open_2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_cur_scope);
-    __Pyx_RefNannyFinishContext();
-    return (PyObject *) gen;
-  }
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile._open.genexpr", __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_5pysam_6cfaidx_9FastaFile_5_open_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
-{
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
-  PyObject *__pyx_r = NULL;
-  PyObject *__pyx_t_1 = NULL;
-  Py_ssize_t __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_data)) { __Pyx_RaiseClosureNameError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_data == Py_None)) {
-    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_data; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
-  for (;;) {
-    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #else
-    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #endif
-    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
-    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
-    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
-    __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_1 = __pyx_cur_scope->__pyx_t_0;
-    __pyx_cur_scope->__pyx_t_0 = 0;
-    __Pyx_XGOTREF(__pyx_t_1);
-    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
-    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* function exit code */
-  PyErr_SetNone(PyExc_StopIteration);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_generator->resume_label = -1;
-  __Pyx_Generator_clear((PyObject*)__pyx_generator);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-}
-static PyObject *__pyx_gb_5pysam_6cfaidx_9FastaFile_5_open_5generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-
-/* "pysam/cfaidx.pyx":114
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)
- *             self._lengths = tuple(int(x[1]) for x in data)             # <<<<<<<<<<<<<<
- *             self.reference2length = dict(zip(self._references, self._lengths))
- * 
- */
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_5_open_3genexpr(PyObject *__pyx_self) {
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *__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("genexpr", 0);
-  __pyx_cur_scope = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *)__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct_2_genexpr(__pyx_ptype_5pysam_6cfaidx___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
-  if (unlikely(!__pyx_cur_scope)) {
-    __Pyx_RefNannyFinishContext();
-    return NULL;
-  }
-  __Pyx_GOTREF(__pyx_cur_scope);
-  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *) __pyx_self;
-  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
-  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
-  __Pyx_TraceCall("genexpr", __pyx_f[0], 114);
-  {
-    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_5pysam_6cfaidx_9FastaFile_5_open_5generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_cur_scope);
-    __Pyx_RefNannyFinishContext();
-    return (PyObject *) gen;
-  }
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile._open.genexpr", __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_5pysam_6cfaidx_9FastaFile_5_open_5generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
-{
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
-  PyObject *__pyx_r = NULL;
-  PyObject *__pyx_t_1 = NULL;
-  Py_ssize_t __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_data)) { __Pyx_RaiseClosureNameError("data"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_data == Py_None)) {
-    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_data; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
-  for (;;) {
-    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #else
-    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #endif
-    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
-    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
-    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
-    __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_1 = __pyx_cur_scope->__pyx_t_0;
-    __pyx_cur_scope->__pyx_t_0 = 0;
-    __Pyx_XGOTREF(__pyx_t_1);
-    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
-    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* function exit code */
-  PyErr_SetNone(PyExc_StopIteration);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_generator->resume_label = -1;
-  __Pyx_Generator_clear((PyObject*)__pyx_generator);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-}
-
-/* "pysam/cfaidx.pyx":93
- *         return faidx_nseq(self.fastafile)
- * 
- *     def _open(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an indexed fasta file.
- * 
- */
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_6_open(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_filename) {
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *__pyx_cur_scope;
-  PyObject *__pyx_v_inf = NULL;
-  PyObject *__pyx_v_x = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  char *__pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  Py_ssize_t __pyx_t_11;
-  PyObject *(*__pyx_t_12)(PyObject *);
-  PyObject *__pyx_t_13 = NULL;
-  PyObject *__pyx_t_14 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_open", 0);
-  __pyx_cur_scope = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *)__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct___open(__pyx_ptype_5pysam_6cfaidx___pyx_scope_struct___open, __pyx_empty_tuple, NULL);
-  if (unlikely(!__pyx_cur_scope)) {
-    __Pyx_RefNannyFinishContext();
-    return NULL;
-  }
-  __Pyx_GOTREF(__pyx_cur_scope);
-  __Pyx_TraceCall("_open", __pyx_f[0], 93);
-
-  /* "pysam/cfaidx.pyx":100
- * 
- *         # close a previously opened file
- *         if self.fastafile != NULL: self.close()             # <<<<<<<<<<<<<<
- *         self._filename = _encodeFilename(filename)
- *         self.fastafile = fai_load(self._filename)
- */
-  __pyx_t_1 = ((__pyx_v_self->fastafile != NULL) != 0);
-  if (__pyx_t_1) {
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cfaidx.pyx":101
- *         # close a previously opened file
- *         if self.fastafile != NULL: self.close()
- *         self._filename = _encodeFilename(filename)             # <<<<<<<<<<<<<<
- *         self.fastafile = fai_load(self._filename)
- * 
- */
-  __pyx_t_3 = __pyx_f_5pysam_6cfaidx__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __Pyx_GOTREF(__pyx_v_self->_filename);
-  __Pyx_DECREF(__pyx_v_self->_filename);
-  __pyx_v_self->_filename = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/cfaidx.pyx":102
- *         if self.fastafile != NULL: self.close()
- *         self._filename = _encodeFilename(filename)
- *         self.fastafile = fai_load(self._filename)             # <<<<<<<<<<<<<<
- * 
- *         if self.fastafile == NULL:
- */
-  __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_v_self->_filename); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->fastafile = fai_load(__pyx_t_4);
-
-  /* "pysam/cfaidx.pyx":104
- *         self.fastafile = fai_load(self._filename)
- * 
- *         if self.fastafile == NULL:             # <<<<<<<<<<<<<<
- *             raise IOError("could not open file `%s`" % filename)
- * 
- */
-  __pyx_t_1 = ((__pyx_v_self->fastafile == NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/cfaidx.pyx":105
- * 
- *         if self.fastafile == NULL:
- *             raise IOError("could not open file `%s`" % filename)             # <<<<<<<<<<<<<<
- * 
- *         # read index
- */
-    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_open_file_s, __pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __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 = 105; __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 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cfaidx.pyx":108
- * 
- *         # read index
- *         if not os.path.exists( self._filename + b".fai" ):             # <<<<<<<<<<<<<<
- *             raise ValueError("could not locate index file")
- * 
- */
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyNumber_Add(__pyx_v_self->_filename, __pyx_kp_b_fai); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_6 = ((!__pyx_t_1) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/cfaidx.pyx":109
- *         # read index
- *         if not os.path.exists( self._filename + b".fai" ):
- *             raise ValueError("could not locate index file")             # <<<<<<<<<<<<<<
- * 
- *         with open( self._filename + b".fai" ) as inf:
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cfaidx.pyx":111
- *             raise ValueError("could not locate index file")
- * 
- *         with open( self._filename + b".fai" ) as inf:             # <<<<<<<<<<<<<<
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)
- */
-  /*with:*/ {
-    __pyx_t_2 = PyNumber_Add(__pyx_v_self->_filename, __pyx_kp_b_fai); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    /*try:*/ {
-      {
-        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
-        __Pyx_XGOTREF(__pyx_t_8);
-        __Pyx_XGOTREF(__pyx_t_9);
-        __Pyx_XGOTREF(__pyx_t_10);
-        /*try:*/ {
-          __Pyx_INCREF(__pyx_t_3);
-          __pyx_v_inf = __pyx_t_3;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-          /* "pysam/cfaidx.pyx":112
- * 
- *         with open( self._filename + b".fai" ) as inf:
- *             data = [ x.split("\t") for x in inf ]             # <<<<<<<<<<<<<<
- *             self._references = tuple(x[0] for x in data)
- *             self._lengths = tuple(int(x[1]) for x in data)
- */
-          __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          if (PyList_CheckExact(__pyx_v_inf) || PyTuple_CheckExact(__pyx_v_inf)) {
-            __pyx_t_2 = __pyx_v_inf; __Pyx_INCREF(__pyx_t_2); __pyx_t_11 = 0;
-            __pyx_t_12 = NULL;
-          } else {
-            __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_inf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-            __Pyx_GOTREF(__pyx_t_2);
-            __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
-          }
-          for (;;) {
-            if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) {
-              if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_2)) break;
-              #if CYTHON_COMPILING_IN_CPYTHON
-              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-              #else
-              __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-              #endif
-            } else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) {
-              if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-              #if CYTHON_COMPILING_IN_CPYTHON
-              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-              #else
-              __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-              #endif
-            } else {
-              __pyx_t_5 = __pyx_t_12(__pyx_t_2);
-              if (unlikely(!__pyx_t_5)) {
-                PyObject* exc_type = PyErr_Occurred();
-                if (exc_type) {
-                  if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-                  else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-                }
-                break;
-              }
-              __Pyx_GOTREF(__pyx_t_5);
-            }
-            __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5);
-            __pyx_t_5 = 0;
-            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-            __Pyx_GOTREF(__pyx_t_5);
-            __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-            __Pyx_GOTREF(__pyx_t_13);
-            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-            if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          }
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_GIVEREF(__pyx_t_3);
-          __pyx_cur_scope->__pyx_v_data = ((PyObject*)__pyx_t_3);
-          __pyx_t_3 = 0;
-
-          /* "pysam/cfaidx.pyx":113
- *         with open( self._filename + b".fai" ) as inf:
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)             # <<<<<<<<<<<<<<
- *             self._lengths = tuple(int(x[1]) for x in data)
- *             self.reference2length = dict(zip(self._references, self._lengths))
- */
-          __pyx_t_3 = __pyx_pf_5pysam_6cfaidx_9FastaFile_5_open_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L10_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_GIVEREF(__pyx_t_3);
-          __Pyx_GOTREF(__pyx_v_self->_references);
-          __Pyx_DECREF(__pyx_v_self->_references);
-          __pyx_v_self->_references = __pyx_t_3;
-          __pyx_t_3 = 0;
-
-          /* "pysam/cfaidx.pyx":114
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)
- *             self._lengths = tuple(int(x[1]) for x in data)             # <<<<<<<<<<<<<<
- *             self.reference2length = dict(zip(self._references, self._lengths))
- * 
- */
-          __pyx_t_3 = __pyx_pf_5pysam_6cfaidx_9FastaFile_5_open_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L10_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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_GIVEREF(__pyx_t_3);
-          __Pyx_GOTREF(__pyx_v_self->_lengths);
-          __Pyx_DECREF(__pyx_v_self->_lengths);
-          __pyx_v_self->_lengths = __pyx_t_3;
-          __pyx_t_3 = 0;
-
-          /* "pysam/cfaidx.pyx":115
- *             self._references = tuple(x[0] for x in data)
- *             self._lengths = tuple(int(x[1]) for x in data)
- *             self.reference2length = dict(zip(self._references, self._lengths))             # <<<<<<<<<<<<<<
- * 
- *     def close( self ):
- */
-          __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          __Pyx_INCREF(__pyx_v_self->_references);
-          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->_references);
-          __Pyx_GIVEREF(__pyx_v_self->_references);
-          __Pyx_INCREF(__pyx_v_self->_lengths);
-          PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->_lengths);
-          __Pyx_GIVEREF(__pyx_v_self->_lengths);
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __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 = 115; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-          __Pyx_GIVEREF(__pyx_t_2);
-          __pyx_t_2 = 0;
-          __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_GIVEREF(__pyx_t_2);
-          __Pyx_GOTREF(__pyx_v_self->reference2length);
-          __Pyx_DECREF(__pyx_v_self->reference2length);
-          __pyx_v_self->reference2length = __pyx_t_2;
-          __pyx_t_2 = 0;
-        }
-        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-        goto __pyx_L17_try_end;
-        __pyx_L10_error:;
-        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-        /* "pysam/cfaidx.pyx":111
- *             raise ValueError("could not locate index file")
- * 
- *         with open( self._filename + b".fai" ) as inf:             # <<<<<<<<<<<<<<
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)
- */
-        /*except:*/ {
-          __Pyx_AddTraceback("pysam.cfaidx.FastaFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_GOTREF(__pyx_t_3);
-          __Pyx_GOTREF(__pyx_t_13);
-          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_13); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_5);
-          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_14);
-          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14);
-          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-          if (__pyx_t_6 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __pyx_t_1 = ((!(__pyx_t_6 != 0)) != 0);
-          if (__pyx_t_1) {
-            __Pyx_GIVEREF(__pyx_t_2);
-            __Pyx_GIVEREF(__pyx_t_3);
-            __Pyx_XGIVEREF(__pyx_t_13);
-            __Pyx_ErrRestore(__pyx_t_2, __pyx_t_3, __pyx_t_13);
-            __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_13 = 0; 
-            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          }
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-          goto __pyx_L11_exception_handled;
-        }
-        __pyx_L12_except_error:;
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_XGIVEREF(__pyx_t_10);
-        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
-        goto __pyx_L1_error;
-        __pyx_L11_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_8);
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_XGIVEREF(__pyx_t_10);
-        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
-        __pyx_L17_try_end:;
-      }
-    }
-    /*finally:*/ {
-      /*normal exit:*/{
-        if (__pyx_t_7) {
-          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__5, NULL);
-          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-          if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_10);
-          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        }
-        goto __pyx_L9;
-      }
-      __pyx_L9:;
-    }
-    goto __pyx_L24;
-    __pyx_L6_error:;
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    goto __pyx_L1_error;
-    __pyx_L24:;
-  }
-
-  /* "pysam/cfaidx.pyx":93
- *         return faidx_nseq(self.fastafile)
- * 
- *     def _open(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an indexed fasta file.
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_13);
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_inf);
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":117
- *             self.reference2length = dict(zip(self._references, self._lengths))
- * 
- *     def close( self ):             # <<<<<<<<<<<<<<
- *         if self.fastafile != NULL:
- *             fai_destroy( self.fastafile )
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_9close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastaFile_8close[] = "FastaFile.close(self)";
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_9close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("close (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_8close(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_8close(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("close", 0);
-  __Pyx_TraceCall("close", __pyx_f[0], 117);
-
-  /* "pysam/cfaidx.pyx":118
- * 
- *     def close( self ):
- *         if self.fastafile != NULL:             # <<<<<<<<<<<<<<
- *             fai_destroy( self.fastafile )
- *             self.fastafile = NULL
- */
-  __pyx_t_1 = ((__pyx_v_self->fastafile != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/cfaidx.pyx":119
- *     def close( self ):
- *         if self.fastafile != NULL:
- *             fai_destroy( self.fastafile )             # <<<<<<<<<<<<<<
- *             self.fastafile = NULL
- * 
- */
-    fai_destroy(__pyx_v_self->fastafile);
-
-    /* "pysam/cfaidx.pyx":120
- *         if self.fastafile != NULL:
- *             fai_destroy( self.fastafile )
- *             self.fastafile = NULL             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-    __pyx_v_self->fastafile = NULL;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cfaidx.pyx":117
- *             self.reference2length = dict(zip(self._references, self._lengths))
- * 
- *     def close( self ):             # <<<<<<<<<<<<<<
- *         if self.fastafile != NULL:
- *             fai_destroy( self.fastafile )
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":122
- *             self.fastafile = NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         self.close()
- * 
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_6cfaidx_9FastaFile_11__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_6cfaidx_9FastaFile_11__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_6cfaidx_9FastaFile_10__dealloc__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_6cfaidx_9FastaFile_10__dealloc__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 122);
-
-  /* "pysam/cfaidx.pyx":123
- * 
- *     def __dealloc__(self):
- *         self.close()             # <<<<<<<<<<<<<<
- * 
- *     property filename:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); 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;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cfaidx.pyx":122
- *             self.fastafile = NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         self.close()
- * 
- */
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_WriteUnraisable("pysam.cfaidx.FastaFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/cfaidx.pyx":127
- *     property filename:
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._filename
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_8filename_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_8filename_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_8filename___get__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_8filename___get__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 127);
-
-  /* "pysam/cfaidx.pyx":128
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):
- *             return self._filename             # <<<<<<<<<<<<<<
- * 
- *     property references:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self->_filename);
-  __pyx_r = __pyx_v_self->_filename;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":127
- *     property filename:
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._filename
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":132
- *     property references:
- *         '''tuple with the names of :term:`reference` sequences.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._references
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_10references_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_10references_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_10references___get__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_10references___get__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 132);
-
-  /* "pysam/cfaidx.pyx":133
- *         '''tuple with the names of :term:`reference` sequences.'''
- *         def __get__(self):
- *             return self._references             # <<<<<<<<<<<<<<
- * 
- *     property nreferences:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self->_references);
-  __pyx_r = __pyx_v_self->_references;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":132
- *     property references:
- *         '''tuple with the names of :term:`reference` sequences.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._references
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":137
- *     property nreferences:
- *         '''number of :term:`reference` sequences in the file.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return len(self._references) if self.references else None
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_11nreferences_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_11nreferences_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_11nreferences___get__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_11nreferences___get__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  Py_ssize_t __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 137);
-
-  /* "pysam/cfaidx.pyx":138
- *         '''number of :term:`reference` sequences in the file.'''
- *         def __get__(self):
- *             return len(self._references) if self.references else None             # <<<<<<<<<<<<<<
- * 
- *     property lengths:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_references); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_2 = __pyx_v_self->_references;
-    __Pyx_INCREF(__pyx_t_2);
-    __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __pyx_t_2;
-    __pyx_t_2 = 0;
-  } else {
-    __Pyx_INCREF(Py_None);
-    __pyx_t_1 = Py_None;
-  }
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":137
- *     property nreferences:
- *         '''number of :term:`reference` sequences in the file.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return len(self._references) if self.references else None
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile.nreferences.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":142
- *     property lengths:
- *         '''tuple with the lengths of :term:`reference` sequences.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._lengths
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_7lengths_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_7lengths_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_7lengths___get__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_7lengths___get__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 142);
-
-  /* "pysam/cfaidx.pyx":143
- *         '''tuple with the lengths of :term:`reference` sequences.'''
- *         def __get__(self):
- *             return self._lengths             # <<<<<<<<<<<<<<
- * 
- *     def fetch(self,
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self->_lengths);
-  __pyx_r = __pyx_v_self->_lengths;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":142
- *     property lengths:
- *         '''tuple with the lengths of :term:`reference` sequences.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._lengths
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":145
- *             return self._lengths
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_13fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastaFile_12fetch[] = "FastaFile.fetch(self, reference=None, start=None, end=None, region=None)\n*(reference = None, start = None, end = None, region = None)*\n\n        fetch sequences in a :term:`region` using 0-based indexing.\n\n        The region is specified by :term:`reference`, *start* and *end*.\n\n        fetch returns an empty string if the region is out of range or\n        addresses an unknown *reference*.\n\n        If *reference* is gi [...]
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_13fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_reference = 0;
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_end = 0;
-  PyObject *__pyx_v_region = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("fetch (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,0};
-    PyObject* values[4] = {0,0,0,0};
-
-    /* "pysam/cfaidx.pyx":146
- * 
- *     def fetch(self,
- *               reference=None,             # <<<<<<<<<<<<<<
- *               start=None,
- *               end=None,
- */
-    values[0] = ((PyObject *)Py_None);
-
-    /* "pysam/cfaidx.pyx":147
- *     def fetch(self,
- *               reference=None,
- *               start=None,             # <<<<<<<<<<<<<<
- *               end=None,
- *               region=None):
- */
-    values[1] = ((PyObject *)Py_None);
-
-    /* "pysam/cfaidx.pyx":148
- *               reference=None,
- *               start=None,
- *               end=None,             # <<<<<<<<<<<<<<
- *               region=None):
- * 
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/cfaidx.pyx":149
- *               start=None,
- *               end=None,
- *               region=None):             # <<<<<<<<<<<<<<
- * 
- *         '''*(reference = None, start = None, end = None, region = None)*
- */
-    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:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reference);
-          if (value) { values[0] = value; kw_args--; }
-        }
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region);
-          if (value) { values[3] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __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);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_reference = values[0];
-    __pyx_v_start = values[1];
-    __pyx_v_end = values[2];
-    __pyx_v_region = values[3];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("fetch", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_12fetch(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self), __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region);
-
-  /* "pysam/cfaidx.pyx":145
- *             return self._lengths
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_12fetch(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region) {
-  int __pyx_v_length;
-  char *__pyx_v_seq;
-  PyObject *__pyx_v_py_seq = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  char *__pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  char const *__pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  PyObject *__pyx_t_14 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("fetch", 0);
-  __Pyx_TraceCall("fetch", __pyx_f[0], 145);
-  __Pyx_INCREF(__pyx_v_start);
-  __Pyx_INCREF(__pyx_v_end);
-  __Pyx_INCREF(__pyx_v_region);
-
-  /* "pysam/cfaidx.pyx":167
- *         '''
- * 
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError( "I/O operation on closed file" )
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/cfaidx.pyx":168
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         cdef int length
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cfaidx.pyx":173
- *         cdef char * seq
- * 
- *         if not region:             # <<<<<<<<<<<<<<
- *             if reference is None:
- *                 raise ValueError('no sequence/region supplied.')
- */
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_region); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = ((!__pyx_t_4) != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/cfaidx.pyx":174
- * 
- *         if not region:
- *             if reference is None:             # <<<<<<<<<<<<<<
- *                 raise ValueError('no sequence/region supplied.')
- *             if start is None:
- */
-    __pyx_t_3 = (__pyx_v_reference == Py_None);
-    __pyx_t_4 = (__pyx_t_3 != 0);
-    if (__pyx_t_4) {
-
-      /* "pysam/cfaidx.pyx":175
- *         if not region:
- *             if reference is None:
- *                 raise ValueError('no sequence/region supplied.')             # <<<<<<<<<<<<<<
- *             if start is None:
- *                 start = 0
- */
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/cfaidx.pyx":176
- *             if reference is None:
- *                 raise ValueError('no sequence/region supplied.')
- *             if start is None:             # <<<<<<<<<<<<<<
- *                 start = 0
- *             if end is None:
- */
-    __pyx_t_4 = (__pyx_v_start == Py_None);
-    __pyx_t_3 = (__pyx_t_4 != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/cfaidx.pyx":177
- *                 raise ValueError('no sequence/region supplied.')
- *             if start is None:
- *                 start = 0             # <<<<<<<<<<<<<<
- *             if end is None:
- *                 end = max_pos - 1
- */
-      __Pyx_INCREF(__pyx_int_0);
-      __Pyx_DECREF_SET(__pyx_v_start, __pyx_int_0);
-      goto __pyx_L6;
-    }
-    __pyx_L6:;
-
-    /* "pysam/cfaidx.pyx":178
- *             if start is None:
- *                 start = 0
- *             if end is None:             # <<<<<<<<<<<<<<
- *                 end = max_pos - 1
- * 
- */
-    __pyx_t_3 = (__pyx_v_end == Py_None);
-    __pyx_t_4 = (__pyx_t_3 != 0);
-    if (__pyx_t_4) {
-
-      /* "pysam/cfaidx.pyx":179
- *                 start = 0
- *             if end is None:
- *                 end = max_pos - 1             # <<<<<<<<<<<<<<
- * 
- *             if start > end:
- */
-      __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_5pysam_6cfaidx_max_pos - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_2);
-      __pyx_t_2 = 0;
-      goto __pyx_L7;
-    }
-    __pyx_L7:;
-
-    /* "pysam/cfaidx.pyx":181
- *                 end = max_pos - 1
- * 
- *             if start > end:             # <<<<<<<<<<<<<<
- *                 raise ValueError(
- *                     'invalid region: start (%i) > end (%i)' % (start, end))
- */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_4) {
-
-      /* "pysam/cfaidx.pyx":183
- *             if start > end:
- *                 raise ValueError(
- *                     'invalid region: start (%i) > end (%i)' % (start, end))             # <<<<<<<<<<<<<<
- *             if start == end:
- *                 return b""
- */
-      __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_start);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start);
-      __Pyx_GIVEREF(__pyx_v_start);
-      __Pyx_INCREF(__pyx_v_end);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end);
-      __Pyx_GIVEREF(__pyx_v_end);
-      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_invalid_region_start_i_end_i, __pyx_t_2); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-      /* "pysam/cfaidx.pyx":182
- * 
- *             if start > end:
- *                 raise ValueError(             # <<<<<<<<<<<<<<
- *                     'invalid region: start (%i) > end (%i)' % (start, end))
- *             if start == end:
- */
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/cfaidx.pyx":184
- *                 raise ValueError(
- *                     'invalid region: start (%i) > end (%i)' % (start, end))
- *             if start == end:             # <<<<<<<<<<<<<<
- *                 return b""
- *             # valid ranges are from 0 to 2^29-1
- */
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_4) {
-
-      /* "pysam/cfaidx.pyx":185
- *                     'invalid region: start (%i) > end (%i)' % (start, end))
- *             if start == end:
- *                 return b""             # <<<<<<<<<<<<<<
- *             # valid ranges are from 0 to 2^29-1
- *             if not 0 <= start < max_pos:
- */
-      __Pyx_XDECREF(__pyx_r);
-      __Pyx_INCREF(__pyx_kp_b__8);
-      __pyx_r = __pyx_kp_b__8;
-      goto __pyx_L0;
-    }
-
-    /* "pysam/cfaidx.pyx":187
- *                 return b""
- *             # valid ranges are from 0 to 2^29-1
- *             if not 0 <= start < max_pos:             # <<<<<<<<<<<<<<
- *                 raise IndexError('start out of range (%i)' % start)
- *             if not 0 <= end < max_pos:
- */
-    __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_start, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
-      __Pyx_DECREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_5pysam_6cfaidx_max_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyObject_RichCompare(__pyx_v_start, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    }
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = ((!__pyx_t_4) != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/cfaidx.pyx":188
- *             # valid ranges are from 0 to 2^29-1
- *             if not 0 <= start < max_pos:
- *                 raise IndexError('start out of range (%i)' % start)             # <<<<<<<<<<<<<<
- *             if not 0 <= end < max_pos:
- *                 raise IndexError('end out of range (%i)' % end)
- */
-      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_start_out_of_range_i, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __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 = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/cfaidx.pyx":189
- *             if not 0 <= start < max_pos:
- *                 raise IndexError('start out of range (%i)' % start)
- *             if not 0 <= end < max_pos:             # <<<<<<<<<<<<<<
- *                 raise IndexError('end out of range (%i)' % end)
- *             # note: faidx_fetch_seq has a bug such that out-of-range access
- */
-    __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_end, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
-      __Pyx_DECREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_5pysam_6cfaidx_max_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyObject_RichCompare(__pyx_v_end, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    }
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = ((!__pyx_t_3) != 0);
-    if (__pyx_t_4) {
-
-      /* "pysam/cfaidx.pyx":190
- *                 raise IndexError('start out of range (%i)' % start)
- *             if not 0 <= end < max_pos:
- *                 raise IndexError('end out of range (%i)' % end)             # <<<<<<<<<<<<<<
- *             # note: faidx_fetch_seq has a bug such that out-of-range access
- *             # always returns the last residue. Hence do not use faidx_fetch_seq,
- */
-      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_end_out_of_range_i, __pyx_v_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __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 = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/cfaidx.pyx":199
- *             #                       end-1,
- *             #                       &length)
- *             region = "%s:%i-%i" % (reference, start+1, end)             # <<<<<<<<<<<<<<
- *             if PY_MAJOR_VERSION >= 3:
- *                 region = region.encode('ascii')
- */
-    __pyx_t_1 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __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 = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_reference);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
-    __Pyx_GIVEREF(__pyx_v_reference);
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_v_end);
-    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
-    __Pyx_GIVEREF(__pyx_v_end);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_i_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF_SET(__pyx_v_region, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/cfaidx.pyx":200
- *             #                       &length)
- *             region = "%s:%i-%i" % (reference, start+1, end)
- *             if PY_MAJOR_VERSION >= 3:             # <<<<<<<<<<<<<<
- *                 region = region.encode('ascii')
- *             seq = fai_fetch( self.fastafile,
- */
-    __pyx_t_4 = ((PY_MAJOR_VERSION >= 3) != 0);
-    if (__pyx_t_4) {
-
-      /* "pysam/cfaidx.pyx":201
- *             region = "%s:%i-%i" % (reference, start+1, end)
- *             if PY_MAJOR_VERSION >= 3:
- *                 region = region.encode('ascii')             # <<<<<<<<<<<<<<
- *             seq = fai_fetch( self.fastafile,
- *                              region,
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_region, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF_SET(__pyx_v_region, __pyx_t_2);
-      __pyx_t_2 = 0;
-      goto __pyx_L12;
-    }
-    __pyx_L12:;
-
-    /* "pysam/cfaidx.pyx":203
- *                 region = region.encode('ascii')
- *             seq = fai_fetch( self.fastafile,
- *                              region,             # <<<<<<<<<<<<<<
- *                              &length )
- *         else:
- */
-    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_region); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/cfaidx.pyx":202
- *             if PY_MAJOR_VERSION >= 3:
- *                 region = region.encode('ascii')
- *             seq = fai_fetch( self.fastafile,             # <<<<<<<<<<<<<<
- *                              region,
- *                              &length )
- */
-    __pyx_v_seq = fai_fetch(__pyx_v_self->fastafile, __pyx_t_5, (&__pyx_v_length));
-    goto __pyx_L4;
-  }
-  /*else*/ {
-
-    /* "pysam/cfaidx.pyx":207
- *         else:
- *             # samtools adds a '\0' at the end
- *             seq = fai_fetch( self.fastafile, region, &length )             # <<<<<<<<<<<<<<
- * 
- *         # copy to python
- */
-    __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_region); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_seq = fai_fetch(__pyx_v_self->fastafile, __pyx_t_5, (&__pyx_v_length));
-  }
-  __pyx_L4:;
-
-  /* "pysam/cfaidx.pyx":210
- * 
- *         # copy to python
- *         if seq == NULL:             # <<<<<<<<<<<<<<
- *             return b""
- *         else:
- */
-  __pyx_t_4 = ((__pyx_v_seq == NULL) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/cfaidx.pyx":211
- *         # copy to python
- *         if seq == NULL:
- *             return b""             # <<<<<<<<<<<<<<
- *         else:
- *             try:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_kp_b__8);
-    __pyx_r = __pyx_kp_b__8;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/cfaidx.pyx":213
- *             return b""
- *         else:
- *             try:             # <<<<<<<<<<<<<<
- *                 py_seq = seq[:length]
- *             finally:
- */
-    /*try:*/ {
-
-      /* "pysam/cfaidx.pyx":214
- *         else:
- *             try:
- *                 py_seq = seq[:length]             # <<<<<<<<<<<<<<
- *             finally:
- *                 free(seq)
- */
-      __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_seq + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_v_py_seq = ((PyObject*)__pyx_t_2);
-      __pyx_t_2 = 0;
-    }
-
-    /* "pysam/cfaidx.pyx":216
- *                 py_seq = seq[:length]
- *             finally:
- *                 free(seq)             # <<<<<<<<<<<<<<
- * 
- *         return py_seq
- */
-    /*finally:*/ {
-      /*normal exit:*/{
-        free(__pyx_v_seq);
-        goto __pyx_L16;
-      }
-      /*exception exit:*/{
-        __pyx_L15_error:;
-        __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
-        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
-        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
-        __Pyx_XGOTREF(__pyx_t_9);
-        __Pyx_XGOTREF(__pyx_t_10);
-        __Pyx_XGOTREF(__pyx_t_11);
-        __Pyx_XGOTREF(__pyx_t_12);
-        __Pyx_XGOTREF(__pyx_t_13);
-        __Pyx_XGOTREF(__pyx_t_14);
-        __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
-        {
-          free(__pyx_v_seq);
-        }
-        if (PY_MAJOR_VERSION >= 3) {
-          __Pyx_XGIVEREF(__pyx_t_12);
-          __Pyx_XGIVEREF(__pyx_t_13);
-          __Pyx_XGIVEREF(__pyx_t_14);
-          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
-        }
-        __Pyx_XGIVEREF(__pyx_t_9);
-        __Pyx_XGIVEREF(__pyx_t_10);
-        __Pyx_XGIVEREF(__pyx_t_11);
-        __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
-        __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
-        __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
-        goto __pyx_L1_error;
-      }
-      __pyx_L16:;
-    }
-  }
-
-  /* "pysam/cfaidx.pyx":218
- *                 free(seq)
- * 
- *         return py_seq             # <<<<<<<<<<<<<<
- * 
- *     cdef char * _fetch( self, char * reference, int start, int end, int * length ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_py_seq);
-  __pyx_r = __pyx_v_py_seq;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":145
- *             return self._lengths
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_py_seq);
-  __Pyx_XDECREF(__pyx_v_start);
-  __Pyx_XDECREF(__pyx_v_end);
-  __Pyx_XDECREF(__pyx_v_region);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":220
- *         return py_seq
- * 
- *     cdef char * _fetch( self, char * reference, int start, int end, int * length ):             # <<<<<<<<<<<<<<
- *         '''fetch sequence for reference, start and end'''
- * 
- */
-
-static char *__pyx_f_5pysam_6cfaidx_9FastaFile__fetch(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, char *__pyx_v_reference, int __pyx_v_start, int __pyx_v_end, int *__pyx_v_length) {
-  char *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_fetch", 0);
-  __Pyx_TraceCall("_fetch", __pyx_f[0], 220);
-
-  /* "pysam/cfaidx.pyx":223
- *         '''fetch sequence for reference, start and end'''
- * 
- *         return faidx_fetch_seq(self.fastafile,             # <<<<<<<<<<<<<<
- *                                reference,
- *                                start,
- */
-  __pyx_r = faidx_fetch_seq(__pyx_v_self->fastafile, __pyx_v_reference, __pyx_v_start, (__pyx_v_end - 1), __pyx_v_length);
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":220
- *         return py_seq
- * 
- *     cdef char * _fetch( self, char * reference, int start, int end, int * length ):             # <<<<<<<<<<<<<<
- *         '''fetch sequence for reference, start and end'''
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":229
- *                                length )
- * 
- *     def get_reference_length(self, reference):             # <<<<<<<<<<<<<<
- *         '''return the length of reference.'''
- *         return self.reference2length[reference]
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_15get_reference_length(PyObject *__pyx_v_self, PyObject *__pyx_v_reference); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastaFile_14get_reference_length[] = "FastaFile.get_reference_length(self, reference)\nreturn the length of reference.";
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_15get_reference_length(PyObject *__pyx_v_self, PyObject *__pyx_v_reference) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_reference_length (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_14get_reference_length(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self), ((PyObject *)__pyx_v_reference));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_14get_reference_length(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference) {
-  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("get_reference_length", 0);
-  __Pyx_TraceCall("get_reference_length", __pyx_f[0], 229);
-
-  /* "pysam/cfaidx.pyx":231
- *     def get_reference_length(self, reference):
- *         '''return the length of reference.'''
- *         return self.reference2length[reference]             # <<<<<<<<<<<<<<
- * 
- *     def __getitem__(self, reference):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_GetItem(__pyx_v_self->reference2length, __pyx_v_reference); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":229
- *                                length )
- * 
- *     def get_reference_length(self, reference):             # <<<<<<<<<<<<<<
- *         '''return the length of reference.'''
- *         return self.reference2length[reference]
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile.get_reference_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":233
- *         return self.reference2length[reference]
- * 
- *     def __getitem__(self, reference):             # <<<<<<<<<<<<<<
- *         return self.fetch(reference)
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_17__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_reference); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastaFile_17__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_reference) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_16__getitem__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self), ((PyObject *)__pyx_v_reference));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastaFile_16__getitem__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference) {
-  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("__getitem__", 0);
-  __Pyx_TraceCall("__getitem__", __pyx_f[0], 233);
-
-  /* "pysam/cfaidx.pyx":234
- * 
- *     def __getitem__(self, reference):
- *         return self.fetch(reference)             # <<<<<<<<<<<<<<
- * 
- *     def __contains__(self, reference):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fetch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __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 = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_reference);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
-  __Pyx_GIVEREF(__pyx_v_reference);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":233
- *         return self.reference2length[reference]
- * 
- *     def __getitem__(self, reference):             # <<<<<<<<<<<<<<
- *         return self.fetch(reference)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":236
- *         return self.fetch(reference)
- * 
- *     def __contains__(self, reference):             # <<<<<<<<<<<<<<
- *         '''return true if reference in fasta file.'''
- *         return reference in self.reference2length
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6cfaidx_9FastaFile_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_reference); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastaFile_18__contains__[] = "return true if reference in fasta file.";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_6cfaidx_9FastaFile_18__contains__;
-#endif
-static int __pyx_pw_5pysam_6cfaidx_9FastaFile_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_reference) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastaFile_18__contains__(((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)__pyx_v_self), ((PyObject *)__pyx_v_reference));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6cfaidx_9FastaFile_18__contains__(struct __pyx_obj_5pysam_6cfaidx_FastaFile *__pyx_v_self, PyObject *__pyx_v_reference) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__contains__", 0);
-  __Pyx_TraceCall("__contains__", __pyx_f[0], 236);
-
-  /* "pysam/cfaidx.pyx":238
- *     def __contains__(self, reference):
- *         '''return true if reference in fasta file.'''
- *         return reference in self.reference2length             # <<<<<<<<<<<<<<
- * 
- * ######################################################################
- */
-  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_reference, __pyx_v_self->reference2length, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_t_1;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":236
- *         return self.fetch(reference)
- * 
- *     def __contains__(self, reference):             # <<<<<<<<<<<<<<
- *         '''return true if reference in fasta file.'''
- *         return reference in self.reference2length
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cfaidx.FastaFile.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":247
- * 
- * cdef class FastqProxy:
- *     def __init__(self): pass             # <<<<<<<<<<<<<<
- * 
- *     property name:
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6cfaidx_10FastqProxy_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6cfaidx_10FastqProxy_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
-    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
-  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_10FastqProxy___init__(((struct __pyx_obj_5pysam_6cfaidx_FastqProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6cfaidx_10FastqProxy___init__(CYTHON_UNUSED struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 247);
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":250
- * 
- *     property name:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.name.s
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_10FastqProxy_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_10FastqProxy_4name_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_10FastqProxy_4name___get__(((struct __pyx_obj_5pysam_6cfaidx_FastqProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_10FastqProxy_4name___get__(struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 250);
-
-  /* "pysam/cfaidx.pyx":251
- *     property name:
- *         def __get__(self):
- *             return self._delegate.name.s             # <<<<<<<<<<<<<<
- * 
- *     property sequence:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->_delegate->name.s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":250
- * 
- *     property name:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.name.s
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cfaidx.FastqProxy.name.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":254
- * 
- *     property sequence:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.seq.s
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_10FastqProxy_8sequence_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_10FastqProxy_8sequence_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_10FastqProxy_8sequence___get__(((struct __pyx_obj_5pysam_6cfaidx_FastqProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_10FastqProxy_8sequence___get__(struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_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("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 254);
-
-  /* "pysam/cfaidx.pyx":255
- *     property sequence:
- *         def __get__(self):
- *             return self._delegate.seq.s             # <<<<<<<<<<<<<<
- * 
- *     property comment:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->_delegate->seq.s); 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_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":254
- * 
- *     property sequence:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._delegate.seq.s
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cfaidx.FastqProxy.sequence.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":258
- * 
- *     property comment:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if self._delegate.comment.l:
- *                 return self._delegate.comment.s
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_10FastqProxy_7comment_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_10FastqProxy_7comment_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_10FastqProxy_7comment___get__(((struct __pyx_obj_5pysam_6cfaidx_FastqProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_10FastqProxy_7comment___get__(struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 258);
-
-  /* "pysam/cfaidx.pyx":259
- *     property comment:
- *         def __get__(self):
- *             if self._delegate.comment.l:             # <<<<<<<<<<<<<<
- *                 return self._delegate.comment.s
- *             else: return None
- */
-  __pyx_t_1 = (__pyx_v_self->_delegate->comment.l != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/cfaidx.pyx":260
- *         def __get__(self):
- *             if self._delegate.comment.l:
- *                 return self._delegate.comment.s             # <<<<<<<<<<<<<<
- *             else: return None
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_delegate->comment.s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/cfaidx.pyx":261
- *             if self._delegate.comment.l:
- *                 return self._delegate.comment.s
- *             else: return None             # <<<<<<<<<<<<<<
- * 
- *     property quality:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cfaidx.pyx":258
- * 
- *     property comment:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if self._delegate.comment.l:
- *                 return self._delegate.comment.s
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cfaidx.FastqProxy.comment.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":264
- * 
- *     property quality:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if self._delegate.qual.l:
- *                 return self._delegate.qual.s
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_10FastqProxy_7quality_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_10FastqProxy_7quality_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_10FastqProxy_7quality___get__(((struct __pyx_obj_5pysam_6cfaidx_FastqProxy *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_10FastqProxy_7quality___get__(struct __pyx_obj_5pysam_6cfaidx_FastqProxy *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 264);
-
-  /* "pysam/cfaidx.pyx":265
- *     property quality:
- *         def __get__(self):
- *             if self._delegate.qual.l:             # <<<<<<<<<<<<<<
- *                 return self._delegate.qual.s
- *             else: return None
- */
-  __pyx_t_1 = (__pyx_v_self->_delegate->qual.l != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/cfaidx.pyx":266
- *         def __get__(self):
- *             if self._delegate.qual.l:
- *                 return self._delegate.qual.s             # <<<<<<<<<<<<<<
- *             else: return None
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->_delegate->qual.s); 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_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/cfaidx.pyx":267
- *             if self._delegate.qual.l:
- *                 return self._delegate.qual.s
- *             else: return None             # <<<<<<<<<<<<<<
- * 
- * cdef class FastqFile:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cfaidx.pyx":264
- * 
- *     property quality:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if self._delegate.qual.l:
- *                 return self._delegate.qual.s
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cfaidx.FastqProxy.quality.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":278
- * 
- *     '''
- *     def __cinit__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
- *         # self.fastqfile = <gzFile*>NULL
- *         self._filename = None
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6cfaidx_9FastqFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6cfaidx_9FastqFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_args = 0;
-  PyObject *__pyx_v_kwargs = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1;
-  __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
-  if (unlikely(!__pyx_v_kwargs)) return -1;
-  __Pyx_GOTREF(__pyx_v_kwargs);
-  __Pyx_INCREF(__pyx_args);
-  __pyx_v_args = __pyx_args;
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastqFile___cinit__(((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
-
-  /* function exit code */
-  __Pyx_XDECREF(__pyx_v_args);
-  __Pyx_XDECREF(__pyx_v_kwargs);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6cfaidx_9FastqFile___cinit__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-  __Pyx_TraceCall("__cinit__", __pyx_f[0], 278);
-
-  /* "pysam/cfaidx.pyx":280
- *     def __cinit__(self, *args, **kwargs):
- *         # self.fastqfile = <gzFile*>NULL
- *         self._filename = None             # <<<<<<<<<<<<<<
- *         self.entry = NULL
- *         self._open(*args, **kwargs)
- */
-  __Pyx_INCREF(Py_None);
-  __Pyx_GIVEREF(Py_None);
-  __Pyx_GOTREF(__pyx_v_self->_filename);
-  __Pyx_DECREF(__pyx_v_self->_filename);
-  __pyx_v_self->_filename = Py_None;
-
-  /* "pysam/cfaidx.pyx":281
- *         # self.fastqfile = <gzFile*>NULL
- *         self._filename = None
- *         self.entry = NULL             # <<<<<<<<<<<<<<
- *         self._open(*args, **kwargs)
- * 
- */
-  __pyx_v_self->entry = NULL;
-
-  /* "pysam/cfaidx.pyx":282
- *         self._filename = None
- *         self.entry = NULL
- *         self._open(*args, **kwargs)             # <<<<<<<<<<<<<<
- * 
- *     def _isOpen( self ):
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __pyx_v_kwargs;
-  __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/cfaidx.pyx":278
- * 
- *     '''
- *     def __cinit__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
- *         # self.fastqfile = <gzFile*>NULL
- *         self._filename = None
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.cfaidx.FastqFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":284
- *         self._open(*args, **kwargs)
- * 
- *     def _isOpen( self ):             # <<<<<<<<<<<<<<
- *         '''return true if samfile has been opened.'''
- *         return self.entry != NULL
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_3_isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastqFile_2_isOpen[] = "FastqFile._isOpen(self)\nreturn true if samfile has been opened.";
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_3_isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_isOpen (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastqFile_2_isOpen(((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_2_isOpen(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_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("_isOpen", 0);
-  __Pyx_TraceCall("_isOpen", __pyx_f[0], 284);
-
-  /* "pysam/cfaidx.pyx":286
- *     def _isOpen( self ):
- *         '''return true if samfile has been opened.'''
- *         return self.entry != NULL             # <<<<<<<<<<<<<<
- * 
- *     def _open(self, filename):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->entry != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":284
- *         self._open(*args, **kwargs)
- * 
- *     def _isOpen( self ):             # <<<<<<<<<<<<<<
- *         '''return true if samfile has been opened.'''
- *         return self.entry != NULL
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cfaidx.FastqFile._isOpen", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":288
- *         return self.entry != NULL
- * 
- *     def _open(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an indexed fasta file.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_5_open(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastqFile_4_open[] = "FastqFile._open(self, filename)\nopen an indexed fasta file.\n\n        This method expects an indexed fasta file.\n        ";
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_5_open(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastqFile_4_open(((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)__pyx_v_self), ((PyObject *)__pyx_v_filename));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_4_open(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self, PyObject *__pyx_v_filename) {
-  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;
-  int __pyx_t_5;
-  char *__pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_open", 0);
-  __Pyx_TraceCall("_open", __pyx_f[0], 288);
-  __Pyx_INCREF(__pyx_v_filename);
-
-  /* "pysam/cfaidx.pyx":293
- *         This method expects an indexed fasta file.
- *         '''
- *         self.close()             # <<<<<<<<<<<<<<
- * 
- *         if not os.path.exists(filename):
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cfaidx.pyx":295
- *         self.close()
- * 
- *         if not os.path.exists(filename):             # <<<<<<<<<<<<<<
- *             raise IOError("No such file or directory: %s" % filename)
- * 
- */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __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 = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = ((!__pyx_t_4) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/cfaidx.pyx":296
- * 
- *         if not os.path.exists(filename):
- *             raise IOError("No such file or directory: %s" % filename)             # <<<<<<<<<<<<<<
- * 
- *         filename = _encodeFilename(filename)
- */
-    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_No_such_file_or_directory_s, __pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cfaidx.pyx":298
- *             raise IOError("No such file or directory: %s" % filename)
- * 
- *         filename = _encodeFilename(filename)             # <<<<<<<<<<<<<<
- *         self.fastqfile = gzopen(filename, "r")
- *         self.entry = kseq_init(self.fastqfile)
- */
-  __pyx_t_3 = __pyx_f_5pysam_6cfaidx__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/cfaidx.pyx":299
- * 
- *         filename = _encodeFilename(filename)
- *         self.fastqfile = gzopen(filename, "r")             # <<<<<<<<<<<<<<
- *         self.entry = kseq_init(self.fastqfile)
- *         self._filename = filename
- */
-  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->fastqfile = gzopen(__pyx_t_6, __pyx_k_r);
-
-  /* "pysam/cfaidx.pyx":300
- *         filename = _encodeFilename(filename)
- *         self.fastqfile = gzopen(filename, "r")
- *         self.entry = kseq_init(self.fastqfile)             # <<<<<<<<<<<<<<
- *         self._filename = filename
- * 
- */
-  __pyx_v_self->entry = kseq_init(__pyx_v_self->fastqfile);
-
-  /* "pysam/cfaidx.pyx":301
- *         self.fastqfile = gzopen(filename, "r")
- *         self.entry = kseq_init(self.fastqfile)
- *         self._filename = filename             # <<<<<<<<<<<<<<
- * 
- *     def close( self ):
- */
-  __Pyx_INCREF(__pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  __Pyx_GOTREF(__pyx_v_self->_filename);
-  __Pyx_DECREF(__pyx_v_self->_filename);
-  __pyx_v_self->_filename = __pyx_v_filename;
-
-  /* "pysam/cfaidx.pyx":288
- *         return self.entry != NULL
- * 
- *     def _open(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an indexed fasta file.
- * 
- */
-
-  /* function exit code */
-  __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("pysam.cfaidx.FastqFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_filename);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":303
- *         self._filename = filename
- * 
- *     def close( self ):             # <<<<<<<<<<<<<<
- *         '''close file.'''
- *         if self.entry != NULL:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastqFile_6close[] = "FastqFile.close(self)\nclose file.";
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_7close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("close (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastqFile_6close(((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_6close(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("close", 0);
-  __Pyx_TraceCall("close", __pyx_f[0], 303);
-
-  /* "pysam/cfaidx.pyx":305
- *     def close( self ):
- *         '''close file.'''
- *         if self.entry != NULL:             # <<<<<<<<<<<<<<
- *             gzclose(self.fastqfile)
- *             if self.entry:
- */
-  __pyx_t_1 = ((__pyx_v_self->entry != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/cfaidx.pyx":306
- *         '''close file.'''
- *         if self.entry != NULL:
- *             gzclose(self.fastqfile)             # <<<<<<<<<<<<<<
- *             if self.entry:
- *                 kseq_destroy(self.entry)
- */
-    gzclose(__pyx_v_self->fastqfile);
-
-    /* "pysam/cfaidx.pyx":307
- *         if self.entry != NULL:
- *             gzclose(self.fastqfile)
- *             if self.entry:             # <<<<<<<<<<<<<<
- *                 kseq_destroy(self.entry)
- *                 self.entry = NULL
- */
-    __pyx_t_1 = (__pyx_v_self->entry != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/cfaidx.pyx":308
- *             gzclose(self.fastqfile)
- *             if self.entry:
- *                 kseq_destroy(self.entry)             # <<<<<<<<<<<<<<
- *                 self.entry = NULL
- * 
- */
-      kseq_destroy(__pyx_v_self->entry);
-
-      /* "pysam/cfaidx.pyx":309
- *             if self.entry:
- *                 kseq_destroy(self.entry)
- *                 self.entry = NULL             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-      __pyx_v_self->entry = NULL;
-      goto __pyx_L4;
-    }
-    __pyx_L4:;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cfaidx.pyx":303
- *         self._filename = filename
- * 
- *     def close( self ):             # <<<<<<<<<<<<<<
- *         '''close file.'''
- *         if self.entry != NULL:
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":311
- *                 self.entry = NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         self.close()
- * 
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_6cfaidx_9FastqFile_9__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_6cfaidx_9FastqFile_9__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_6cfaidx_9FastqFile_8__dealloc__(((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_6cfaidx_9FastqFile_8__dealloc__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-  __Pyx_TraceCall("__dealloc__", __pyx_f[0], 311);
-
-  /* "pysam/cfaidx.pyx":312
- * 
- *     def __dealloc__(self):
- *         self.close()             # <<<<<<<<<<<<<<
- * 
- *     property filename:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cfaidx.pyx":311
- *                 self.entry = NULL
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         self.close()
- * 
- */
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_WriteUnraisable("pysam.cfaidx.FastqFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/cfaidx.pyx":316
- *     property filename:
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._filename
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_8filename_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_8filename_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastqFile_8filename___get__(((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_8filename___get__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__get__", 0);
-  __Pyx_TraceCall("__get__", __pyx_f[0], 316);
-
-  /* "pysam/cfaidx.pyx":317
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):
- *             return self._filename             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self->_filename);
-  __pyx_r = __pyx_v_self->_filename;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":316
- *     property filename:
- *         '''number of :term:`filename` associated with this object.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self._filename
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":319
- *             return self._filename
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_11__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_11__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastqFile_10__iter__(((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_10__iter__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-  __Pyx_TraceCall("__iter__", __pyx_f[0], 319);
-
-  /* "pysam/cfaidx.pyx":320
- * 
- *     def __iter__(self):
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError( "I/O operation on closed file" )
- *         return self
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/cfaidx.pyx":321
- *     def __iter__(self):
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cfaidx.pyx":322
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef kseq_t * getCurrent(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":319
- *             return self._filename
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cfaidx.FastqFile.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":324
- *         return self
- * 
- *     cdef kseq_t * getCurrent(self):             # <<<<<<<<<<<<<<
- *         return self.entry
- * 
- */
-
-static kseq_t *__pyx_f_5pysam_6cfaidx_9FastqFile_getCurrent(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self) {
-  kseq_t *__pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("getCurrent", 0);
-  __Pyx_TraceCall("getCurrent", __pyx_f[0], 324);
-
-  /* "pysam/cfaidx.pyx":325
- * 
- *     cdef kseq_t * getCurrent(self):
- *         return self.entry             # <<<<<<<<<<<<<<
- * 
- *     cdef int cnext(self):
- */
-  __pyx_r = __pyx_v_self->entry;
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":324
- *         return self
- * 
- *     cdef kseq_t * getCurrent(self):             # <<<<<<<<<<<<<<
- *         return self.entry
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":327
- *         return self.entry
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''C version of iterator
- *         '''
- */
-
-static int __pyx_f_5pysam_6cfaidx_9FastqFile_cnext(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("cnext", 0);
-  __Pyx_TraceCall("cnext", __pyx_f[0], 327);
-
-  /* "pysam/cfaidx.pyx":330
- *         '''C version of iterator
- *         '''
- *         return kseq_read(self.entry)             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __pyx_r = kseq_read(__pyx_v_self->entry);
-  goto __pyx_L0;
-
-  /* "pysam/cfaidx.pyx":327
- *         return self.entry
- * 
- *     cdef int cnext(self):             # <<<<<<<<<<<<<<
- *         '''C version of iterator
- *         '''
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_TraceReturn(Py_None);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cfaidx.pyx":332
- *         return kseq_read(self.entry)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """
- *         python version of next().
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_13__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6cfaidx_9FastqFile_12__next__[] = "\n        python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_6cfaidx_9FastqFile_12__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_6cfaidx_9FastqFile_13__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6cfaidx_9FastqFile_12__next__(((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6cfaidx_9FastqFile_12__next__(struct __pyx_obj_5pysam_6cfaidx_FastqFile *__pyx_v_self) {
-  int __pyx_v_l;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("__next__", 0);
-  __Pyx_TraceCall("__next__", __pyx_f[0], 332);
-
-  /* "pysam/cfaidx.pyx":337
- *         """
- *         cdef int l
- *         l = kseq_read( self.entry)             # <<<<<<<<<<<<<<
- *         if (l > 0):
- *             return makeFastqProxy( self.entry )
- */
-  __pyx_v_l = kseq_read(__pyx_v_self->entry);
-
-  /* "pysam/cfaidx.pyx":338
- *         cdef int l
- *         l = kseq_read( self.entry)
- *         if (l > 0):             # <<<<<<<<<<<<<<
- *             return makeFastqProxy( self.entry )
- *         else:
- */
-  __pyx_t_1 = ((__pyx_v_l > 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/cfaidx.pyx":339
- *         l = kseq_read( self.entry)
- *         if (l > 0):
- *             return makeFastqProxy( self.entry )             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_5pysam_6cfaidx_makeFastqProxy(__pyx_v_self->entry); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/cfaidx.pyx":341
- *             return makeFastqProxy( self.entry )
- *         else:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- * # Compatibility Layer for pysam < 0.8
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cfaidx.pyx":332
- *         return kseq_read(self.entry)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """
- *         python version of next().
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cfaidx.FastqFile.__next__", __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 struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile __pyx_vtable_5pysam_6cfaidx_FastaFile;
-
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_FastaFile(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6cfaidx_FastaFile *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6cfaidx_FastaFile *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_6cfaidx_FastaFile;
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  p->_references = Py_None; Py_INCREF(Py_None);
-  p->_lengths = Py_None; Py_INCREF(Py_None);
-  p->reference2length = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_5pysam_6cfaidx_9FastaFile_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6cfaidx_FastaFile(PyObject *o) {
-  struct __pyx_obj_5pysam_6cfaidx_FastaFile *p = (struct __pyx_obj_5pysam_6cfaidx_FastaFile *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_6cfaidx_9FastaFile_11__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->_filename);
-  Py_CLEAR(p->_references);
-  Py_CLEAR(p->_lengths);
-  Py_CLEAR(p->reference2length);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6cfaidx_FastaFile(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6cfaidx_FastaFile *p = (struct __pyx_obj_5pysam_6cfaidx_FastaFile *)o;
-  if (p->_filename) {
-    e = (*v)(p->_filename, a); if (e) return e;
-  }
-  if (p->_references) {
-    e = (*v)(p->_references, a); if (e) return e;
-  }
-  if (p->_lengths) {
-    e = (*v)(p->_lengths, a); if (e) return e;
-  }
-  if (p->reference2length) {
-    e = (*v)(p->reference2length, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6cfaidx_FastaFile(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6cfaidx_FastaFile *p = (struct __pyx_obj_5pysam_6cfaidx_FastaFile *)o;
-  tmp = ((PyObject*)p->_filename);
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->_references);
-  p->_references = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->_lengths);
-  p->_lengths = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->reference2length);
-  p->reference2length = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-static PyObject *__pyx_sq_item_5pysam_6cfaidx_FastaFile(PyObject *o, Py_ssize_t i) {
-  PyObject *r;
-  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
-  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
-  Py_DECREF(x);
-  return r;
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_9FastaFile_filename(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_9FastaFile_8filename_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_9FastaFile_references(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_9FastaFile_10references_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_9FastaFile_nreferences(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_9FastaFile_11nreferences_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_9FastaFile_lengths(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_9FastaFile_7lengths_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_6cfaidx_FastaFile[] = {
-  {__Pyx_NAMESTR("_isOpen"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastaFile_3_isOpen, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastaFile_2_isOpen)},
-  {__Pyx_NAMESTR("_open"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastaFile_7_open, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastaFile_6_open)},
-  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastaFile_9close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastaFile_8close)},
-  {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastaFile_13fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastaFile_12fetch)},
-  {__Pyx_NAMESTR("get_reference_length"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastaFile_15get_reference_length, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastaFile_14get_reference_length)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_6cfaidx_FastaFile[] = {
-  {(char *)"filename", __pyx_getprop_5pysam_6cfaidx_9FastaFile_filename, 0, __Pyx_DOCSTR(__pyx_k_number_of_term_filename_associat), 0},
-  {(char *)"references", __pyx_getprop_5pysam_6cfaidx_9FastaFile_references, 0, __Pyx_DOCSTR(__pyx_k_tuple_with_the_names_of_term_ref), 0},
-  {(char *)"nreferences", __pyx_getprop_5pysam_6cfaidx_9FastaFile_nreferences, 0, __Pyx_DOCSTR(__pyx_k_number_of_term_reference_sequenc), 0},
-  {(char *)"lengths", __pyx_getprop_5pysam_6cfaidx_9FastaFile_lengths, 0, __Pyx_DOCSTR(__pyx_k_tuple_with_the_lengths_of_term_r), 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_FastaFile = {
-  __pyx_pw_5pysam_6cfaidx_9FastaFile_5__len__, /*sq_length*/
-  0, /*sq_concat*/
-  0, /*sq_repeat*/
-  __pyx_sq_item_5pysam_6cfaidx_FastaFile, /*sq_item*/
-  0, /*sq_slice*/
-  0, /*sq_ass_item*/
-  0, /*sq_ass_slice*/
-  __pyx_pw_5pysam_6cfaidx_9FastaFile_19__contains__, /*sq_contains*/
-  0, /*sq_inplace_concat*/
-  0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_FastaFile = {
-  __pyx_pw_5pysam_6cfaidx_9FastaFile_5__len__, /*mp_length*/
-  __pyx_pw_5pysam_6cfaidx_9FastaFile_17__getitem__, /*mp_subscript*/
-  0, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_5pysam_6cfaidx_FastaFile = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cfaidx.FastaFile"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6cfaidx_FastaFile), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6cfaidx_FastaFile, /*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*/
-  &__pyx_tp_as_sequence_FastaFile, /*tp_as_sequence*/
-  &__pyx_tp_as_mapping_FastaFile, /*tp_as_mapping*/
-  0, /*tp_hash*/
-  0, /*tp_call*/
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("*(filename)*\n\n    A *FASTA* file. The file is automatically opened.\n\n    This class expects an indexed fasta file and permits\n    random access to fasta sequences.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6cfaidx_FastaFile, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6cfaidx_FastaFile, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_6cfaidx_FastaFile, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_6cfaidx_FastaFile, /*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_5pysam_6cfaidx_FastaFile, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_FastqProxy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6cfaidx_FastqProxy(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_10FastqProxy_name(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_10FastqProxy_4name_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_10FastqProxy_sequence(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_10FastqProxy_8sequence_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_10FastqProxy_comment(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_10FastqProxy_7comment_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_10FastqProxy_quality(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_10FastqProxy_7quality_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_6cfaidx_FastqProxy[] = {
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_6cfaidx_FastqProxy[] = {
-  {(char *)"name", __pyx_getprop_5pysam_6cfaidx_10FastqProxy_name, 0, 0, 0},
-  {(char *)"sequence", __pyx_getprop_5pysam_6cfaidx_10FastqProxy_sequence, 0, 0, 0},
-  {(char *)"comment", __pyx_getprop_5pysam_6cfaidx_10FastqProxy_comment, 0, 0, 0},
-  {(char *)"quality", __pyx_getprop_5pysam_6cfaidx_10FastqProxy_quality, 0, 0, 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6cfaidx_FastqProxy = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cfaidx.FastqProxy"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6cfaidx_FastqProxy), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6cfaidx_FastqProxy, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-  __Pyx_DOCSTR("FastqProxy()"), /*tp_doc*/
-  0, /*tp_traverse*/
-  0, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_6cfaidx_FastqProxy, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_6cfaidx_FastqProxy, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_6cfaidx_10FastqProxy_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6cfaidx_FastqProxy, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile __pyx_vtable_5pysam_6cfaidx_FastqFile;
-
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_FastqFile(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6cfaidx_FastqFile *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6cfaidx_FastqFile *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_6cfaidx_FastqFile;
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_5pysam_6cfaidx_9FastqFile_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6cfaidx_FastqFile(PyObject *o) {
-  struct __pyx_obj_5pysam_6cfaidx_FastqFile *p = (struct __pyx_obj_5pysam_6cfaidx_FastqFile *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_6cfaidx_9FastqFile_9__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->_filename);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6cfaidx_FastqFile(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6cfaidx_FastqFile *p = (struct __pyx_obj_5pysam_6cfaidx_FastqFile *)o;
-  if (p->_filename) {
-    e = (*v)(p->_filename, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6cfaidx_FastqFile(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6cfaidx_FastqFile *p = (struct __pyx_obj_5pysam_6cfaidx_FastqFile *)o;
-  tmp = ((PyObject*)p->_filename);
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyObject *__pyx_getprop_5pysam_6cfaidx_9FastqFile_filename(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6cfaidx_9FastqFile_8filename_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_6cfaidx_FastqFile[] = {
-  {__Pyx_NAMESTR("_isOpen"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastqFile_3_isOpen, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastqFile_2_isOpen)},
-  {__Pyx_NAMESTR("_open"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastqFile_5_open, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastqFile_4_open)},
-  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastqFile_7close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastqFile_6close)},
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6cfaidx_9FastqFile_13__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_6cfaidx_9FastqFile_12__next__)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_6cfaidx_FastqFile[] = {
-  {(char *)"filename", __pyx_getprop_5pysam_6cfaidx_9FastqFile_filename, 0, __Pyx_DOCSTR(__pyx_k_number_of_term_filename_associat), 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6cfaidx_FastqFile = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cfaidx.FastqFile"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6cfaidx_FastqFile), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6cfaidx_FastqFile, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("*(filename)*\n\n    A *FASTQ* file. The file is automatically opened.\n\n    This file object permits iterating over all entries in\n    a fastq file. Random access is not implemented.\n\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6cfaidx_FastqFile, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6cfaidx_FastqFile, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_6cfaidx_9FastqFile_11__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_6cfaidx_9FastqFile_13__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_6cfaidx_FastqFile, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_6cfaidx_FastqFile, /*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_5pysam_6cfaidx_FastqFile, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile __pyx_vtable_5pysam_6cfaidx_Fastafile;
-
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_Fastafile(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6cfaidx_Fastafile *p;
-  PyObject *o = __pyx_tp_new_5pysam_6cfaidx_FastaFile(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6cfaidx_Fastafile *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile*)__pyx_vtabptr_5pysam_6cfaidx_Fastafile;
-  return o;
-}
-
-static PyTypeObject __pyx_type_5pysam_6cfaidx_Fastafile = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cfaidx.Fastafile"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6cfaidx_Fastafile), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6cfaidx_FastaFile, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6cfaidx_FastaFile, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6cfaidx_FastaFile, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_6cfaidx_Fastafile, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile __pyx_vtable_5pysam_6cfaidx_Fastqfile;
-
-static PyObject *__pyx_tp_new_5pysam_6cfaidx_Fastqfile(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6cfaidx_Fastqfile *p;
-  PyObject *o = __pyx_tp_new_5pysam_6cfaidx_FastqFile(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6cfaidx_Fastqfile *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile*)__pyx_vtabptr_5pysam_6cfaidx_Fastqfile;
-  return o;
-}
-
-static PyTypeObject __pyx_type_5pysam_6cfaidx_Fastqfile = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cfaidx.Fastqfile"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6cfaidx_Fastqfile), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6cfaidx_FastqFile, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6cfaidx_FastqFile, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6cfaidx_FastqFile, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6cfaidx_9FastqFile_11__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6cfaidx_9FastqFile_13__next__, /*tp_iternext*/
-  #else
-  0, /*tp_iternext*/
-  #endif
-  0, /*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_5pysam_6cfaidx_Fastqfile, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *__pyx_freelist_5pysam_6cfaidx___pyx_scope_struct___open[8];
-static int __pyx_freecount_5pysam_6cfaidx___pyx_scope_struct___open = 0;
-
-static PyObject *__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct___open(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct___open > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open)))) {
-    o = (PyObject*)__pyx_freelist_5pysam_6cfaidx___pyx_scope_struct___open[--__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct___open];
-    memset(o, 0, sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open));
-    (void) PyObject_INIT(o, t);
-    PyObject_GC_Track(o);
-  } else {
-    o = (*t->tp_alloc)(t, 0);
-    if (unlikely(!o)) return 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6cfaidx___pyx_scope_struct___open(PyObject *o) {
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *)o;
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->__pyx_v_data);
-  if ((__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct___open < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open))) {
-    __pyx_freelist_5pysam_6cfaidx___pyx_scope_struct___open[__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct___open++] = ((struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *)o);
-  } else {
-    (*Py_TYPE(o)->tp_free)(o);
-  }
-}
-
-static int __pyx_tp_traverse_5pysam_6cfaidx___pyx_scope_struct___open(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *)o;
-  if (p->__pyx_v_data) {
-    e = (*v)(p->__pyx_v_data, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6cfaidx___pyx_scope_struct___open(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *)o;
-  tmp = ((PyObject*)p->__pyx_v_data);
-  p->__pyx_v_data = ((PyObject*)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyTypeObject __pyx_type_5pysam_6cfaidx___pyx_scope_struct___open = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cfaidx.__pyx_scope_struct___open"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6cfaidx___pyx_scope_struct___open, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6cfaidx___pyx_scope_struct___open, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6cfaidx___pyx_scope_struct___open, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_6cfaidx___pyx_scope_struct___open, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *__pyx_freelist_5pysam_6cfaidx___pyx_scope_struct_1_genexpr[8];
-static int __pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_1_genexpr = 0;
-
-static PyObject *__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr)))) {
-    o = (PyObject*)__pyx_freelist_5pysam_6cfaidx___pyx_scope_struct_1_genexpr[--__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_1_genexpr];
-    memset(o, 0, sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr));
-    (void) PyObject_INIT(o, t);
-    PyObject_GC_Track(o);
-  } else {
-    o = (*t->tp_alloc)(t, 0);
-    if (unlikely(!o)) return 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6cfaidx___pyx_scope_struct_1_genexpr(PyObject *o) {
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *)o;
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_x);
-  Py_CLEAR(p->__pyx_t_0);
-  if ((__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr))) {
-    __pyx_freelist_5pysam_6cfaidx___pyx_scope_struct_1_genexpr[__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *)o);
-  } else {
-    (*Py_TYPE(o)->tp_free)(o);
-  }
-}
-
-static int __pyx_tp_traverse_5pysam_6cfaidx___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *)o;
-  if (p->__pyx_outer_scope) {
-    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
-  }
-  if (p->__pyx_v_x) {
-    e = (*v)(p->__pyx_v_x, 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_5pysam_6cfaidx___pyx_scope_struct_1_genexpr(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr *)o;
-  tmp = ((PyObject*)p->__pyx_outer_scope);
-  p->__pyx_outer_scope = ((struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->__pyx_v_x);
-  p->__pyx_v_x = 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 PyTypeObject __pyx_type_5pysam_6cfaidx___pyx_scope_struct_1_genexpr = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cfaidx.__pyx_scope_struct_1_genexpr"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6cfaidx___pyx_scope_struct_1_genexpr, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6cfaidx___pyx_scope_struct_1_genexpr, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6cfaidx___pyx_scope_struct_1_genexpr, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_6cfaidx___pyx_scope_struct_1_genexpr, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *__pyx_freelist_5pysam_6cfaidx___pyx_scope_struct_2_genexpr[8];
-static int __pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_2_genexpr = 0;
-
-static PyObject *__pyx_tp_new_5pysam_6cfaidx___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr)))) {
-    o = (PyObject*)__pyx_freelist_5pysam_6cfaidx___pyx_scope_struct_2_genexpr[--__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_2_genexpr];
-    memset(o, 0, sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr));
-    (void) PyObject_INIT(o, t);
-    PyObject_GC_Track(o);
-  } else {
-    o = (*t->tp_alloc)(t, 0);
-    if (unlikely(!o)) return 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6cfaidx___pyx_scope_struct_2_genexpr(PyObject *o) {
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *)o;
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->__pyx_outer_scope);
-  Py_CLEAR(p->__pyx_v_x);
-  Py_CLEAR(p->__pyx_t_0);
-  if ((__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr))) {
-    __pyx_freelist_5pysam_6cfaidx___pyx_scope_struct_2_genexpr[__pyx_freecount_5pysam_6cfaidx___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *)o);
-  } else {
-    (*Py_TYPE(o)->tp_free)(o);
-  }
-}
-
-static int __pyx_tp_traverse_5pysam_6cfaidx___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *)o;
-  if (p->__pyx_outer_scope) {
-    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
-  }
-  if (p->__pyx_v_x) {
-    e = (*v)(p->__pyx_v_x, 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_5pysam_6cfaidx___pyx_scope_struct_2_genexpr(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr *)o;
-  tmp = ((PyObject*)p->__pyx_outer_scope);
-  p->__pyx_outer_scope = ((struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct___open *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->__pyx_v_x);
-  p->__pyx_v_x = 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 PyTypeObject __pyx_type_5pysam_6cfaidx___pyx_scope_struct_2_genexpr = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cfaidx.__pyx_scope_struct_2_genexpr"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6cfaidx___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6cfaidx___pyx_scope_struct_2_genexpr, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6cfaidx___pyx_scope_struct_2_genexpr, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6cfaidx___pyx_scope_struct_2_genexpr, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_6cfaidx___pyx_scope_struct_2_genexpr, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
-  {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
-    PyModuleDef_HEAD_INIT,
-  #endif
-    __Pyx_NAMESTR("cfaidx"),
-    0, /* m_doc */
-    -1, /* m_size */
-    __pyx_methods /* m_methods */,
-    NULL, /* m_reload */
-    NULL, /* m_traverse */
-    NULL, /* m_clear */
-    NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_u_Argument_must_be_string_or_unico, __pyx_k_Argument_must_be_string_or_unico, sizeof(__pyx_k_Argument_must_be_string_or_unico), 0, 1, 0, 0},
-  {&__pyx_n_s_FastaFile, __pyx_k_FastaFile, sizeof(__pyx_k_FastaFile), 0, 0, 1, 1},
-  {&__pyx_n_s_Fastafile, __pyx_k_Fastafile, sizeof(__pyx_k_Fastafile), 0, 0, 1, 1},
-  {&__pyx_n_s_FastqFile, __pyx_k_FastqFile, sizeof(__pyx_k_FastqFile), 0, 0, 1, 1},
-  {&__pyx_n_s_Fastqfile, __pyx_k_Fastqfile, sizeof(__pyx_k_Fastqfile), 0, 0, 1, 1},
-  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
-  {&__pyx_n_s_IS_PYTHON3, __pyx_k_IS_PYTHON3, sizeof(__pyx_k_IS_PYTHON3), 0, 0, 1, 1},
-  {&__pyx_kp_s_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 0, 1, 0},
-  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
-  {&__pyx_kp_s_No_such_file_or_directory_s, __pyx_k_No_such_file_or_directory_s, sizeof(__pyx_k_No_such_file_or_directory_s), 0, 0, 1, 0},
-  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
-  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
-  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
-  {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
-  {&__pyx_kp_b__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 0, 0},
-  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
-  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
-  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
-  {&__pyx_kp_s_calling_len_on_closed_file, __pyx_k_calling_len_on_closed_file, sizeof(__pyx_k_calling_len_on_closed_file), 0, 0, 1, 0},
-  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
-  {&__pyx_kp_s_could_not_locate_index_file, __pyx_k_could_not_locate_index_file, sizeof(__pyx_k_could_not_locate_index_file), 0, 0, 1, 0},
-  {&__pyx_kp_s_could_not_open_file_s, __pyx_k_could_not_open_file_s, sizeof(__pyx_k_could_not_open_file_s), 0, 0, 1, 0},
-  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
-  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
-  {&__pyx_kp_s_end_out_of_range_i, __pyx_k_end_out_of_range_i, sizeof(__pyx_k_end_out_of_range_i), 0, 0, 1, 0},
-  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
-  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
-  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
-  {&__pyx_kp_b_fai, __pyx_k_fai, sizeof(__pyx_k_fai), 0, 0, 0, 0},
-  {&__pyx_n_s_fetch, __pyx_k_fetch, sizeof(__pyx_k_fetch), 0, 0, 1, 1},
-  {&__pyx_n_s_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_kp_s_invalid_region_start_i_end_i, __pyx_k_invalid_region_start_i_end_i, sizeof(__pyx_k_invalid_region_start_i_end_i), 0, 0, 1, 0},
-  {&__pyx_n_s_isOpen, __pyx_k_isOpen, sizeof(__pyx_k_isOpen), 0, 0, 1, 1},
-  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
-  {&__pyx_kp_s_no_sequence_region_supplied, __pyx_k_no_sequence_region_supplied, sizeof(__pyx_k_no_sequence_region_supplied), 0, 0, 1, 0},
-  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
-  {&__pyx_n_s_open_2, __pyx_k_open_2, sizeof(__pyx_k_open_2), 0, 0, 1, 1},
-  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
-  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
-  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
-  {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1},
-  {&__pyx_n_s_references, __pyx_k_references, sizeof(__pyx_k_references), 0, 0, 1, 1},
-  {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1},
-  {&__pyx_kp_s_s_i_i, __pyx_k_s_i_i, sizeof(__pyx_k_s_i_i), 0, 0, 1, 0},
-  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
-  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
-  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
-  {&__pyx_kp_s_start_out_of_range_i, __pyx_k_start_out_of_range_i, sizeof(__pyx_k_start_out_of_range_i), 0, 0, 1, 0},
-  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
-  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
-  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
-  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
-  {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __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);
-
-  /* "pysam/cfaidx.pyx":89
- *     def __len__(self):
- *         if self.fastafile == NULL:
- *             raise ValueError("calling len() on closed file")             # <<<<<<<<<<<<<<
- * 
- *         return faidx_nseq(self.fastafile)
- */
-  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_calling_len_on_closed_file); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple_);
-  __Pyx_GIVEREF(__pyx_tuple_);
-
-  /* "pysam/cfaidx.pyx":109
- *         # read index
- *         if not os.path.exists( self._filename + b".fai" ):
- *             raise ValueError("could not locate index file")             # <<<<<<<<<<<<<<
- * 
- *         with open( self._filename + b".fai" ) as inf:
- */
-  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_could_not_locate_index_file); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__2);
-  __Pyx_GIVEREF(__pyx_tuple__2);
-
-  /* "pysam/cfaidx.pyx":112
- * 
- *         with open( self._filename + b".fai" ) as inf:
- *             data = [ x.split("\t") for x in inf ]             # <<<<<<<<<<<<<<
- *             self._references = tuple(x[0] for x in data)
- *             self._lengths = tuple(int(x[1]) for x in data)
- */
-  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__4);
-  __Pyx_GIVEREF(__pyx_tuple__4);
-
-  /* "pysam/cfaidx.pyx":111
- *             raise ValueError("could not locate index file")
- * 
- *         with open( self._filename + b".fai" ) as inf:             # <<<<<<<<<<<<<<
- *             data = [ x.split("\t") for x in inf ]
- *             self._references = tuple(x[0] for x in data)
- */
-  __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__5);
-  __Pyx_GIVEREF(__pyx_tuple__5);
-
-  /* "pysam/cfaidx.pyx":168
- * 
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- * 
- *         cdef int length
- */
-  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__6);
-  __Pyx_GIVEREF(__pyx_tuple__6);
-
-  /* "pysam/cfaidx.pyx":175
- *         if not region:
- *             if reference is None:
- *                 raise ValueError('no sequence/region supplied.')             # <<<<<<<<<<<<<<
- *             if start is None:
- *                 start = 0
- */
-  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_sequence_region_supplied); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__7);
-  __Pyx_GIVEREF(__pyx_tuple__7);
-
-  /* "pysam/cfaidx.pyx":201
- *             region = "%s:%i-%i" % (reference, start+1, end)
- *             if PY_MAJOR_VERSION >= 3:
- *                 region = region.encode('ascii')             # <<<<<<<<<<<<<<
- *             seq = fai_fetch( self.fastafile,
- *                              region,
- */
-  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__9);
-  __Pyx_GIVEREF(__pyx_tuple__9);
-
-  /* "pysam/cfaidx.pyx":321
- *     def __iter__(self):
- *         if not self._isOpen():
- *             raise ValueError( "I/O operation on closed file" )             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__10);
-  __Pyx_GIVEREF(__pyx_tuple__10);
-  __Pyx_RefNannyFinishContext();
-  return 0;
-  __pyx_L1_error:;
-  __Pyx_RefNannyFinishContext();
-  return -1;
-}
-
-static int __Pyx_InitGlobals(void) {
-  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  return 0;
-  __pyx_L1_error:;
-  return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC initcfaidx(void); /*proto*/
-PyMODINIT_FUNC initcfaidx(void)
-#else
-PyMODINIT_FUNC PyInit_cfaidx(void); /*proto*/
-PyMODINIT_FUNC PyInit_cfaidx(void)
-#endif
-{
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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_cfaidx(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("cfaidx"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
-  #else
-  __pyx_m = PyModule_Create(&__pyx_moduledef);
-  #endif
-  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_d);
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  if (__pyx_module_is_main_pysam__cfaidx) {
-    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;};
-  }
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pysam.cfaidx")) {
-      if (unlikely(PyDict_SetItemString(modules, "pysam.cfaidx", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  /*--- 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_5pysam_6cfaidx__FILENAME_ENCODING = ((PyObject*)Py_None); Py_INCREF(Py_None);
-  /*--- Variable export code ---*/
-  /*--- Function export code ---*/
-  /*--- Type init code ---*/
-  __pyx_vtabptr_5pysam_6cfaidx_FastaFile = &__pyx_vtable_5pysam_6cfaidx_FastaFile;
-  __pyx_vtable_5pysam_6cfaidx_FastaFile._fetch = (char *(*)(struct __pyx_obj_5pysam_6cfaidx_FastaFile *, char *, int, int, int *))__pyx_f_5pysam_6cfaidx_9FastaFile__fetch;
-  if (PyType_Ready(&__pyx_type_5pysam_6cfaidx_FastaFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6cfaidx_FastaFile.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_6cfaidx_FastaFile, "__contains__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_6cfaidx_9FastaFile_18__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_6cfaidx_9FastaFile_18__contains__.doc = __pyx_doc_5pysam_6cfaidx_9FastaFile_18__contains__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_6cfaidx_9FastaFile_18__contains__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6cfaidx_FastaFile.tp_dict, __pyx_vtabptr_5pysam_6cfaidx_FastaFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "FastaFile", (PyObject *)&__pyx_type_5pysam_6cfaidx_FastaFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_FastaFile = &__pyx_type_5pysam_6cfaidx_FastaFile;
-  if (PyType_Ready(&__pyx_type_5pysam_6cfaidx_FastqProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6cfaidx_FastqProxy.tp_print = 0;
-  if (__Pyx_SetAttrString(__pyx_m, "FastqProxy", (PyObject *)&__pyx_type_5pysam_6cfaidx_FastqProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_FastqProxy = &__pyx_type_5pysam_6cfaidx_FastqProxy;
-  __pyx_vtabptr_5pysam_6cfaidx_FastqFile = &__pyx_vtable_5pysam_6cfaidx_FastqFile;
-  __pyx_vtable_5pysam_6cfaidx_FastqFile.getCurrent = (kseq_t *(*)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *))__pyx_f_5pysam_6cfaidx_9FastqFile_getCurrent;
-  __pyx_vtable_5pysam_6cfaidx_FastqFile.cnext = (int (*)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *))__pyx_f_5pysam_6cfaidx_9FastqFile_cnext;
-  if (PyType_Ready(&__pyx_type_5pysam_6cfaidx_FastqFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6cfaidx_FastqFile.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_6cfaidx_FastqFile, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_6cfaidx_9FastqFile_12__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_6cfaidx_9FastqFile_12__next__.doc = __pyx_doc_5pysam_6cfaidx_9FastqFile_12__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_6cfaidx_9FastqFile_12__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6cfaidx_FastqFile.tp_dict, __pyx_vtabptr_5pysam_6cfaidx_FastqFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "FastqFile", (PyObject *)&__pyx_type_5pysam_6cfaidx_FastqFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_FastqFile = &__pyx_type_5pysam_6cfaidx_FastqFile;
-  __pyx_vtabptr_5pysam_6cfaidx_Fastafile = &__pyx_vtable_5pysam_6cfaidx_Fastafile;
-  __pyx_vtable_5pysam_6cfaidx_Fastafile.__pyx_base = *__pyx_vtabptr_5pysam_6cfaidx_FastaFile;
-  __pyx_type_5pysam_6cfaidx_Fastafile.tp_base = __pyx_ptype_5pysam_6cfaidx_FastaFile;
-  if (PyType_Ready(&__pyx_type_5pysam_6cfaidx_Fastafile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6cfaidx_Fastafile.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6cfaidx_Fastafile.tp_dict, __pyx_vtabptr_5pysam_6cfaidx_Fastafile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "Fastafile", (PyObject *)&__pyx_type_5pysam_6cfaidx_Fastafile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_Fastafile = &__pyx_type_5pysam_6cfaidx_Fastafile;
-  __pyx_vtabptr_5pysam_6cfaidx_Fastqfile = &__pyx_vtable_5pysam_6cfaidx_Fastqfile;
-  __pyx_vtable_5pysam_6cfaidx_Fastqfile.__pyx_base = *__pyx_vtabptr_5pysam_6cfaidx_FastqFile;
-  __pyx_type_5pysam_6cfaidx_Fastqfile.tp_base = __pyx_ptype_5pysam_6cfaidx_FastqFile;
-  if (PyType_Ready(&__pyx_type_5pysam_6cfaidx_Fastqfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6cfaidx_Fastqfile.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6cfaidx_Fastqfile.tp_dict, __pyx_vtabptr_5pysam_6cfaidx_Fastqfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "Fastqfile", (PyObject *)&__pyx_type_5pysam_6cfaidx_Fastqfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_Fastqfile = &__pyx_type_5pysam_6cfaidx_Fastqfile;
-  if (PyType_Ready(&__pyx_type_5pysam_6cfaidx___pyx_scope_struct___open) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6cfaidx___pyx_scope_struct___open.tp_print = 0;
-  __pyx_ptype_5pysam_6cfaidx___pyx_scope_struct___open = &__pyx_type_5pysam_6cfaidx___pyx_scope_struct___open;
-  if (PyType_Ready(&__pyx_type_5pysam_6cfaidx___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6cfaidx___pyx_scope_struct_1_genexpr.tp_print = 0;
-  __pyx_ptype_5pysam_6cfaidx___pyx_scope_struct_1_genexpr = &__pyx_type_5pysam_6cfaidx___pyx_scope_struct_1_genexpr;
-  if (PyType_Ready(&__pyx_type_5pysam_6cfaidx___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6cfaidx___pyx_scope_struct_2_genexpr.tp_print = 0;
-  __pyx_ptype_5pysam_6cfaidx___pyx_scope_struct_2_genexpr = &__pyx_type_5pysam_6cfaidx___pyx_scope_struct_2_genexpr;
-  /*--- Type import code ---*/
-  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
-  #if CYTHON_COMPILING_IN_PYPY
-  sizeof(PyTypeObject),
-  #else
-  sizeof(PyHeapTypeObject),
-  #endif
-  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Variable import code ---*/
-  /*--- Function import code ---*/
-  /*--- Execution code ---*/
-
-  /* "pysam/cfaidx.pyx":4
- * # cython: profile=True
- * # adds doc-strings for sphinx
- * import sys             # <<<<<<<<<<<<<<
- * import os
- * 
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cfaidx.pyx":5
- * # adds doc-strings for sphinx
- * import sys
- * import os             # <<<<<<<<<<<<<<
- * 
- * cdef class FastqProxy
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cfaidx.pyx":33
- * ## Python 3 compatibility functions
- * ########################################################################
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3             # <<<<<<<<<<<<<<
- * 
- * # filename encoding (copied from lxml.etree.pyx)
- */
-  __pyx_t_1 = __Pyx_PyBool_FromLong((PY_MAJOR_VERSION >= 3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IS_PYTHON3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cfaidx.pyx":37
- * # filename encoding (copied from lxml.etree.pyx)
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_XGOTREF(__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/cfaidx.pyx":38
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- */
-  __pyx_t_3 = (__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_4 = (__pyx_t_3 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/cfaidx.pyx":39
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XGOTREF(__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L2;
-  }
-  __pyx_L2:;
-
-  /* "pysam/cfaidx.pyx":40
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = 'ascii'
- * 
- */
-  __pyx_t_4 = (__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_3 = (__pyx_t_4 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/cfaidx.pyx":41
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'             # <<<<<<<<<<<<<<
- * 
- * #cdef char* _C_FILENAME_ENCODING
- */
-    __Pyx_INCREF(__pyx_n_s_ascii);
-    __Pyx_XGOTREF(__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_6cfaidx__FILENAME_ENCODING, __pyx_n_s_ascii);
-    __Pyx_GIVEREF(__pyx_n_s_ascii);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cfaidx.pyx":61
- * #####################################################################
- * # hard-coded constants
- * cdef int max_pos = 2 << 29             # <<<<<<<<<<<<<<
- * 
- * ## TODO:
- */
-  __pyx_v_5pysam_6cfaidx_max_pos = 1073741824;
-
-  /* "pysam/cfaidx.pyx":350
- *     pass
- * 
- * __all__ = ["FastaFile",             # <<<<<<<<<<<<<<
- *            "FastqFile",
- *            "Fastafile",
- */
-  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_n_s_FastaFile);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_FastaFile);
-  __Pyx_GIVEREF(__pyx_n_s_FastaFile);
-  __Pyx_INCREF(__pyx_n_s_FastqFile);
-  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_FastqFile);
-  __Pyx_GIVEREF(__pyx_n_s_FastqFile);
-  __Pyx_INCREF(__pyx_n_s_Fastafile);
-  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_Fastafile);
-  __Pyx_GIVEREF(__pyx_n_s_Fastafile);
-  __Pyx_INCREF(__pyx_n_s_Fastqfile);
-  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_Fastqfile);
-  __Pyx_GIVEREF(__pyx_n_s_Fastqfile);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cfaidx.pyx":1
- * # cython: embedsignature=True             # <<<<<<<<<<<<<<
- * # cython: profile=True
- * # adds doc-strings for sphinx
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  if (__pyx_m) {
-    __Pyx_AddTraceback("init pysam.cfaidx", __pyx_clineno, __pyx_lineno, __pyx_filename);
-    Py_DECREF(__pyx_m); __pyx_m = 0;
-  } else if (!PyErr_Occurred()) {
-    PyErr_SetString(PyExc_ImportError, "init pysam.cfaidx");
-  }
-  __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_GetBuiltinName(PyObject *name) {
-    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
-    if (unlikely(!result)) {
-        PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
-            "name '%U' is not defined", name);
-#else
-            "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
-    }
-    return result;
-}
-
-#if CYTHON_PROFILE
-static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
-                                   PyFrameObject** frame,
-                                   const char *funcname,
-                                   const char *srcfile,
-                                   int firstlineno) {
-    int retval;
-    PyThreadState* tstate = PyThreadState_GET();
-    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
-        if (*code == NULL) {
-            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
-            if (*code == NULL) return 0;
-        }
-        *frame = PyFrame_New(
-            tstate,                          /*PyThreadState *tstate*/
-            *code,                           /*PyCodeObject *code*/
-            __pyx_d,                  /*PyObject *globals*/
-            0                                /*PyObject *locals*/
-        );
-        if (*frame == NULL) return 0;
-        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
-            Py_INCREF(Py_None);
-            (*frame)->f_trace = Py_None;
-        }
-#if PY_VERSION_HEX < 0x030400B1
-    } else {
-        (*frame)->f_tstate = tstate;
-#endif
-    }
-    (*frame)->f_lineno = firstlineno;
-    tstate->use_tracing = 0;
-    #if CYTHON_TRACE
-    if (tstate->c_tracefunc)
-        tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL);
-    if (!tstate->c_profilefunc)
-        retval = 1;
-    else
-    #endif
-        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
-    tstate->use_tracing = (tstate->c_profilefunc ||
-                           (CYTHON_TRACE && tstate->c_tracefunc));
-    return tstate->use_tracing && retval;
-}
-static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
-    PyObject *py_srcfile = 0;
-    PyObject *py_funcname = 0;
-    PyCodeObject *py_code = 0;
-    #if PY_MAJOR_VERSION < 3
-    py_funcname = PyString_FromString(funcname);
-    py_srcfile = PyString_FromString(srcfile);
-    #else
-    py_funcname = PyUnicode_FromString(funcname);
-    py_srcfile = PyUnicode_FromString(srcfile);
-    #endif
-    if (!py_funcname | !py_srcfile) goto bad;
-    py_code = PyCode_New(
-        0,                /*int argcount,*/
-        #if PY_MAJOR_VERSION >= 3
-        0,                /*int kwonlyargcount,*/
-        #endif
-        0,                /*int nlocals,*/
-        0,                /*int stacksize,*/
-        0,                /*int flags,*/
-        __pyx_empty_bytes,     /*PyObject *code,*/
-        __pyx_empty_tuple,     /*PyObject *consts,*/
-        __pyx_empty_tuple,     /*PyObject *names,*/
-        __pyx_empty_tuple,     /*PyObject *varnames,*/
-        __pyx_empty_tuple,     /*PyObject *freevars,*/
-        __pyx_empty_tuple,     /*PyObject *cellvars,*/
-        py_srcfile,       /*PyObject *filename,*/
-        py_funcname,      /*PyObject *name,*/
-        firstlineno,      /*int firstlineno,*/
-        __pyx_empty_bytes      /*PyObject *lnotab*/
-    );
-bad:
-    Py_XDECREF(py_srcfile);
-    Py_XDECREF(py_funcname);
-    return py_code;
-}
-#endif /* CYTHON_PROFILE */
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
-    if (unlikely(!type)) {
-        PyErr_SetString(PyExc_SystemError, "Missing type object");
-        return 0;
-    }
-    if (likely(PyObject_TypeCheck(obj, type)))
-        return 1;
-    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
-                 Py_TYPE(obj)->tp_name, type->tp_name);
-    return 0;
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyObject *result;
-    ternaryfunc call = func->ob_type->tp_call;
-    if (unlikely(!call))
-        return PyObject_Call(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
-        return NULL;
-#endif
-    result = (*call)(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    Py_LeaveRecursiveCall();
-#endif
-    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
-        PyErr_SetString(
-            PyExc_SystemError,
-            "NULL result without error in PyObject_Call");
-    }
-    return result;
-}
-#endif
-
-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);
-    if (!value || value == Py_None)
-        value = NULL;
-    else
-        Py_INCREF(value);
-    if (!tb || tb == Py_None)
-        tb = NULL;
-    else {
-        Py_INCREF(tb);
-        if (!PyTraceBack_Check(tb)) {
-            PyErr_SetString(PyExc_TypeError,
-                "raise: arg 3 must be a traceback or None");
-            goto raise_error;
-        }
-    }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
-    if (PyType_Check(type)) {
-    #endif
-#if CYTHON_COMPILING_IN_PYPY
-        if (!value) {
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-#endif
-        PyErr_NormalizeException(&type, &value, &tb);
-    } else {
-        if (value) {
-            PyErr_SetString(PyExc_TypeError,
-                "instance exception may not have a separate value");
-            goto raise_error;
-        }
-        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) {
-    PyObject* owned_instance = NULL;
-    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)) {
-        PyObject *instance_class = NULL;
-        if (value && PyExceptionInstance_Check(value)) {
-            instance_class = (PyObject*) Py_TYPE(value);
-            if (instance_class != type) {
-                if (PyObject_IsSubclass(instance_class, type)) {
-                    type = instance_class;
-                } else {
-                    instance_class = NULL;
-                }
-            }
-        }
-        if (!instance_class) {
-            PyObject *args;
-            if (!value)
-                args = PyTuple_New(0);
-            else if (PyTuple_Check(value)) {
-                Py_INCREF(value);
-                args = value;
-            } else
-                args = PyTuple_Pack(1, value);
-            if (!args)
-                goto bad;
-            owned_instance = PyObject_Call(type, args, NULL);
-            Py_DECREF(args);
-            if (!owned_instance)
-                goto bad;
-            value = owned_instance;
-            if (!PyExceptionInstance_Check(value)) {
-                PyErr_Format(PyExc_TypeError,
-                             "calling %R should have returned an instance of "
-                             "BaseException, not %R",
-                             type, Py_TYPE(value));
-                goto bad;
-            }
-        }
-    } else {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: exception class must be a subclass of BaseException");
-        goto bad;
-    }
-#if PY_VERSION_HEX >= 0x03030000
-    if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
-        PyObject *fixed_cause;
-        if (cause == Py_None) {
-            fixed_cause = NULL;
-        } else 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;
-        }
-        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:
-    Py_XDECREF(owned_instance);
-    return;
-}
-#endif
-
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
-    PyObject *kwdict,
-    const char* function_name,
-    int kw_allowed)
-{
-    PyObject* key = 0;
-    Py_ssize_t pos = 0;
-#if CPYTHON_COMPILING_IN_PYPY
-    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
-        goto invalid_keyword;
-    return 1;
-#else
-    while (PyDict_Next(kwdict, &pos, &key, 0)) {
-        #if PY_MAJOR_VERSION < 3
-        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
-        #endif
-            if (unlikely(!PyUnicode_Check(key)))
-                goto invalid_keyword_type;
-    }
-    if ((!kw_allowed) && unlikely(key))
-        goto invalid_keyword;
-    return 1;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    return 0;
-#endif
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-    return 0;
-}
-
-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 PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
-    PyObject *r;
-    if (!j) return NULL;
-    r = PyObject_GetItem(o, j);
-    Py_DECREF(j);
-    return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        PyObject *r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        PyObject *r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (is_list || PyList_CheckExact(o)) {
-        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if ((!boundscheck) || (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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
-        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    } else {
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_item)) {
-            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (likely(l >= 0)) {
-                    i += l;
-                } else {
-                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                        PyErr_Clear();
-                    else
-                        return NULL;
-                }
-            }
-            return m->sq_item(o, i);
-        }
-    }
-#else
-    if (is_list || PySequence_Check(o)) {
-        return PySequence_GetItem(o, i);
-    }
-#endif
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
-    PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
-    result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
-        Py_INCREF(result);
-    } else {
-#else
-    result = PyObject_GetItem(__pyx_d, name);
-    if (!result) {
-        PyErr_Clear();
-#endif
-        result = __Pyx_GetBuiltinName(name);
-    }
-    return result;
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    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);
-#else
-    PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(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->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);
-#else
-    PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
-    PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
-    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (unlikely(tstate->curexc_type))
-#else
-    if (unlikely(PyErr_Occurred()))
-#endif
-        goto bad;
-    #if PY_MAJOR_VERSION >= 3
-    if (local_tb) {
-        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
-            goto bad;
-    }
-    #endif
-    Py_XINCREF(local_tb);
-    Py_XINCREF(local_type);
-    Py_XINCREF(local_value);
-    *type = local_type;
-    *value = local_value;
-    *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-    Py_XDECREF(tmp_type);
-    Py_XDECREF(tmp_value);
-    Py_XDECREF(tmp_tb);
-#else
-    PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
-    return 0;
-bad:
-    *type = 0;
-    *value = 0;
-    *tb = 0;
-    Py_XDECREF(local_type);
-    Py_XDECREF(local_value);
-    Py_XDECREF(local_tb);
-    return -1;
-}
-
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
-                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
-                                  int full_traceback) {
-    PyObject *old_exc, *old_val, *old_tb;
-    PyObject *ctx;
-    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
-    if (full_traceback) {
-        Py_XINCREF(old_exc);
-        Py_XINCREF(old_val);
-        Py_XINCREF(old_tb);
-        __Pyx_ErrRestore(old_exc, old_val, old_tb);
-        PyErr_PrintEx(1);
-    }
-    #if PY_MAJOR_VERSION < 3
-    ctx = PyString_FromString(name);
-    #else
-    ctx = PyUnicode_FromString(name);
-    #endif
-    __Pyx_ErrRestore(old_exc, old_val, old_tb);
-    if (!ctx) {
-        PyErr_WriteUnraisable(Py_None);
-    } else {
-        PyErr_WriteUnraisable(ctx);
-        Py_DECREF(ctx);
-    }
-}
-
-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_AsString(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;
-            continue;
-        }
-        name = first_kw_arg;
-        #if PY_MAJOR_VERSION < 3
-        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
-            while (*name) {
-                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
-                        && _PyString_Eq(**name, key)) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    if ((**argname == key) || (
-                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
-                             && _PyString_Eq(**argname, key))) {
-                        goto arg_passed_twice;
-                    }
-                    argname++;
-                }
-            }
-        } else
-        #endif
-        if (likely(PyUnicode_Check(key))) {
-            while (*name) {
-                int cmp = (**name == key) ? 0 :
-                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
-                #endif
-                    PyUnicode_Compare(**name, key);
-                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                if (cmp == 0) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    int cmp = (**argname == key) ? 0 :
-                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
-                    #endif
-                        PyUnicode_Compare(**argname, key);
-                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                    if (cmp == 0) goto arg_passed_twice;
-                    argname++;
-                }
-            }
-        } else
-            goto invalid_keyword_type;
-        if (kwds2) {
-            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
-        } else {
-            goto invalid_keyword;
-        }
-    }
-    return 0;
-arg_passed_twice:
-    __Pyx_RaiseDoubleKeywordsError(function_name, key);
-    goto bad;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    goto bad;
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-bad:
-    return -1;
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
-    const char* func_name,
-    int exact,
-    Py_ssize_t num_min,
-    Py_ssize_t num_max,
-    Py_ssize_t num_found)
-{
-    Py_ssize_t num_expected;
-    const char *more_or_less;
-    if (num_found < num_min) {
-        num_expected = num_min;
-        more_or_less = "at least";
-    } else {
-        num_expected = num_max;
-        more_or_less = "at most";
-    }
-    if (exact) {
-        more_or_less = "exactly";
-    }
-    PyErr_Format(PyExc_TypeError,
-                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
-                 func_name, more_or_less, num_expected,
-                 (num_expected == 1) ? "" : "s", num_found);
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
-    PyObject *tmp_type, *tmp_value, *tmp_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
-    PyErr_SetExcInfo(*type, *value, *tb);
-#endif
-    *type = tmp_type;
-    *value = tmp_value;
-    *tb = tmp_tb;
-}
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
-    PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
-    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
-    if (!ob)
-        goto bad;
-    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
-        goto bad;
-    Py_DECREF(ob);
-    return 0;
-bad:
-    Py_XDECREF(ob);
-    return -1;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
-    PyObject *empty_list = 0;
-    PyObject *module = 0;
-    PyObject *global_dict = 0;
-    PyObject *empty_dict = 0;
-    PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
-    PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
-    if (!py_import)
-        goto bad;
-    #endif
-    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, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                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);
-                #else
-                module = PyImport_ImportModuleLevelObject(
-                    name, global_dict, empty_dict, list, 1);
-                #endif
-                if (!module) {
-                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
-                        goto bad;
-                    PyErr_Clear();
-                }
-            }
-            level = 0; /* try absolute import on failure */
-        }
-        #endif
-        if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
-            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
-            module = PyImport_ImportModuleLevelObject(
-                name, global_dict, empty_dict, list, level);
-            #endif
-        }
-    }
-    #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:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(long) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(long) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(long),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int),
-                                     little, !is_unsigned);
-    }
-}
-
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
-    {                                                                     \
-        func_type value = func(x);                                        \
-        if (sizeof(target_type) < sizeof(func_type)) {                    \
-            if (unlikely(value != (func_type) (target_type) value)) {     \
-                func_type zero = 0;                                       \
-                PyErr_SetString(PyExc_OverflowError,                      \
-                    (is_unsigned && unlikely(value < zero)) ?             \
-                    "can't convert negative value to " #target_type :     \
-                    "value too large to convert to " #target_type);       \
-                return (target_type) -1;                                  \
-            }                                                             \
-        }                                                                 \
-        return (target_type) value;                                       \
-    }
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(long) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long) -1;
-            }
-            if (sizeof(long) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(long) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(long) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
-            } else if (sizeof(long) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            long val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (long) -1;
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long) -1;
-        val = __Pyx_PyInt_As_long(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            return (int) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            if (sizeof(int) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
-            } else if (sizeof(int) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int) -1;
-        }
-    } else {
-        int val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int) -1;
-        val = __Pyx_PyInt_As_int(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
-    PyObject* fake_module;
-    PyTypeObject* cached_type = NULL;
-    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
-    if (!fake_module) return NULL;
-    Py_INCREF(fake_module);
-    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
-    if (cached_type) {
-        if (!PyType_Check((PyObject*)cached_type)) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s is not a type object",
-                type->tp_name);
-            goto bad;
-        }
-        if (cached_type->tp_basicsize != type->tp_basicsize) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s has the wrong size, try recompiling",
-                type->tp_name);
-            goto bad;
-        }
-    } else {
-        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
-        PyErr_Clear();
-        if (PyType_Ready(type) < 0) goto bad;
-        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
-            goto bad;
-        Py_INCREF(type);
-        cached_type = type;
-    }
-done:
-    Py_DECREF(fake_module);
-    return cached_type;
-bad:
-    Py_XDECREF(cached_type);
-    cached_type = NULL;
-    goto done;
-}
-
-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 PyTypeObject *__pyx_GeneratorType = 0;
-#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
-#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
-    PyObject *et, *ev, *tb;
-    PyObject *value = NULL;
-    __Pyx_ErrFetch(&et, &ev, &tb);
-    if (!et) {
-        Py_XDECREF(tb);
-        Py_XDECREF(ev);
-        Py_INCREF(Py_None);
-        *pvalue = Py_None;
-        return 0;
-    }
-    if (unlikely(et != PyExc_StopIteration) &&
-            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
-        __Pyx_ErrRestore(et, ev, tb);
-        return -1;
-    }
-    if (likely(et == PyExc_StopIteration)) {
-        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
-            if (!ev) {
-                Py_INCREF(Py_None);
-                ev = Py_None;
-            }
-            Py_XDECREF(tb);
-            Py_DECREF(et);
-            *pvalue = ev;
-            return 0;
-        }
-    }
-    PyErr_NormalizeException(&et, &ev, &tb);
-    if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
-        __Pyx_ErrRestore(et, ev, tb);
-        return -1;
-    }
-    Py_XDECREF(tb);
-    Py_DECREF(et);
-#if PY_VERSION_HEX >= 0x030300A0
-    value = ((PyStopIterationObject *)ev)->value;
-    Py_INCREF(value);
-    Py_DECREF(ev);
-#else
-    {
-        PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args);
-        Py_DECREF(ev);
-        if (likely(args)) {
-            value = PyObject_GetItem(args, 0);
-            Py_DECREF(args);
-        }
-        if (unlikely(!value)) {
-            __Pyx_ErrRestore(NULL, NULL, NULL);
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-    }
-#endif
-    *pvalue = value;
-    return 0;
-}
-#endif
-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
-int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
-    if (unlikely(gen->is_running)) {
-        PyErr_SetString(PyExc_ValueError,
-                        "generator already executing");
-        return 1;
-    }
-    return 0;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
-    PyObject *retval;
-    assert(!self->is_running);
-    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) {
-#if CYTHON_COMPILING_IN_PYPY
-#else
-        /* Generators always return to their most recent caller, not
-         * necessarily their creator. */
-        if (self->exc_traceback) {
-            PyThreadState *tstate = PyThreadState_GET();
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_XINCREF(tstate->frame);
-            assert(f->f_back == NULL);
-            f->f_back = tstate->frame;
-        }
-#endif
-        __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);
-#if CYTHON_COMPILING_IN_PYPY
-#else
-        /* Don't keep the reference to f_back any longer than necessary.  It
-         * may keep a chain of frames alive or it could create a reference
-         * cycle. */
-        if (self->exc_traceback) {
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_CLEAR(f->f_back);
-        }
-#endif
-    } else {
-        __Pyx_Generator_ExceptionClear(self);
-    }
-    return retval;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
-    PyObject *ret;
-    PyObject *val = NULL;
-    __Pyx_Generator_Undelegate(gen);
-    __Pyx_PyGen_FetchStopIterationValue(&val);
-    ret = __Pyx_Generator_SendEx(gen, val);
-    Py_XDECREF(val);
-    return ret;
-}
-static PyObject *__Pyx_Generator_Next(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
-    PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        gen->is_running = 1;
-        ret = Py_TYPE(yf)->tp_iternext(yf);
-        gen->is_running = 0;
-        if (likely(ret)) {
-            return ret;
-        }
-        return __Pyx_Generator_FinishDelegation(gen);
-    }
-    return __Pyx_Generator_SendEx(gen, Py_None);
-}
-static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
-    PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        gen->is_running = 1;
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Generator_Send(yf, value);
-        } else {
-            if (value == Py_None)
-                ret = PyIter_Next(yf);
-            else
-                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
-        }
-        gen->is_running = 0;
-        if (likely(ret)) {
-            return ret;
-        }
-        return __Pyx_Generator_FinishDelegation(gen);
-    }
-    return __Pyx_Generator_SendEx(gen, value);
-}
-static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
-    PyObject *retval = NULL;
-    int err = 0;
-    if (__Pyx_Generator_CheckExact(yf)) {
-        retval = __Pyx_Generator_Close(yf);
-        if (!retval)
-            return -1;
-    } else {
-        PyObject *meth;
-        gen->is_running = 1;
-        meth = PyObject_GetAttr(yf, __pyx_n_s_close);
-        if (unlikely(!meth)) {
-            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
-                PyErr_WriteUnraisable(yf);
-            }
-            PyErr_Clear();
-        } else {
-            retval = PyObject_CallFunction(meth, NULL);
-            Py_DECREF(meth);
-            if (!retval)
-                err = -1;
-        }
-        gen->is_running = 0;
-    }
-    Py_XDECREF(retval);
-    return err;
-}
-static PyObject *__Pyx_Generator_Close(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
-    PyObject *retval, *raised_exception;
-    PyObject *yf = gen->yieldfrom;
-    int err = 0;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        Py_INCREF(yf);
-        err = __Pyx_Generator_CloseIter(gen, yf);
-        __Pyx_Generator_Undelegate(gen);
-        Py_DECREF(yf);
-    }
-    if (err == 0)
-#if PY_VERSION_HEX < 0x02050000
-        PyErr_SetNone(PyExc_StopIteration);
-#else
-        PyErr_SetNone(PyExc_GeneratorExit);
-#endif
-    retval = __Pyx_Generator_SendEx(gen, NULL);
-    if (retval) {
-        Py_DECREF(retval);
-        PyErr_SetString(PyExc_RuntimeError,
-                        "generator ignored GeneratorExit");
-        return NULL;
-    }
-    raised_exception = PyErr_Occurred();
-    if (!raised_exception
-        || raised_exception == PyExc_StopIteration
-#if PY_VERSION_HEX >= 0x02050000
-        || raised_exception == PyExc_GeneratorExit
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
-#endif
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
-    {
-        if (raised_exception) 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 *gen = (__pyx_GeneratorObject *) self;
-    PyObject *typ;
-    PyObject *tb = NULL;
-    PyObject *val = NULL;
-    PyObject *yf = gen->yieldfrom;
-    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
-        return NULL;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        Py_INCREF(yf);
-#if PY_VERSION_HEX >= 0x02050000
-        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
-            int err = __Pyx_Generator_CloseIter(gen, yf);
-            Py_DECREF(yf);
-            __Pyx_Generator_Undelegate(gen);
-            if (err < 0)
-                return __Pyx_Generator_SendEx(gen, NULL);
-            goto throw_here;
-        }
-#endif
-        gen->is_running = 1;
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Generator_Throw(yf, args);
-        } else {
-            PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw);
-            if (unlikely(!meth)) {
-                Py_DECREF(yf);
-                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
-                    gen->is_running = 0;
-                    return NULL;
-                }
-                PyErr_Clear();
-                __Pyx_Generator_Undelegate(gen);
-                gen->is_running = 0;
-                goto throw_here;
-            }
-            ret = PyObject_CallObject(meth, args);
-            Py_DECREF(meth);
-        }
-        gen->is_running = 0;
-        Py_DECREF(yf);
-        if (!ret) {
-            ret = __Pyx_Generator_FinishDelegation(gen);
-        }
-        return ret;
-    }
-throw_here:
-    __Pyx_Raise(typ, val, tb, NULL);
-    return __Pyx_Generator_SendEx(gen, 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->yieldfrom);
-    Py_VISIT(gen->exc_type);
-    Py_VISIT(gen->exc_value);
-    Py_VISIT(gen->exc_traceback);
-    return 0;
-}
-static int __Pyx_Generator_clear(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
-    Py_CLEAR(gen->closure);
-    Py_CLEAR(gen->classobj);
-    Py_CLEAR(gen->yieldfrom);
-    Py_CLEAR(gen->exc_type);
-    Py_CLEAR(gen->exc_value);
-    Py_CLEAR(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);
-    if (gen->resume_label > 0) {
-        PyObject_GC_Track(self);
-#if PY_VERSION_HEX >= 0x030400a1
-        if (PyObject_CallFinalizerFromDealloc(self))
-#else
-        Py_TYPE(gen)->tp_del(self);
-        if (self->ob_refcnt > 0)
-#endif
-            return;                     /* resurrected.  :( */
-        PyObject_GC_UnTrack(self);
-    }
-    __Pyx_Generator_clear(self);
-    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 ;
-#if PY_VERSION_HEX < 0x030400a1
-    assert(self->ob_refcnt == 0);
-    self->ob_refcnt = 1;
-#endif
-    __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);
-#if PY_VERSION_HEX < 0x030400a1
-    /* 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;
-    }
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#endif
-    /* 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
-    --Py_TYPE(self)->tp_frees;
-    --Py_TYPE(self)->tp_allocs;
-#endif
-#endif
-}
-static PyMemberDef __pyx_Generator_memberlist[] = {
-    {(char *) "gi_running",
-#if PY_VERSION_HEX >= 0x02060000
-     T_BOOL,
-#else
-     T_BYTE,
-#endif
-     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_type = {
-    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*/
-    0,                                  /*tp_getattro*/
-    0,                                  /*tp_setattro*/
-    0,                                  /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/
-    0,                                  /*tp_doc*/
-    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
-    0,                                  /*tp_clear*/
-    0,                                  /*tp_richcompare*/
-    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
-    0,                                  /*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*/
-#if PY_VERSION_HEX >= 0x030400a1
-    0,                                  /*tp_del*/
-#else
-    __Pyx_Generator_del,                /*tp_del*/
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-    0,                                  /*tp_version_tag*/
-#endif
-#if PY_VERSION_HEX >= 0x030400a1
-    __Pyx_Generator_del,                /*tp_finalize*/
-#endif
-};
-static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
-                                                  PyObject *closure) {
-    __pyx_GeneratorObject *gen =
-        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
-    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->yieldfrom = 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) {
-    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
-    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
-    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
-    if (__pyx_GeneratorType == NULL) {
-        return -1;
-    }
-    return 0;
-}
-
-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;
-}
-
-#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
-
-#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_ssize_t basicsize;
-#ifdef Py_LIMITED_API
-    PyObject *py_basicsize;
-#endif
-    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,
-            "%.200s.%.200s is not a type object",
-            module_name, class_name);
-        goto bad;
-    }
-#ifndef Py_LIMITED_API
-    basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
-    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
-    if (!py_basicsize)
-        goto bad;
-    basicsize = PyLong_AsSsize_t(py_basicsize);
-    Py_DECREF(py_basicsize);
-    py_basicsize = 0;
-    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
-        goto bad;
-#endif
-    if (!strict && (size_t)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)basicsize != size) {
-        PyErr_Format(PyExc_ValueError,
-            "%.200s.%.200s 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
-
-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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
-    Py_ssize_t ignore;
-    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
-            }
-        }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-        return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
-    } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
-#if !CYTHON_COMPILING_IN_PYPY
-#if PY_VERSION_HEX >= 0x02060000
-    if (PyByteArray_Check(o)) {
-        *length = PyByteArray_GET_SIZE(o);
-        return PyByteArray_AS_STRING(o);
-    } else
-#endif
-#endif
-    {
-        char* result;
-        int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (unlikely(r < 0)) {
-            return NULL;
-        } else {
-            return result;
-        }
-    }
-}
-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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
-    if (!PyLong_Check(res)) {
-#endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (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;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
-  Py_ssize_t ival;
-  PyObject *x;
-#if PY_MAJOR_VERSION < 3
-  if (likely(PyInt_CheckExact(b)))
-      return PyInt_AS_LONG(b);
-#endif
-  if (likely(PyLong_CheckExact(b))) {
-    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-     #if CYTHON_USE_PYLONG_INTERNALS
-       switch (Py_SIZE(b)) {
-       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
-       case  0: return 0;
-       case  1: return ((PyLongObject*)b)->ob_digit[0];
-       }
-     #endif
-    #endif
-  #if PY_VERSION_HEX < 0x02060000
-    return PyInt_AsSsize_t(b);
-  #else
-    return PyLong_AsSsize_t(b);
-  #endif
-  }
-  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
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/pysam/chtslib.c b/pysam/chtslib.c
deleted file mode 100644
index 0c05607..0000000
--- a/pysam/chtslib.c
+++ /dev/null
@@ -1,3162 +0,0 @@
-/* Generated by Cython 0.20.1 on Fri Nov 21 19:49:04 2014 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#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
-#define CYTHON_ABI "0_20_1"
-#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 Py_OptimizeFlag 0
-#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 CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #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"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-  #define __Pyx_DefaultClassType PyClass_Type
-#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)
-  #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #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 < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
-  #define Py_TPFLAGS_IS_ABSTRACT 0
-#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
-  #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
-  #define CYTHON_PEP393_ENABLED 1
-  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
-                                              0 : _PyUnicode_Ready((PyObject *)(op)))
-  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
-  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
-  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
-  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
-  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
-#else
-  #define CYTHON_PEP393_ENABLED 0
-  #define __Pyx_PyUnicode_READY(op)       (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]))
-  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
-  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
-  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
-#else
-  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
-      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
-#else
-  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
-#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_MAJOR_VERSION >= 3
-  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
-  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#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
-  #define PyNumber_Int                 PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyBoolObject                 PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x030200A4
-  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
-#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
-#ifndef CYTHON_RESTRICT
-  #if defined(__GNUC__)
-    #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER) && _MSC_VER >= 1400
-    #define CYTHON_RESTRICT __restrict
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_RESTRICT restrict
-  #else
-    #define CYTHON_RESTRICT
-  #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
-  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
-   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
-   a quiet NaN. */
-  float value;
-  memset(&value, 0xFF, sizeof(value));
-  return value;
-}
-#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__pysam__libchtslib
-#define __PYX_HAVE_API__pysam__libchtslib
-#include "string.h"
-#include "stdio.h"
-#include "pythread.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#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 Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
-    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
-    (sizeof(type) > sizeof(Py_ssize_t) &&               \
-          likely(v < (type)PY_SSIZE_T_MAX ||            \
-                 v == (type)PY_SSIZE_T_MAX)  &&         \
-          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
-                                v == (type)PY_SSIZE_T_MIN)))  ||  \
-    (sizeof(type) == sizeof(Py_ssize_t) &&              \
-          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
-                               v == (type)PY_SSIZE_T_MAX)))  )
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString        PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
-    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
-    const Py_UNICODE *u_end = u;
-    while (*u_end++) ;
-    return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
-#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);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    PyObject* ascii_chars_u = NULL;
-    PyObject* ascii_chars_b = NULL;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
-        __Pyx_sys_getdefaultencoding_not_ascii = 0;
-    } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
-        char ascii_chars[128];
-        int c;
-        for (c = 0; c < 128; c++) {
-            ascii_chars[c] = c;
-        }
-        __Pyx_sys_getdefaultencoding_not_ascii = 1;
-        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
-        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
-            PyErr_Format(
-                PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
-                default_encoding_c);
-            goto bad;
-        }
-    }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    char* default_encoding_c;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
-    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
-    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
-    Py_DECREF(default_encoding);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    return -1;
-}
-#endif
-#endif
-
-
-#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_d;
-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[] = {
-  "chtslib.pyx",
-  "type.pxd",
-  "bool.pxd",
-  "complex.pxd",
-};
-
-/*--- Type declarations ---*/
-#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_XDECREF_SET(r, v) do {                            \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_XDECREF(tmp);                              \
-    } while (0)
-#define __Pyx_DECREF_SET(r, v) do {                             \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_DECREF(tmp);                               \
-    } while (0)
-#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)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_getattro))
-        return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_getattr))
-        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
-    return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-#ifndef CYTHON_PROFILE
-  #define CYTHON_PROFILE 1
-#endif
-#ifndef CYTHON_TRACE
-  #define CYTHON_TRACE 0
-#endif
-#if CYTHON_TRACE
-  #undef CYTHON_PROFILE_REUSE_FRAME
-#endif
-#ifndef CYTHON_PROFILE_REUSE_FRAME
-  #define CYTHON_PROFILE_REUSE_FRAME 0
-#endif
-#if CYTHON_PROFILE || CYTHON_TRACE
-  #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_CLEAR(__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 || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc)))) {      \
-      __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 || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc))) {  \
-      PyThreadState* tstate = PyThreadState_GET();                                         \
-      tstate->use_tracing = 0;                                                             \
-      PyObject *exc_info = __Pyx_GetExceptionTuple();                                      \
-      if (exc_info) {                                                                      \
-          if (CYTHON_TRACE && tstate->c_tracefunc)                                         \
-              tstate->c_tracefunc(                                                         \
-                  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);          \
-          tstate->c_profilefunc(                                                           \
-              tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);            \
-          Py_DECREF(exc_info);                                                             \
-      }                                                                                    \
-      tstate->use_tracing = 1;                                                             \
-  }
-  #define __Pyx_TraceReturn(result)                                                  \
-  if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing) {             \
-      PyThreadState* tstate = PyThreadState_GET();                                   \
-      tstate->use_tracing = 0;                                                        \
-      if (CYTHON_TRACE && tstate->c_tracefunc)                                       \
-          tstate->c_tracefunc(                                                       \
-              tstate->c_traceobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);  \
-      if (tstate->c_profilefunc)                                                     \
-          tstate->c_profilefunc(                                                     \
-              tstate->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);  \
-      CYTHON_FRAME_DEL;                                                              \
-      tstate->use_tracing = 1;                                                       \
-  }
-  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 */
-#if CYTHON_TRACE
-  #define __Pyx_TraceLine(lineno)                                                          \
-  if (unlikely(__Pyx_use_tracing) && unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_tracefunc)) {    \
-      PyThreadState* tstate = PyThreadState_GET();                                         \
-      __pyx_frame->f_lineno = lineno;                                                     \
-      tstate->use_tracing = 0;                                                             \
-      tstate->c_tracefunc(tstate->c_traceobj, __pyx_frame, PyTrace_LINE, NULL);           \
-      tstate->use_tracing = 1;                                                             \
-  }
-#else
-  #define __Pyx_TraceLine(lineno)
-#endif
-
-#include <string.h>
-
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
-         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
-         const char* encoding, const char* errors,
-         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
-#else
-#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
-#endif
-
-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 PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static int __Pyx_check_binary_version(void);
-
-#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 PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*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 'cpython.version' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'cpython.exc' */
-
-/* Module declarations from 'cpython.module' */
-
-/* Module declarations from 'cpython.mem' */
-
-/* Module declarations from 'cpython.tuple' */
-
-/* Module declarations from 'cpython.list' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from 'cpython.sequence' */
-
-/* Module declarations from 'cpython.mapping' */
-
-/* Module declarations from 'cpython.iterator' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'cpython.number' */
-
-/* Module declarations from 'cpython.int' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.bool' */
-static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
-
-/* Module declarations from 'cpython.long' */
-
-/* Module declarations from 'cpython.float' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.complex' */
-static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
-
-/* Module declarations from 'cpython.string' */
-
-/* Module declarations from 'cpython.unicode' */
-
-/* Module declarations from 'cpython.dict' */
-
-/* Module declarations from 'cpython.instance' */
-
-/* Module declarations from 'cpython.function' */
-
-/* Module declarations from 'cpython.method' */
-
-/* Module declarations from 'cpython.weakref' */
-
-/* Module declarations from 'cpython.getargs' */
-
-/* Module declarations from 'cpython.pythread' */
-
-/* Module declarations from 'cpython.pystate' */
-
-/* Module declarations from 'cpython.cobject' */
-
-/* Module declarations from 'cpython.oldbuffer' */
-
-/* Module declarations from 'cpython.set' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.bytes' */
-
-/* Module declarations from 'cpython.pycapsule' */
-
-/* Module declarations from 'cpython' */
-
-/* Module declarations from 'pysam.libchtslib' */
-static PyObject *__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING = 0;
-static PyObject *__pyx_f_5pysam_10libchtslib__forceBytes(PyObject *); /*proto*/
-#define __Pyx_MODULE_NAME "pysam.libchtslib"
-int __pyx_module_is_main_pysam__libchtslib = 0;
-
-/* Implementation of 'pysam.libchtslib' */
-static PyObject *__pyx_builtin_TypeError;
-static char __pyx_k_os[] = "os";
-static char __pyx_k_re[] = "re";
-static char __pyx_k_all[] = "__all__";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_ascii[] = "ascii";
-static char __pyx_k_types[] = "types";
-static char __pyx_k_ctypes[] = "ctypes";
-static char __pyx_k_decode[] = "decode";
-static char __pyx_k_encode[] = "encode";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_struct[] = "struct";
-static char __pyx_k_platform[] = "platform";
-static char __pyx_k_tempfile[] = "tempfile";
-static char __pyx_k_warnings[] = "warnings";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_itertools[] = "itertools";
-static char __pyx_k_IS_PYTHON3[] = "IS_PYTHON3";
-static char __pyx_k_collections[] = "collections";
-static char __pyx_k_getdefaultencoding[] = "getdefaultencoding";
-static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding";
-static char __pyx_k_Argument_must_be_string_bytes_or[] = "Argument must be string, bytes or unicode.";
-static char __pyx_k_Argument_must_be_string_or_unico[] = "Argument must be string or unicode.";
-static PyObject *__pyx_kp_u_Argument_must_be_string_bytes_or;
-static PyObject *__pyx_kp_u_Argument_must_be_string_or_unico;
-static PyObject *__pyx_n_s_IS_PYTHON3;
-static PyObject *__pyx_n_s_TypeError;
-static PyObject *__pyx_n_s_all;
-static PyObject *__pyx_n_s_ascii;
-static PyObject *__pyx_n_s_collections;
-static PyObject *__pyx_n_s_ctypes;
-static PyObject *__pyx_n_s_decode;
-static PyObject *__pyx_n_s_encode;
-static PyObject *__pyx_n_s_getdefaultencoding;
-static PyObject *__pyx_n_s_getfilesystemencoding;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_n_s_itertools;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_n_s_os;
-static PyObject *__pyx_n_s_platform;
-static PyObject *__pyx_n_s_re;
-static PyObject *__pyx_n_s_struct;
-static PyObject *__pyx_n_s_sys;
-static PyObject *__pyx_n_s_tempfile;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_n_s_types;
-static PyObject *__pyx_n_s_warnings;
-static PyObject *__pyx_tuple_;
-static PyObject *__pyx_tuple__2;
-
-/* "pysam/chtslib.pyx":29
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3
- * 
- * cdef from_string_and_size(char* s, size_t length):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]
- */
-
-static PyObject *__pyx_f_5pysam_10libchtslib_from_string_and_size(char *__pyx_v_s, size_t __pyx_v_length) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("from_string_and_size", 0);
-  __Pyx_TraceCall("from_string_and_size", __pyx_f[0], 29);
-
-  /* "pysam/chtslib.pyx":30
- * 
- * cdef from_string_and_size(char* s, size_t length):
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s[:length]
- *     else:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/chtslib.pyx":31
- * cdef from_string_and_size(char* s, size_t length):
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]             # <<<<<<<<<<<<<<
- *     else:
- *         return s[:length].decode("ascii")
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/chtslib.pyx":33
- *         return s[:length]
- *     else:
- *         return s[:length].decode("ascii")             # <<<<<<<<<<<<<<
- * 
- * # filename encoding (copied from lxml.etree.pyx)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_s, 0, __pyx_v_length, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":29
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3
- * 
- * cdef from_string_and_size(char* s, size_t length):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s[:length]
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.libchtslib.from_string_and_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/chtslib.pyx":46
- * #_C_FILENAME_ENCODING = <char*>_FILENAME_ENCODING
- * 
- * cdef bytes _encodeFilename(object filename):             # <<<<<<<<<<<<<<
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- */
-
-static PyObject *__pyx_f_5pysam_10libchtslib__encodeFilename(PyObject *__pyx_v_filename) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_encodeFilename", 0);
-  __Pyx_TraceCall("_encodeFilename", __pyx_f[0], 46);
-
-  /* "pysam/chtslib.pyx":48
- * cdef bytes _encodeFilename(object filename):
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(filename):
- */
-  __pyx_t_1 = (__pyx_v_filename == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":49
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(filename):
- *         return filename
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":50
- *     if filename is None:
- *         return None
- *     elif PyBytes_Check(filename):             # <<<<<<<<<<<<<<
- *         return filename
- *     elif PyUnicode_Check(filename):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_filename) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":51
- *         return None
- *     elif PyBytes_Check(filename):
- *         return filename             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(filename):
- *         return filename.encode(_FILENAME_ENCODING)
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_filename))||((__pyx_v_filename) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_filename)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_filename);
-    __pyx_r = ((PyObject*)__pyx_v_filename);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":52
- *     elif PyBytes_Check(filename):
- *         return filename
- *     elif PyUnicode_Check(filename):             # <<<<<<<<<<<<<<
- *         return filename.encode(_FILENAME_ENCODING)
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_filename) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":53
- *         return filename
- *     elif PyUnicode_Check(filename):
- *         return filename.encode(_FILENAME_ENCODING)             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_5pysam_10libchtslib__FILENAME_ENCODING);
-    __Pyx_GIVEREF(__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_5);
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/chtslib.pyx":55
- *         return filename.encode(_FILENAME_ENCODING)
- *     else:
- *         raise TypeError, u"Argument must be string or unicode."             # <<<<<<<<<<<<<<
- * 
- * cdef _forceStr(object s):
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_or_unico, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/chtslib.pyx":46
- * #_C_FILENAME_ENCODING = <char*>_FILENAME_ENCODING
- * 
- * cdef bytes _encodeFilename(object filename):             # <<<<<<<<<<<<<<
- *     """Make sure a filename is 8-bit encoded (or None)."""
- *     if filename is None:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.libchtslib._encodeFilename", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/chtslib.pyx":57
- *         raise TypeError, u"Argument must be string or unicode."
- * 
- * cdef _forceStr(object s):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- */
-
-static PyObject *__pyx_f_5pysam_10libchtslib__forceStr(PyObject *__pyx_v_s) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  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("_forceStr", 0);
-  __Pyx_TraceCall("_forceStr", __pyx_f[0], 57);
-
-  /* "pysam/chtslib.pyx":60
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- *     if s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     if PY_MAJOR_VERSION < 3:
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":61
- *     (bytes in Py2, unicode in Py3)"""
- *     if s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":62
- *     if s is None:
- *         return None
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_2 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":63
- *         return None
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s.decode('ascii')
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = __pyx_v_s;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":64
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s.decode('ascii')
- *     else:
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":65
- *         return s
- *     elif PyBytes_Check(s):
- *         return s.decode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         # assume unicode
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/chtslib.pyx":68
- *     else:
- *         # assume unicode
- *         return s             # <<<<<<<<<<<<<<
- * 
- * cdef bytes _forceBytes(object s):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = __pyx_v_s;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":57
- *         raise TypeError, u"Argument must be string or unicode."
- * 
- * cdef _forceStr(object s):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.libchtslib._forceStr", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/chtslib.pyx":70
- *         return s
- * 
- * cdef bytes _forceBytes(object s):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-
-static PyObject *__pyx_f_5pysam_10libchtslib__forceBytes(PyObject *__pyx_v_s) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  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("_forceBytes", 0);
-  __Pyx_TraceCall("_forceBytes", __pyx_f[0], 70);
-
-  /* "pysam/chtslib.pyx":73
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif s is None:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/chtslib.pyx":74
- *     """
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif s is None:
- *         return None
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":75
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":76
- *         return s
- *     elif s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":77
- *     elif s is None:
- *         return None
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyUnicode_Check(s):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":78
- *         return None
- *     elif PyBytes_Check(s):
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":79
- *     elif PyBytes_Check(s):
- *         return s
- *     elif PyUnicode_Check(s):             # <<<<<<<<<<<<<<
- *         return s.encode('ascii')
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/chtslib.pyx":80
- *         return s
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_4);
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/chtslib.pyx":82
- *         return s.encode('ascii')
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."             # <<<<<<<<<<<<<<
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_bytes_or, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/chtslib.pyx":70
- *         return s
- * 
- * cdef bytes _forceBytes(object s):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.libchtslib._forceBytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/chtslib.pyx":84
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):             # <<<<<<<<<<<<<<
- *     return _forceBytes(s)
- * 
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_10libchtslib__forceCmdlineBytes(PyObject *__pyx_v_s) {
-  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("_forceCmdlineBytes", 0);
-  __Pyx_TraceCall("_forceCmdlineBytes", __pyx_f[0], 84);
-
-  /* "pysam/chtslib.pyx":85
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):
- *     return _forceBytes(s)             # <<<<<<<<<<<<<<
- * 
- * cdef _charptr_to_str(char* s):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_5pysam_10libchtslib__forceBytes(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/chtslib.pyx":84
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):             # <<<<<<<<<<<<<<
- *     return _forceBytes(s)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.libchtslib._forceCmdlineBytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/chtslib.pyx":87
- *     return _forceBytes(s)
- * 
- * cdef _charptr_to_str(char* s):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-
-static PyObject *__pyx_f_5pysam_10libchtslib__charptr_to_str(char *__pyx_v_s) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_charptr_to_str", 0);
-  __Pyx_TraceCall("_charptr_to_str", __pyx_f[0], 87);
-
-  /* "pysam/chtslib.pyx":88
- * 
- * cdef _charptr_to_str(char* s):
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     else:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/chtslib.pyx":89
- * cdef _charptr_to_str(char* s):
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     else:
- *         return s.decode("ascii")
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/chtslib.pyx":91
- *         return s
- *     else:
- *         return s.decode("ascii")             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_s, 0, strlen(__pyx_v_s), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/chtslib.pyx":87
- *     return _forceBytes(s)
- * 
- * cdef _charptr_to_str(char* s):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.libchtslib._charptr_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyMethodDef __pyx_methods[] = {
-  {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
-    PyModuleDef_HEAD_INIT,
-  #endif
-    __Pyx_NAMESTR("libchtslib"),
-    0, /* m_doc */
-    -1, /* m_size */
-    __pyx_methods /* m_methods */,
-    NULL, /* m_reload */
-    NULL, /* m_traverse */
-    NULL, /* m_clear */
-    NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_u_Argument_must_be_string_bytes_or, __pyx_k_Argument_must_be_string_bytes_or, sizeof(__pyx_k_Argument_must_be_string_bytes_or), 0, 1, 0, 0},
-  {&__pyx_kp_u_Argument_must_be_string_or_unico, __pyx_k_Argument_must_be_string_or_unico, sizeof(__pyx_k_Argument_must_be_string_or_unico), 0, 1, 0, 0},
-  {&__pyx_n_s_IS_PYTHON3, __pyx_k_IS_PYTHON3, sizeof(__pyx_k_IS_PYTHON3), 0, 0, 1, 1},
-  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
-  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
-  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
-  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
-  {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
-  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
-  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
-  {&__pyx_n_s_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
-  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
-  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
-  {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
-  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
-  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
-  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
-  {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
-  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
-  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
-  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
-  {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __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);
-
-  /* "pysam/chtslib.pyx":65
- *         return s
- *     elif PyBytes_Check(s):
- *         return s.decode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         # assume unicode
- */
-  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple_);
-  __Pyx_GIVEREF(__pyx_tuple_);
-
-  /* "pysam/chtslib.pyx":80
- *         return s
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- */
-  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__2);
-  __Pyx_GIVEREF(__pyx_tuple__2);
-  __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;};
-  return 0;
-  __pyx_L1_error:;
-  return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC initlibchtslib(void); /*proto*/
-PyMODINIT_FUNC initlibchtslib(void)
-#else
-PyMODINIT_FUNC PyInit_libchtslib(void); /*proto*/
-PyMODINIT_FUNC PyInit_libchtslib(void)
-#endif
-{
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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_libchtslib(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("libchtslib"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
-  #else
-  __pyx_m = PyModule_Create(&__pyx_moduledef);
-  #endif
-  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_d);
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  if (__pyx_module_is_main_pysam__libchtslib) {
-    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;};
-  }
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pysam.libchtslib")) {
-      if (unlikely(PyDict_SetItemString(modules, "pysam.libchtslib", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  /*--- 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_5pysam_10libchtslib__FILENAME_ENCODING = ((PyObject*)Py_None); Py_INCREF(Py_None);
-  /*--- Variable export code ---*/
-  /*--- Function export code ---*/
-  /*--- Type init code ---*/
-  /*--- Type import code ---*/
-  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
-  #if CYTHON_COMPILING_IN_PYPY
-  sizeof(PyTypeObject),
-  #else
-  sizeof(PyHeapTypeObject),
-  #endif
-  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Variable import code ---*/
-  /*--- Function import code ---*/
-  /*--- Execution code ---*/
-
-  /* "pysam/chtslib.pyx":4
- * # cython: profile=True
- * # adds doc-strings for sphinx
- * import tempfile             # <<<<<<<<<<<<<<
- * import os
- * import sys
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":5
- * # adds doc-strings for sphinx
- * import tempfile
- * import os             # <<<<<<<<<<<<<<
- * import sys
- * import types
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":6
- * import tempfile
- * import os
- * import sys             # <<<<<<<<<<<<<<
- * import types
- * import itertools
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":7
- * import os
- * import sys
- * import types             # <<<<<<<<<<<<<<
- * import itertools
- * import struct
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_types, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":8
- * import sys
- * import types
- * import itertools             # <<<<<<<<<<<<<<
- * import struct
- * import ctypes
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":9
- * import types
- * import itertools
- * import struct             # <<<<<<<<<<<<<<
- * import ctypes
- * import collections
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":10
- * import itertools
- * import struct
- * import ctypes             # <<<<<<<<<<<<<<
- * import collections
- * import re
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":11
- * import struct
- * import ctypes
- * import collections             # <<<<<<<<<<<<<<
- * import re
- * import platform
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":12
- * import ctypes
- * import collections
- * import re             # <<<<<<<<<<<<<<
- * import platform
- * import warnings
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":13
- * import collections
- * import re
- * import platform             # <<<<<<<<<<<<<<
- * import warnings
- * from cpython cimport PyErr_SetString, \
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_platform, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":14
- * import re
- * import platform
- * import warnings             # <<<<<<<<<<<<<<
- * from cpython cimport PyErr_SetString, \
- *     PyBytes_Check, \
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":27
- * ## Python 3 compatibility functions
- * ########################################################################
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3             # <<<<<<<<<<<<<<
- * 
- * cdef from_string_and_size(char* s, size_t length):
- */
-  __pyx_t_1 = __Pyx_PyBool_FromLong((PY_MAJOR_VERSION >= 3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IS_PYTHON3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":37
- * # filename encoding (copied from lxml.etree.pyx)
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_XGOTREF(__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":38
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- */
-  __pyx_t_3 = (__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_4 = (__pyx_t_3 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/chtslib.pyx":39
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XGOTREF(__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L2;
-  }
-  __pyx_L2:;
-
-  /* "pysam/chtslib.pyx":40
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = 'ascii'
- * 
- */
-  __pyx_t_4 = (__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_3 = (__pyx_t_4 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/chtslib.pyx":41
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'             # <<<<<<<<<<<<<<
- * 
- * #cdef char* _C_FILENAME_ENCODING
- */
-    __Pyx_INCREF(__pyx_n_s_ascii);
-    __Pyx_XGOTREF(__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_10libchtslib__FILENAME_ENCODING, __pyx_n_s_ascii);
-    __Pyx_GIVEREF(__pyx_n_s_ascii);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/chtslib.pyx":94
- * 
- * 
- * __all__ = []             # <<<<<<<<<<<<<<
- */
-  __pyx_t_1 = PyList_New(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);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/chtslib.pyx":1
- * # cython: embedsignature=True             # <<<<<<<<<<<<<<
- * # cython: profile=True
- * # adds doc-strings for sphinx
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  if (__pyx_m) {
-    __Pyx_AddTraceback("init pysam.libchtslib", __pyx_clineno, __pyx_lineno, __pyx_filename);
-    Py_DECREF(__pyx_m); __pyx_m = 0;
-  } else if (!PyErr_Occurred()) {
-    PyErr_SetString(PyExc_ImportError, "init pysam.libchtslib");
-  }
-  __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_GetBuiltinName(PyObject *name) {
-    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
-    if (unlikely(!result)) {
-        PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
-            "name '%U' is not defined", name);
-#else
-            "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
-    }
-    return result;
-}
-
-#if CYTHON_PROFILE
-static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
-                                   PyFrameObject** frame,
-                                   const char *funcname,
-                                   const char *srcfile,
-                                   int firstlineno) {
-    int retval;
-    PyThreadState* tstate = PyThreadState_GET();
-    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
-        if (*code == NULL) {
-            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
-            if (*code == NULL) return 0;
-        }
-        *frame = PyFrame_New(
-            tstate,                          /*PyThreadState *tstate*/
-            *code,                           /*PyCodeObject *code*/
-            __pyx_d,                  /*PyObject *globals*/
-            0                                /*PyObject *locals*/
-        );
-        if (*frame == NULL) return 0;
-        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
-            Py_INCREF(Py_None);
-            (*frame)->f_trace = Py_None;
-        }
-#if PY_VERSION_HEX < 0x030400B1
-    } else {
-        (*frame)->f_tstate = tstate;
-#endif
-    }
-    (*frame)->f_lineno = firstlineno;
-    tstate->use_tracing = 0;
-    #if CYTHON_TRACE
-    if (tstate->c_tracefunc)
-        tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL);
-    if (!tstate->c_profilefunc)
-        retval = 1;
-    else
-    #endif
-        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
-    tstate->use_tracing = (tstate->c_profilefunc ||
-                           (CYTHON_TRACE && tstate->c_tracefunc));
-    return tstate->use_tracing && retval;
-}
-static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
-    PyObject *py_srcfile = 0;
-    PyObject *py_funcname = 0;
-    PyCodeObject *py_code = 0;
-    #if PY_MAJOR_VERSION < 3
-    py_funcname = PyString_FromString(funcname);
-    py_srcfile = PyString_FromString(srcfile);
-    #else
-    py_funcname = PyUnicode_FromString(funcname);
-    py_srcfile = PyUnicode_FromString(srcfile);
-    #endif
-    if (!py_funcname | !py_srcfile) goto bad;
-    py_code = PyCode_New(
-        0,                /*int argcount,*/
-        #if PY_MAJOR_VERSION >= 3
-        0,                /*int kwonlyargcount,*/
-        #endif
-        0,                /*int nlocals,*/
-        0,                /*int stacksize,*/
-        0,                /*int flags,*/
-        __pyx_empty_bytes,     /*PyObject *code,*/
-        __pyx_empty_tuple,     /*PyObject *consts,*/
-        __pyx_empty_tuple,     /*PyObject *names,*/
-        __pyx_empty_tuple,     /*PyObject *varnames,*/
-        __pyx_empty_tuple,     /*PyObject *freevars,*/
-        __pyx_empty_tuple,     /*PyObject *cellvars,*/
-        py_srcfile,       /*PyObject *filename,*/
-        py_funcname,      /*PyObject *name,*/
-        firstlineno,      /*int firstlineno,*/
-        __pyx_empty_bytes      /*PyObject *lnotab*/
-    );
-bad:
-    Py_XDECREF(py_srcfile);
-    Py_XDECREF(py_funcname);
-    return py_code;
-}
-#endif /* CYTHON_PROFILE */
-
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
-         const char* cstring, Py_ssize_t start, Py_ssize_t stop,
-         const char* encoding, const char* errors,
-         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
-    Py_ssize_t length;
-    if (unlikely((start < 0) | (stop < 0))) {
-        length = strlen(cstring);
-        if (start < 0) {
-            start += length;
-            if (start < 0)
-                start = 0;
-        }
-        if (stop < 0)
-            stop += length;
-    }
-    length = stop - start;
-    if (unlikely(length <= 0))
-        return PyUnicode_FromUnicode(NULL, 0);
-    cstring += start;
-    if (decode_func) {
-        return decode_func(cstring, length, errors);
-    } else {
-        return PyUnicode_Decode(cstring, length, encoding, errors);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyObject *result;
-    ternaryfunc call = func->ob_type->tp_call;
-    if (unlikely(!call))
-        return PyObject_Call(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
-        return NULL;
-#endif
-    result = (*call)(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    Py_LeaveRecursiveCall();
-#endif
-    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
-        PyErr_SetString(
-            PyExc_SystemError,
-            "NULL result without error in PyObject_Call");
-    }
-    return result;
-}
-#endif
-
-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);
-    if (!value || value == Py_None)
-        value = NULL;
-    else
-        Py_INCREF(value);
-    if (!tb || tb == Py_None)
-        tb = NULL;
-    else {
-        Py_INCREF(tb);
-        if (!PyTraceBack_Check(tb)) {
-            PyErr_SetString(PyExc_TypeError,
-                "raise: arg 3 must be a traceback or None");
-            goto raise_error;
-        }
-    }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
-    if (PyType_Check(type)) {
-    #endif
-#if CYTHON_COMPILING_IN_PYPY
-        if (!value) {
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-#endif
-        PyErr_NormalizeException(&type, &value, &tb);
-    } else {
-        if (value) {
-            PyErr_SetString(PyExc_TypeError,
-                "instance exception may not have a separate value");
-            goto raise_error;
-        }
-        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) {
-    PyObject* owned_instance = NULL;
-    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)) {
-        PyObject *instance_class = NULL;
-        if (value && PyExceptionInstance_Check(value)) {
-            instance_class = (PyObject*) Py_TYPE(value);
-            if (instance_class != type) {
-                if (PyObject_IsSubclass(instance_class, type)) {
-                    type = instance_class;
-                } else {
-                    instance_class = NULL;
-                }
-            }
-        }
-        if (!instance_class) {
-            PyObject *args;
-            if (!value)
-                args = PyTuple_New(0);
-            else if (PyTuple_Check(value)) {
-                Py_INCREF(value);
-                args = value;
-            } else
-                args = PyTuple_Pack(1, value);
-            if (!args)
-                goto bad;
-            owned_instance = PyObject_Call(type, args, NULL);
-            Py_DECREF(args);
-            if (!owned_instance)
-                goto bad;
-            value = owned_instance;
-            if (!PyExceptionInstance_Check(value)) {
-                PyErr_Format(PyExc_TypeError,
-                             "calling %R should have returned an instance of "
-                             "BaseException, not %R",
-                             type, Py_TYPE(value));
-                goto bad;
-            }
-        }
-    } else {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: exception class must be a subclass of BaseException");
-        goto bad;
-    }
-#if PY_VERSION_HEX >= 0x03030000
-    if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
-        PyObject *fixed_cause;
-        if (cause == Py_None) {
-            fixed_cause = NULL;
-        } else 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;
-        }
-        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:
-    Py_XDECREF(owned_instance);
-    return;
-}
-#endif
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
-    PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
-    result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
-        Py_INCREF(result);
-    } else {
-#else
-    result = PyObject_GetItem(__pyx_d, name);
-    if (!result) {
-        PyErr_Clear();
-#endif
-        result = __Pyx_GetBuiltinName(name);
-    }
-    return result;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
-    PyObject *empty_list = 0;
-    PyObject *module = 0;
-    PyObject *global_dict = 0;
-    PyObject *empty_dict = 0;
-    PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
-    PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
-    if (!py_import)
-        goto bad;
-    #endif
-    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, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                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);
-                #else
-                module = PyImport_ImportModuleLevelObject(
-                    name, global_dict, empty_dict, list, 1);
-                #endif
-                if (!module) {
-                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
-                        goto bad;
-                    PyErr_Clear();
-                }
-            }
-            level = 0; /* try absolute import on failure */
-        }
-        #endif
-        if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
-            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
-            module = PyImport_ImportModuleLevelObject(
-                name, global_dict, empty_dict, list, level);
-            #endif
-        }
-    }
-    #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:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(long) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(long) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(long),
-                                     little, !is_unsigned);
-    }
-}
-
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
-    {                                                                     \
-        func_type value = func(x);                                        \
-        if (sizeof(target_type) < sizeof(func_type)) {                    \
-            if (unlikely(value != (func_type) (target_type) value)) {     \
-                func_type zero = 0;                                       \
-                PyErr_SetString(PyExc_OverflowError,                      \
-                    (is_unsigned && unlikely(value < zero)) ?             \
-                    "can't convert negative value to " #target_type :     \
-                    "value too large to convert to " #target_type);       \
-                return (target_type) -1;                                  \
-            }                                                             \
-        }                                                                 \
-        return (target_type) value;                                       \
-    }
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(long) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long) -1;
-            }
-            if (sizeof(long) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(long) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(long) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
-            } else if (sizeof(long) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            long val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (long) -1;
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long) -1;
-        val = __Pyx_PyInt_As_long(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            return (int) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            if (sizeof(int) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
-            } else if (sizeof(int) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int) -1;
-        }
-    } else {
-        int val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int) -1;
-        val = __Pyx_PyInt_As_int(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-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;
-}
-
-#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
-
-#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_ssize_t basicsize;
-#ifdef Py_LIMITED_API
-    PyObject *py_basicsize;
-#endif
-    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,
-            "%.200s.%.200s is not a type object",
-            module_name, class_name);
-        goto bad;
-    }
-#ifndef Py_LIMITED_API
-    basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
-    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
-    if (!py_basicsize)
-        goto bad;
-    basicsize = PyLong_AsSsize_t(py_basicsize);
-    Py_DECREF(py_basicsize);
-    py_basicsize = 0;
-    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
-        goto bad;
-#endif
-    if (!strict && (size_t)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)basicsize != size) {
-        PyErr_Format(PyExc_ValueError,
-            "%.200s.%.200s 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
-
-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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
-    Py_ssize_t ignore;
-    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
-            }
-        }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-        return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
-    } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
-#if !CYTHON_COMPILING_IN_PYPY
-#if PY_VERSION_HEX >= 0x02060000
-    if (PyByteArray_Check(o)) {
-        *length = PyByteArray_GET_SIZE(o);
-        return PyByteArray_AS_STRING(o);
-    } else
-#endif
-#endif
-    {
-        char* result;
-        int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (unlikely(r < 0)) {
-            return NULL;
-        } else {
-            return result;
-        }
-    }
-}
-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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
-    if (!PyLong_Check(res)) {
-#endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (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;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
-  Py_ssize_t ival;
-  PyObject *x;
-#if PY_MAJOR_VERSION < 3
-  if (likely(PyInt_CheckExact(b)))
-      return PyInt_AS_LONG(b);
-#endif
-  if (likely(PyLong_CheckExact(b))) {
-    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-     #if CYTHON_USE_PYLONG_INTERNALS
-       switch (Py_SIZE(b)) {
-       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
-       case  0: return 0;
-       case  1: return ((PyLongObject*)b)->ob_digit[0];
-       }
-     #endif
-    #endif
-  #if PY_VERSION_HEX < 0x02060000
-    return PyInt_AsSsize_t(b);
-  #else
-    return PyLong_AsSsize_t(b);
-  #endif
-  }
-  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
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/pysam/csamfile.c b/pysam/csamfile.c
deleted file mode 100644
index c3e3252..0000000
--- a/pysam/csamfile.c
+++ /dev/null
@@ -1,2876 +0,0 @@
-/* Generated by Cython 0.20.1 on Fri Nov 21 19:49:04 2014 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#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
-#define CYTHON_ABI "0_20_1"
-#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 Py_OptimizeFlag 0
-#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 CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #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"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-  #define __Pyx_DefaultClassType PyClass_Type
-#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)
-  #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #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 < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
-  #define Py_TPFLAGS_IS_ABSTRACT 0
-#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
-  #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
-  #define CYTHON_PEP393_ENABLED 1
-  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
-                                              0 : _PyUnicode_Ready((PyObject *)(op)))
-  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
-  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
-  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
-  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
-  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
-#else
-  #define CYTHON_PEP393_ENABLED 0
-  #define __Pyx_PyUnicode_READY(op)       (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]))
-  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
-  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
-  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
-#else
-  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
-      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
-#else
-  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
-#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_MAJOR_VERSION >= 3
-  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
-  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#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
-  #define PyNumber_Int                 PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyBoolObject                 PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x030200A4
-  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
-#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
-#ifndef CYTHON_RESTRICT
-  #if defined(__GNUC__)
-    #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER) && _MSC_VER >= 1400
-    #define CYTHON_RESTRICT __restrict
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_RESTRICT restrict
-  #else
-    #define CYTHON_RESTRICT
-  #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
-  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
-   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
-   a quiet NaN. */
-  float value;
-  memset(&value, 0xFF, sizeof(value));
-  return value;
-}
-#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__pysam__csamfile
-#define __PYX_HAVE_API__pysam__csamfile
-#include "stdint.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
-#include "zlib.h"
-#include "htslib/kstring.h"
-#include "htslib/hfile.h"
-#include "htslib/bgzf.h"
-#include "htslib/hts.h"
-#include "htslib/sam.h"
-#include "pysam_stream.h"
-#include "htslib/faidx.h"
-#include "htslib/tbx.h"
-#include "htslib_util.h"
-#include "samfile_util.h"
-#include "pythread.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#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 Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
-    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
-    (sizeof(type) > sizeof(Py_ssize_t) &&               \
-          likely(v < (type)PY_SSIZE_T_MAX ||            \
-                 v == (type)PY_SSIZE_T_MAX)  &&         \
-          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
-                                v == (type)PY_SSIZE_T_MIN)))  ||  \
-    (sizeof(type) == sizeof(Py_ssize_t) &&              \
-          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
-                               v == (type)PY_SSIZE_T_MAX)))  )
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString        PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
-    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
-    const Py_UNICODE *u_end = u;
-    while (*u_end++) ;
-    return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
-#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);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    PyObject* ascii_chars_u = NULL;
-    PyObject* ascii_chars_b = NULL;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
-        __Pyx_sys_getdefaultencoding_not_ascii = 0;
-    } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
-        char ascii_chars[128];
-        int c;
-        for (c = 0; c < 128; c++) {
-            ascii_chars[c] = c;
-        }
-        __Pyx_sys_getdefaultencoding_not_ascii = 1;
-        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
-        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
-            PyErr_Format(
-                PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
-                default_encoding_c);
-            goto bad;
-        }
-    }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    char* default_encoding_c;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
-    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
-    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
-    Py_DECREF(default_encoding);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    return -1;
-}
-#endif
-#endif
-
-
-#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_d;
-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[] = {
-  "csamfile.pyx",
-  "cfaidx.pxd",
-  "calignmentfile.pxd",
-  "type.pxd",
-  "bool.pxd",
-  "complex.pxd",
-};
-
-/*--- Type declarations ---*/
-struct __pyx_obj_5pysam_6cfaidx_FastaFile;
-struct __pyx_obj_5pysam_6cfaidx_FastqProxy;
-struct __pyx_obj_5pysam_6cfaidx_FastqFile;
-struct __pyx_obj_5pysam_6cfaidx_Fastafile;
-struct __pyx_obj_5pysam_6cfaidx_Fastqfile;
-struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment;
-struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile;
-struct __pyx_obj_5pysam_14calignmentfile_PileupColumn;
-struct __pyx_obj_5pysam_14calignmentfile_PileupRead;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRow;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion;
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs;
-struct __pyx_obj_5pysam_14calignmentfile_IndexedReads;
-struct __pyx_obj_5pysam_8csamfile_AlignedRead;
-struct __pyx_obj_5pysam_8csamfile_Samfile;
-struct __pyx_t_5pysam_14calignmentfile___iterdata;
-typedef struct __pyx_t_5pysam_14calignmentfile___iterdata __pyx_t_5pysam_14calignmentfile___iterdata;
-struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag;
-struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData;
-
-/* "calignmentfile.pxd":53
- * # Utility types
- * 
- * ctypedef struct __iterdata:             # <<<<<<<<<<<<<<
- *     htsFile * htsfile
- *     bam_hdr_t * header
- */
-struct __pyx_t_5pysam_14calignmentfile___iterdata {
-  htsFile *htsfile;
-  bam_hdr_t *header;
-  hts_itr_t *iter;
-  faidx_t *fastafile;
-  int tid;
-  char *seq;
-  int seq_len;
-};
-
-/* "calignmentfile.pxd":72
- *     # add an alignment tag with value to the AlignedSegment
- *     # an existing tag of the same name will be replaced.
- *     cpdef setTag( self, tag, value, value_type = ?, replace = ? )             # <<<<<<<<<<<<<<
- * 
- * cdef class AlignmentFile:
- */
-struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag {
-  int __pyx_n;
-  PyObject *value_type;
-  PyObject *replace;
-};
-
-/* "calignmentfile.pxd":179
- *     cdef char * getSequence( self )
- *     cdef setMask(self, mask)
- *     cdef setupIteratorData(self,             # <<<<<<<<<<<<<<
- *                            int tid,
- *                            int start,
- */
-struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData {
-  int __pyx_n;
-  int multiple_iterators;
-};
-
-/* "cfaidx.pxd":14
- *         char *s
- * 
- * cdef class FastaFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename, _references, _lengths, reference2length
- *     cdef faidx_t* fastafile
- */
-struct __pyx_obj_5pysam_6cfaidx_FastaFile {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile *__pyx_vtab;
-  PyObject *_filename;
-  PyObject *_references;
-  PyObject *_lengths;
-  PyObject *reference2length;
-  faidx_t *fastafile;
-};
-
-
-/* "cfaidx.pxd":21
- * 
- * 
- * cdef class FastqProxy:             # <<<<<<<<<<<<<<
- *     cdef kseq_t * _delegate
- * 
- */
-struct __pyx_obj_5pysam_6cfaidx_FastqProxy {
-  PyObject_HEAD
-  kseq_t *_delegate;
-};
-
-
-/* "cfaidx.pxd":25
- * 
- * 
- * cdef class FastqFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename
- *     cdef gzFile fastqfile
- */
-struct __pyx_obj_5pysam_6cfaidx_FastqFile {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile *__pyx_vtab;
-  PyObject *_filename;
-  gzFile fastqfile;
-  kseq_t *entry;
-};
-
-
-/* "cfaidx.pxd":35
- * 
- * # Compatibility Layer for pysam < 0.8
- * cdef class Fastafile(FastaFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6cfaidx_Fastafile {
-  struct __pyx_obj_5pysam_6cfaidx_FastaFile __pyx_base;
-};
-
-
-/* "cfaidx.pxd":38
- *     pass
- * 
- * cdef class Fastqfile(FastqFile):             # <<<<<<<<<<<<<<
- *     pass
- */
-struct __pyx_obj_5pysam_6cfaidx_Fastqfile {
-  struct __pyx_obj_5pysam_6cfaidx_FastqFile __pyx_base;
-};
-
-
-/* "calignmentfile.pxd":65
- * #
- * # Note: need to declare all C fields and methods here
- * cdef class AlignedSegment:             # <<<<<<<<<<<<<<
- * 
- *     # object that this AlignedSegment represents
- */
-struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment *__pyx_vtab;
-  bam1_t *_delegate;
-};
-
-
-/* "calignmentfile.pxd":74
- *     cpdef setTag( self, tag, value, value_type = ?, replace = ? )
- * 
- * cdef class AlignmentFile:             # <<<<<<<<<<<<<<
- * 
- *     cdef object _filename
- */
-struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *__pyx_vtab;
-  PyObject *_filename;
-  htsFile *htsfile;
-  BGZF *fp;
-  hts_idx_t *index;
-  bam_hdr_t *header;
-  int isbam;
-  int isstream;
-  int isremote;
-  bam1_t *b;
-  char *mode;
-  int64_t start_offset;
-};
-
-
-/* "calignmentfile.pxd":111
- *     cdef char * _getrname(self, int tid)
- * 
- * cdef class PileupColumn:             # <<<<<<<<<<<<<<
- *     cdef bam_pileup1_t ** plp
- *     cdef int tid
- */
-struct __pyx_obj_5pysam_14calignmentfile_PileupColumn {
-  PyObject_HEAD
-  bam_pileup1_t **plp;
-  int tid;
-  int pos;
-  int n_pu;
-};
-
-
-/* "calignmentfile.pxd":117
- *     cdef int n_pu
- * 
- * cdef class PileupRead:             # <<<<<<<<<<<<<<
- *     cdef AlignedSegment _alignment
- *     cdef int32_t  _qpos
- */
-struct __pyx_obj_5pysam_14calignmentfile_PileupRead {
-  PyObject_HEAD
-  struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *_alignment;
-  int32_t _qpos;
-  int _indel;
-  int _level;
-  uint32_t _is_del;
-  uint32_t _is_head;
-  uint32_t _is_tail;
-};
-
-
-/* "calignmentfile.pxd":126
- *     cdef uint32_t _is_tail
- * 
- * cdef class IteratorRow:             # <<<<<<<<<<<<<<
- *     cdef int retval
- *     cdef bam1_t * b
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRow {
-  PyObject_HEAD
-  int retval;
-  bam1_t *b;
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
-  htsFile *htsfile;
-  bam_hdr_t *header;
-  int owns_samfile;
-};
-
-
-/* "calignmentfile.pxd":134
- *     cdef int owns_samfile
- * 
- * cdef class IteratorRowRegion(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef hts_itr_t * iter
- *     cdef bam1_t * getCurrent( self )
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion *__pyx_vtab;
-  hts_itr_t *iter;
-};
-
-
-/* "calignmentfile.pxd":139
- *     cdef int cnext(self)
- * 
- * cdef class IteratorRowHead(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef int max_rows
- *     cdef int current_row
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead *__pyx_vtab;
-  int max_rows;
-  int current_row;
-};
-
-
-/* "calignmentfile.pxd":145
- *     cdef int cnext(self)
- * 
- * cdef class IteratorRowAll(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef bam1_t * getCurrent( self )
- *     cdef int cnext(self)
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll *__pyx_vtab;
-};
-
-
-/* "calignmentfile.pxd":149
- *     cdef int cnext(self)
- * 
- * cdef class IteratorRowAllRefs(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef int         tid
- *     cdef IteratorRowRegion rowiter
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  int tid;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *rowiter;
-};
-
-
-/* "calignmentfile.pxd":153
- *     cdef IteratorRowRegion rowiter
- * 
- * cdef class IteratorRowSelection(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef int current_pos
- *     cdef positions
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection *__pyx_vtab;
-  int current_pos;
-  PyObject *positions;
-  BGZF *fp;
-};
-
-
-/* "calignmentfile.pxd":160
- *     cdef BGZF * fp
- * 
- * cdef class IteratorColumn:             # <<<<<<<<<<<<<<
- * 
- *     # result of the last plbuf_push
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn *__pyx_vtab;
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *iter;
-  int tid;
-  int pos;
-  int n_plp;
-  int mask;
-  bam_pileup1_t *plp;
-  bam_plp_t pileup_iter;
-  __pyx_t_5pysam_14calignmentfile___iterdata iterdata;
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
-  struct __pyx_obj_5pysam_6cfaidx_Fastafile *fastafile;
-  PyObject *stepper;
-  int max_depth;
-};
-
-
-/* "calignmentfile.pxd":188
- *     cdef _free_pileup_iter(self)
- * 
- * cdef class IteratorColumnRegion(IteratorColumn):             # <<<<<<<<<<<<<<
- *     cdef int start
- *     cdef int end
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn __pyx_base;
-  int start;
-  int end;
-  int truncate;
-};
-
-
-/* "calignmentfile.pxd":193
- *     cdef int truncate
- * 
- * cdef class IteratorColumnAllRefs(IteratorColumn):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs {
-  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn __pyx_base;
-};
-
-
-/* "calignmentfile.pxd":196
- *     pass
- * 
- * cdef class IndexedReads:             # <<<<<<<<<<<<<<
- *     cdef AlignmentFile samfile
- *     cdef htsFile * htsfile
- */
-struct __pyx_obj_5pysam_14calignmentfile_IndexedReads {
-  PyObject_HEAD
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
-  htsFile *htsfile;
-  PyObject *index;
-  int owns_samfile;
-  BGZF *fp;
-  bam_hdr_t *header;
-};
-
-
-/* "pysam/csamfile.pxd":9
- * from chtslib cimport *
- * 
- * cdef class AlignedRead(AlignedSegment):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_8csamfile_AlignedRead {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment __pyx_base;
-};
-
-
-/* "pysam/csamfile.pxd":12
- *     pass
- * 
- * cdef class Samfile(AlignmentFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_8csamfile_Samfile {
-  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile __pyx_base;
-};
-
-
-
-/* "cfaidx.pxd":14
- *         char *s
- * 
- * cdef class FastaFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename, _references, _lengths, reference2length
- *     cdef faidx_t* fastafile
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile {
-  char *(*_fetch)(struct __pyx_obj_5pysam_6cfaidx_FastaFile *, char *, int, int, int *);
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile *__pyx_vtabptr_5pysam_6cfaidx_FastaFile;
-
-
-/* "cfaidx.pxd":25
- * 
- * 
- * cdef class FastqFile:             # <<<<<<<<<<<<<<
- *     cdef object _filename
- *     cdef gzFile fastqfile
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile {
-  kseq_t *(*getCurrent)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *);
-  int (*cnext)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *);
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile *__pyx_vtabptr_5pysam_6cfaidx_FastqFile;
-
-
-/* "cfaidx.pxd":35
- * 
- * # Compatibility Layer for pysam < 0.8
- * cdef class Fastafile(FastaFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile {
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile *__pyx_vtabptr_5pysam_6cfaidx_Fastafile;
-
-
-/* "cfaidx.pxd":38
- *     pass
- * 
- * cdef class Fastqfile(FastqFile):             # <<<<<<<<<<<<<<
- *     pass
- */
-
-struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile {
-  struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile *__pyx_vtabptr_5pysam_6cfaidx_Fastqfile;
-
-
-/* "calignmentfile.pxd":65
- * #
- * # Note: need to declare all C fields and methods here
- * cdef class AlignedSegment:             # <<<<<<<<<<<<<<
- * 
- *     # object that this AlignedSegment represents
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment {
-  PyObject *(*setTag)(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag *__pyx_optional_args);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment *__pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment;
-
-
-/* "calignmentfile.pxd":74
- *     cpdef setTag( self, tag, value, value_type = ?, replace = ? )
- * 
- * cdef class AlignmentFile:             # <<<<<<<<<<<<<<
- * 
- *     cdef object _filename
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile {
-  bam_hdr_t *(*_buildHeader)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, PyObject *);
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *);
-  int (*write)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *, int __pyx_skip_dispatch);
-  char *(*_getrname)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, int);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *__pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile;
-
-
-/* "calignmentfile.pxd":134
- *     cdef int owns_samfile
- * 
- * cdef class IteratorRowRegion(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef hts_itr_t * iter
- *     cdef bam1_t * getCurrent( self )
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion {
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion;
-
-
-/* "calignmentfile.pxd":139
- *     cdef int cnext(self)
- * 
- * cdef class IteratorRowHead(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef int max_rows
- *     cdef int current_row
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead {
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead;
-
-
-/* "calignmentfile.pxd":145
- *     cdef int cnext(self)
- * 
- * cdef class IteratorRowAll(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef bam1_t * getCurrent( self )
- *     cdef int cnext(self)
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll {
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll;
-
-
-/* "calignmentfile.pxd":153
- *     cdef IteratorRowRegion rowiter
- * 
- * cdef class IteratorRowSelection(IteratorRow):             # <<<<<<<<<<<<<<
- *     cdef int current_pos
- *     cdef positions
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection {
-  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *);
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection;
-
-
-/* "calignmentfile.pxd":160
- *     cdef BGZF * fp
- * 
- * cdef class IteratorColumn:             # <<<<<<<<<<<<<<
- * 
- *     # result of the last plbuf_push
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn {
-  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
-  char *(*getSequence)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
-  PyObject *(*setMask)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, PyObject *);
-  PyObject *(*setupIteratorData)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, int, int, int, struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData *__pyx_optional_args);
-  PyObject *(*reset)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, PyObject *, PyObject *, PyObject *);
-  PyObject *(*_free_pileup_iter)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn;
-
-
-/* "calignmentfile.pxd":188
- *     cdef _free_pileup_iter(self)
- * 
- * cdef class IteratorColumnRegion(IteratorColumn):             # <<<<<<<<<<<<<<
- *     cdef int start
- *     cdef int end
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion {
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion;
-
-
-/* "calignmentfile.pxd":193
- *     cdef int truncate
- * 
- * cdef class IteratorColumnAllRefs(IteratorColumn):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs {
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs;
-
-
-/* "pysam/csamfile.pyx":33
- * 
- * 
- * cdef class AlignedRead(AlignedSegment):             # <<<<<<<<<<<<<<
- *     '''Deprecated alternative for :class:`~pysam.AlignedSegment`
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_8csamfile_AlignedRead {
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_8csamfile_AlignedRead *__pyx_vtabptr_5pysam_8csamfile_AlignedRead;
-
-
-/* "pysam/csamfile.pyx":25
- * 
- * 
- * cdef class Samfile(AlignmentFile):             # <<<<<<<<<<<<<<
- *     '''Deprecated alternative for :class:`~pysam.AlignmentFile`
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_8csamfile_Samfile {
-  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_8csamfile_Samfile *__pyx_vtabptr_5pysam_8csamfile_Samfile;
-#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_XDECREF_SET(r, v) do {                            \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_XDECREF(tmp);                              \
-    } while (0)
-#define __Pyx_DECREF_SET(r, v) do {                             \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_DECREF(tmp);                               \
-    } while (0)
-#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 void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
-
-static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
-
-static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
-
-static void* __Pyx_GetVtable(PyObject *dict); /*proto*/
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_getattro))
-        return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_getattr))
-        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
-    return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static int __Pyx_check_binary_version(void);
-
-#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 PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*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 'libc.stdint' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdlib' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'pysam.chtslib' */
-
-/* Module declarations from 'pysam.cfaidx' */
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastaFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastqProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastqFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_Fastafile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_Fastqfile = 0;
-
-/* Module declarations from 'pysam.calignmentfile' */
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_AlignedSegment = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_AlignmentFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_PileupColumn = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_PileupRead = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRow = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowHead = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumn = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs = 0;
-static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IndexedReads = 0;
-
-/* Module declarations from 'cpython.version' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'cpython.exc' */
-
-/* Module declarations from 'cpython.module' */
-
-/* Module declarations from 'cpython.mem' */
-
-/* Module declarations from 'cpython.tuple' */
-
-/* Module declarations from 'cpython.list' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from 'cpython.sequence' */
-
-/* Module declarations from 'cpython.mapping' */
-
-/* Module declarations from 'cpython.iterator' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'cpython.number' */
-
-/* Module declarations from 'cpython.int' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.bool' */
-static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
-
-/* Module declarations from 'cpython.long' */
-
-/* Module declarations from 'cpython.float' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.complex' */
-static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
-
-/* Module declarations from 'cpython.string' */
-
-/* Module declarations from 'cpython.unicode' */
-
-/* Module declarations from 'cpython.dict' */
-
-/* Module declarations from 'cpython.instance' */
-
-/* Module declarations from 'cpython.function' */
-
-/* Module declarations from 'cpython.method' */
-
-/* Module declarations from 'cpython.weakref' */
-
-/* Module declarations from 'cpython.getargs' */
-
-/* Module declarations from 'cpython.pythread' */
-
-/* Module declarations from 'cpython.pystate' */
-
-/* Module declarations from 'cpython.cobject' */
-
-/* Module declarations from 'cpython.oldbuffer' */
-
-/* Module declarations from 'cpython.set' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.bytes' */
-
-/* Module declarations from 'cpython.pycapsule' */
-
-/* Module declarations from 'cpython' */
-
-/* Module declarations from 'pysam.csamfile' */
-static PyTypeObject *__pyx_ptype_5pysam_8csamfile_AlignedRead = 0;
-static PyTypeObject *__pyx_ptype_5pysam_8csamfile_Samfile = 0;
-#define __Pyx_MODULE_NAME "pysam.csamfile"
-int __pyx_module_is_main_pysam__csamfile = 0;
-
-/* Implementation of 'pysam.csamfile' */
-static PyObject *__pyx_tp_new_5pysam_8csamfile_AlignedRead(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_8csamfile_Samfile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_os[] = "os";
-static char __pyx_k_re[] = "re";
-static char __pyx_k_all[] = "__all__";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_types[] = "types";
-static char __pyx_k_ctypes[] = "ctypes";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_struct[] = "struct";
-static char __pyx_k_Samfile[] = "Samfile";
-static char __pyx_k_platform[] = "platform";
-static char __pyx_k_tempfile[] = "tempfile";
-static char __pyx_k_warnings[] = "warnings";
-static char __pyx_k_itertools[] = "itertools";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_AlignedRead[] = "AlignedRead";
-static char __pyx_k_collections[] = "collections";
-static PyObject *__pyx_n_s_AlignedRead;
-static PyObject *__pyx_n_s_Samfile;
-static PyObject *__pyx_n_s_all;
-static PyObject *__pyx_n_s_collections;
-static PyObject *__pyx_n_s_ctypes;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_n_s_itertools;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_n_s_os;
-static PyObject *__pyx_n_s_platform;
-static PyObject *__pyx_n_s_pyx_vtable;
-static PyObject *__pyx_n_s_re;
-static PyObject *__pyx_n_s_struct;
-static PyObject *__pyx_n_s_sys;
-static PyObject *__pyx_n_s_tempfile;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_n_s_types;
-static PyObject *__pyx_n_s_warnings;
-static struct __pyx_vtabstruct_5pysam_8csamfile_AlignedRead __pyx_vtable_5pysam_8csamfile_AlignedRead;
-
-static PyObject *__pyx_tp_new_5pysam_8csamfile_AlignedRead(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_8csamfile_AlignedRead *p;
-  PyObject *o = __pyx_ptype_5pysam_14calignmentfile_AlignedSegment->tp_new(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_8csamfile_AlignedRead *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment*)__pyx_vtabptr_5pysam_8csamfile_AlignedRead;
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_8csamfile_AlignedRead(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  if (likely(__pyx_ptype_5pysam_14calignmentfile_AlignedSegment)) __pyx_ptype_5pysam_14calignmentfile_AlignedSegment->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5pysam_8csamfile_AlignedRead);
-}
-
-static PyTypeObject __pyx_type_5pysam_8csamfile_AlignedRead = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.csamfile.AlignedRead"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_8csamfile_AlignedRead), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_8csamfile_AlignedRead, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
-  __Pyx_DOCSTR("Deprecated alternative for :class:`~pysam.AlignedSegment`\n\n    Added for backwards compatibility with pysam <= 0.8.0\n    "), /*tp_doc*/
-  0, /*tp_traverse*/
-  0, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_8csamfile_AlignedRead, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_8csamfile_Samfile __pyx_vtable_5pysam_8csamfile_Samfile;
-
-static PyObject *__pyx_tp_new_5pysam_8csamfile_Samfile(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_8csamfile_Samfile *p;
-  PyObject *o = __pyx_ptype_5pysam_14calignmentfile_AlignmentFile->tp_new(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_8csamfile_Samfile *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile*)__pyx_vtabptr_5pysam_8csamfile_Samfile;
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_8csamfile_Samfile(PyObject *o) {
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  PyObject_GC_Track(o);
-  if (likely(__pyx_ptype_5pysam_14calignmentfile_AlignmentFile)) __pyx_ptype_5pysam_14calignmentfile_AlignmentFile->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5pysam_8csamfile_Samfile);
-}
-
-static int __pyx_tp_traverse_5pysam_8csamfile_Samfile(PyObject *o, visitproc v, void *a) {
-  int e;
-  e = ((likely(__pyx_ptype_5pysam_14calignmentfile_AlignmentFile)) ? ((__pyx_ptype_5pysam_14calignmentfile_AlignmentFile->tp_traverse) ? __pyx_ptype_5pysam_14calignmentfile_AlignmentFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_8csamfile_Samfile)); if (e) return e;
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_8csamfile_Samfile(PyObject *o) {
-  if (likely(__pyx_ptype_5pysam_14calignmentfile_AlignmentFile)) { if (__pyx_ptype_5pysam_14calignmentfile_AlignmentFile->tp_clear) __pyx_ptype_5pysam_14calignmentfile_AlignmentFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_8csamfile_Samfile);
-  return 0;
-}
-
-static PyTypeObject __pyx_type_5pysam_8csamfile_Samfile = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.csamfile.Samfile"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_8csamfile_Samfile), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_8csamfile_Samfile, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("Deprecated alternative for :class:`~pysam.AlignmentFile`\n\n    Added for backwards compatibility with pysam <= 0.8.0\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_8csamfile_Samfile, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_8csamfile_Samfile, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_8csamfile_Samfile, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
-  {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
-    PyModuleDef_HEAD_INIT,
-  #endif
-    __Pyx_NAMESTR("csamfile"),
-    0, /* m_doc */
-    -1, /* m_size */
-    __pyx_methods /* m_methods */,
-    NULL, /* m_reload */
-    NULL, /* m_traverse */
-    NULL, /* m_clear */
-    NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_n_s_AlignedRead, __pyx_k_AlignedRead, sizeof(__pyx_k_AlignedRead), 0, 0, 1, 1},
-  {&__pyx_n_s_Samfile, __pyx_k_Samfile, sizeof(__pyx_k_Samfile), 0, 0, 1, 1},
-  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
-  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
-  {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
-  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
-  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
-  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
-  {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
-  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
-  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
-  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
-  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
-  {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
-  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
-  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
-  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
-  {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
-  return 0;
-}
-
-static int __Pyx_InitCachedConstants(void) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
-  __Pyx_RefNannyFinishContext();
-  return 0;
-}
-
-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;};
-  return 0;
-  __pyx_L1_error:;
-  return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC initcsamfile(void); /*proto*/
-PyMODINIT_FUNC initcsamfile(void)
-#else
-PyMODINIT_FUNC PyInit_csamfile(void); /*proto*/
-PyMODINIT_FUNC PyInit_csamfile(void)
-#endif
-{
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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_csamfile(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("csamfile"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
-  #else
-  __pyx_m = PyModule_Create(&__pyx_moduledef);
-  #endif
-  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_d);
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  if (__pyx_module_is_main_pysam__csamfile) {
-    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;};
-  }
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pysam.csamfile")) {
-      if (unlikely(PyDict_SetItemString(modules, "pysam.csamfile", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  /*--- Builtin init code ---*/
-  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Constants init code ---*/
-  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Global init code ---*/
-  /*--- Variable export code ---*/
-  /*--- Function export code ---*/
-  /*--- Type init code ---*/
-  __pyx_ptype_5pysam_14calignmentfile_AlignedSegment = __Pyx_ImportType("pysam.calignmentfile", "AlignedSegment", sizeof(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_AlignedSegment)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment = (struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_AlignedSegment->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_8csamfile_AlignedRead = &__pyx_vtable_5pysam_8csamfile_AlignedRead;
-  __pyx_vtable_5pysam_8csamfile_AlignedRead.__pyx_base = *__pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment;
-  __pyx_type_5pysam_8csamfile_AlignedRead.tp_base = __pyx_ptype_5pysam_14calignmentfile_AlignedSegment;
-  if (PyType_Ready(&__pyx_type_5pysam_8csamfile_AlignedRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_8csamfile_AlignedRead.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_8csamfile_AlignedRead.tp_dict, __pyx_vtabptr_5pysam_8csamfile_AlignedRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "AlignedRead", (PyObject *)&__pyx_type_5pysam_8csamfile_AlignedRead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_8csamfile_AlignedRead = &__pyx_type_5pysam_8csamfile_AlignedRead;
-  __pyx_ptype_5pysam_14calignmentfile_AlignmentFile = __Pyx_ImportType("pysam.calignmentfile", "AlignmentFile", sizeof(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_AlignmentFile)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile = (struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_AlignmentFile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_8csamfile_Samfile = &__pyx_vtable_5pysam_8csamfile_Samfile;
-  __pyx_vtable_5pysam_8csamfile_Samfile.__pyx_base = *__pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile;
-  __pyx_type_5pysam_8csamfile_Samfile.tp_base = __pyx_ptype_5pysam_14calignmentfile_AlignmentFile;
-  if (PyType_Ready(&__pyx_type_5pysam_8csamfile_Samfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_8csamfile_Samfile.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_8csamfile_Samfile.tp_dict, __pyx_vtabptr_5pysam_8csamfile_Samfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "Samfile", (PyObject *)&__pyx_type_5pysam_8csamfile_Samfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_8csamfile_Samfile = &__pyx_type_5pysam_8csamfile_Samfile;
-  /*--- Type import code ---*/
-  __pyx_ptype_5pysam_6cfaidx_FastaFile = __Pyx_ImportType("pysam.cfaidx", "FastaFile", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastaFile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastaFile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6cfaidx_FastaFile = (struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_FastaFile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_FastaFile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_FastqProxy = __Pyx_ImportType("pysam.cfaidx", "FastqProxy", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastqProxy), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastqProxy)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_FastqFile = __Pyx_ImportType("pysam.cfaidx", "FastqFile", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastqFile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastqFile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6cfaidx_FastqFile = (struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_FastqFile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_FastqFile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_Fastafile = __Pyx_ImportType("pysam.cfaidx", "Fastafile", sizeof(struct __pyx_obj_5pysam_6cfaidx_Fastafile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_Fastafile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6cfaidx_Fastafile = (struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_Fastafile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_Fastafile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6cfaidx_Fastqfile = __Pyx_ImportType("pysam.cfaidx", "Fastqfile", sizeof(struct __pyx_obj_5pysam_6cfaidx_Fastqfile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_Fastqfile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6cfaidx_Fastqfile = (struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_Fastqfile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_Fastqfile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_PileupColumn = __Pyx_ImportType("pysam.calignmentfile", "PileupColumn", sizeof(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_PileupColumn)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_PileupRead = __Pyx_ImportType("pysam.calignmentfile", "PileupRead", sizeof(struct __pyx_obj_5pysam_14calignmentfile_PileupRead), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_PileupRead)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRow = __Pyx_ImportType("pysam.calignmentfile", "IteratorRow", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRow), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRow)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowRegion", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowHead = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowHead", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowHead)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorRowHead->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowAll = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowAll", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowAllRefs", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowSelection", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorColumn = __Pyx_ImportType("pysam.calignmentfile", "IteratorColumn", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorColumn)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorColumn->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion = __Pyx_ImportType("pysam.calignmentfile", "IteratorColumnRegion", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs = __Pyx_ImportType("pysam.calignmentfile", "IteratorColumnAllRefs", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_14calignmentfile_IndexedReads = __Pyx_ImportType("pysam.calignmentfile", "IndexedReads", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IndexedReads)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
-  #if CYTHON_COMPILING_IN_PYPY
-  sizeof(PyTypeObject),
-  #else
-  sizeof(PyHeapTypeObject),
-  #endif
-  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Variable import code ---*/
-  /*--- Function import code ---*/
-  /*--- Execution code ---*/
-
-  /* "pysam/csamfile.pyx":4
- * # cython: profile=True
- * # adds doc-strings for sphinx
- * import tempfile             # <<<<<<<<<<<<<<
- * import os
- * import sys
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":5
- * # adds doc-strings for sphinx
- * import tempfile
- * import os             # <<<<<<<<<<<<<<
- * import sys
- * import types
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":6
- * import tempfile
- * import os
- * import sys             # <<<<<<<<<<<<<<
- * import types
- * import itertools
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":7
- * import os
- * import sys
- * import types             # <<<<<<<<<<<<<<
- * import itertools
- * import struct
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_types, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":8
- * import sys
- * import types
- * import itertools             # <<<<<<<<<<<<<<
- * import struct
- * import ctypes
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":9
- * import types
- * import itertools
- * import struct             # <<<<<<<<<<<<<<
- * import ctypes
- * import collections
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":10
- * import itertools
- * import struct
- * import ctypes             # <<<<<<<<<<<<<<
- * import collections
- * import re
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":11
- * import struct
- * import ctypes
- * import collections             # <<<<<<<<<<<<<<
- * import re
- * import platform
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":12
- * import ctypes
- * import collections
- * import re             # <<<<<<<<<<<<<<
- * import platform
- * import warnings
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":13
- * import collections
- * import re
- * import platform             # <<<<<<<<<<<<<<
- * import warnings
- * from cpython cimport PyErr_SetString, \
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_platform, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":14
- * import re
- * import platform
- * import warnings             # <<<<<<<<<<<<<<
- * from cpython cimport PyErr_SetString, \
- *     PyBytes_Check, \
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":41
- * 
- * 
- * __all__ = ['Samfile', 'AlignedRead']             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_n_s_Samfile);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Samfile);
-  __Pyx_GIVEREF(__pyx_n_s_Samfile);
-  __Pyx_INCREF(__pyx_n_s_AlignedRead);
-  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_AlignedRead);
-  __Pyx_GIVEREF(__pyx_n_s_AlignedRead);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamfile.pyx":1
- * # cython: embedsignature=True             # <<<<<<<<<<<<<<
- * # cython: profile=True
- * # adds doc-strings for sphinx
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  if (__pyx_m) {
-    __Pyx_AddTraceback("init pysam.csamfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
-    Py_DECREF(__pyx_m); __pyx_m = 0;
-  } else if (!PyErr_Occurred()) {
-    PyErr_SetString(PyExc_ImportError, "init pysam.csamfile");
-  }
-  __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 void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
-    PyTypeObject* type = Py_TYPE(obj);
-    while (type && type->tp_dealloc != current_tp_dealloc)
-        type = type->tp_base;
-    while (type && type->tp_dealloc == current_tp_dealloc)
-        type = type->tp_base;
-    if (type)
-        type->tp_dealloc(obj);
-}
-
-static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
-    PyTypeObject* type = Py_TYPE(obj);
-    while (type && type->tp_traverse != current_tp_traverse)
-        type = type->tp_base;
-    while (type && type->tp_traverse == current_tp_traverse)
-        type = type->tp_base;
-    if (type && type->tp_traverse)
-        return type->tp_traverse(obj, v, a);
-    return 0;
-}
-
-static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
-    PyTypeObject* type = Py_TYPE(obj);
-    while (type && type->tp_clear != current_tp_clear)
-        type = type->tp_base;
-    while (type && type->tp_clear == current_tp_clear)
-        type = type->tp_base;
-    if (type && type->tp_clear)
-        type->tp_clear(obj);
-}
-
-static void* __Pyx_GetVtable(PyObject *dict) {
-    void* ptr;
-    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_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;
-}
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
-    PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
-    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
-    if (!ob)
-        goto bad;
-    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
-        goto bad;
-    Py_DECREF(ob);
-    return 0;
-bad:
-    Py_XDECREF(ob);
-    return -1;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
-    PyObject *empty_list = 0;
-    PyObject *module = 0;
-    PyObject *global_dict = 0;
-    PyObject *empty_dict = 0;
-    PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
-    PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
-    if (!py_import)
-        goto bad;
-    #endif
-    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, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                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);
-                #else
-                module = PyImport_ImportModuleLevelObject(
-                    name, global_dict, empty_dict, list, 1);
-                #endif
-                if (!module) {
-                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
-                        goto bad;
-                    PyErr_Clear();
-                }
-            }
-            level = 0; /* try absolute import on failure */
-        }
-        #endif
-        if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
-            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
-            module = PyImport_ImportModuleLevelObject(
-                name, global_dict, empty_dict, list, level);
-            #endif
-        }
-    }
-    #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:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(long) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(long) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(long),
-                                     little, !is_unsigned);
-    }
-}
-
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
-    {                                                                     \
-        func_type value = func(x);                                        \
-        if (sizeof(target_type) < sizeof(func_type)) {                    \
-            if (unlikely(value != (func_type) (target_type) value)) {     \
-                func_type zero = 0;                                       \
-                PyErr_SetString(PyExc_OverflowError,                      \
-                    (is_unsigned && unlikely(value < zero)) ?             \
-                    "can't convert negative value to " #target_type :     \
-                    "value too large to convert to " #target_type);       \
-                return (target_type) -1;                                  \
-            }                                                             \
-        }                                                                 \
-        return (target_type) value;                                       \
-    }
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(long) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long) -1;
-            }
-            if (sizeof(long) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(long) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(long) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
-            } else if (sizeof(long) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            long val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (long) -1;
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long) -1;
-        val = __Pyx_PyInt_As_long(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            return (int) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            if (sizeof(int) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
-            } else if (sizeof(int) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int) -1;
-        }
-    } else {
-        int val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int) -1;
-        val = __Pyx_PyInt_As_int(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-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;
-}
-
-#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
-
-#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_ssize_t basicsize;
-#ifdef Py_LIMITED_API
-    PyObject *py_basicsize;
-#endif
-    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,
-            "%.200s.%.200s is not a type object",
-            module_name, class_name);
-        goto bad;
-    }
-#ifndef Py_LIMITED_API
-    basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
-    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
-    if (!py_basicsize)
-        goto bad;
-    basicsize = PyLong_AsSsize_t(py_basicsize);
-    Py_DECREF(py_basicsize);
-    py_basicsize = 0;
-    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
-        goto bad;
-#endif
-    if (!strict && (size_t)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)basicsize != size) {
-        PyErr_Format(PyExc_ValueError,
-            "%.200s.%.200s 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
-
-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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
-    Py_ssize_t ignore;
-    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
-            }
-        }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-        return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
-    } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
-#if !CYTHON_COMPILING_IN_PYPY
-#if PY_VERSION_HEX >= 0x02060000
-    if (PyByteArray_Check(o)) {
-        *length = PyByteArray_GET_SIZE(o);
-        return PyByteArray_AS_STRING(o);
-    } else
-#endif
-#endif
-    {
-        char* result;
-        int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (unlikely(r < 0)) {
-            return NULL;
-        } else {
-            return result;
-        }
-    }
-}
-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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
-    if (!PyLong_Check(res)) {
-#endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (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;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
-  Py_ssize_t ival;
-  PyObject *x;
-#if PY_MAJOR_VERSION < 3
-  if (likely(PyInt_CheckExact(b)))
-      return PyInt_AS_LONG(b);
-#endif
-  if (likely(PyLong_CheckExact(b))) {
-    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-     #if CYTHON_USE_PYLONG_INTERNALS
-       switch (Py_SIZE(b)) {
-       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
-       case  0: return 0;
-       case  1: return ((PyLongObject*)b)->ob_digit[0];
-       }
-     #endif
-    #endif
-  #if PY_VERSION_HEX < 0x02060000
-    return PyInt_AsSsize_t(b);
-  #else
-    return PyLong_AsSsize_t(b);
-  #endif
-  }
-  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
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/pysam/csamtools.c b/pysam/csamtools.c
deleted file mode 100644
index 1c49dc0..0000000
--- a/pysam/csamtools.c
+++ /dev/null
@@ -1,6962 +0,0 @@
-/* Generated by Cython 0.20.1 on Fri Nov 21 19:49:04 2014 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#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
-#define CYTHON_ABI "0_20_1"
-#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 Py_OptimizeFlag 0
-#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 CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #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"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-  #define __Pyx_DefaultClassType PyClass_Type
-#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)
-  #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #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 < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
-  #define Py_TPFLAGS_IS_ABSTRACT 0
-#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
-  #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
-  #define CYTHON_PEP393_ENABLED 1
-  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
-                                              0 : _PyUnicode_Ready((PyObject *)(op)))
-  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
-  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
-  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
-  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
-  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
-#else
-  #define CYTHON_PEP393_ENABLED 0
-  #define __Pyx_PyUnicode_READY(op)       (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]))
-  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
-  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
-  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
-#else
-  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
-      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
-#else
-  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
-#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_MAJOR_VERSION >= 3
-  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
-  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#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
-  #define PyNumber_Int                 PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyBoolObject                 PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x030200A4
-  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
-#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
-#ifndef CYTHON_RESTRICT
-  #if defined(__GNUC__)
-    #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER) && _MSC_VER >= 1400
-    #define CYTHON_RESTRICT __restrict
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_RESTRICT restrict
-  #else
-    #define CYTHON_RESTRICT
-  #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
-  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
-   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
-   a quiet NaN. */
-  float value;
-  memset(&value, 0xFF, sizeof(value));
-  return value;
-}
-#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__pysam__csamtools
-#define __PYX_HAVE_API__pysam__csamtools
-#include "string.h"
-#include "stdlib.h"
-#include "pysam_util.h"
-#include "sam.h"
-#include "stdio.h"
-#include "pythread.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#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 Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
-    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
-    (sizeof(type) > sizeof(Py_ssize_t) &&               \
-          likely(v < (type)PY_SSIZE_T_MAX ||            \
-                 v == (type)PY_SSIZE_T_MAX)  &&         \
-          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
-                                v == (type)PY_SSIZE_T_MIN)))  ||  \
-    (sizeof(type) == sizeof(Py_ssize_t) &&              \
-          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
-                               v == (type)PY_SSIZE_T_MAX)))  )
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString        PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
-    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
-    const Py_UNICODE *u_end = u;
-    while (*u_end++) ;
-    return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
-#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);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    PyObject* ascii_chars_u = NULL;
-    PyObject* ascii_chars_b = NULL;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
-        __Pyx_sys_getdefaultencoding_not_ascii = 0;
-    } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
-        char ascii_chars[128];
-        int c;
-        for (c = 0; c < 128; c++) {
-            ascii_chars[c] = c;
-        }
-        __Pyx_sys_getdefaultencoding_not_ascii = 1;
-        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
-        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
-            PyErr_Format(
-                PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
-                default_encoding_c);
-            goto bad;
-        }
-    }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    char* default_encoding_c;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
-    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
-    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
-    Py_DECREF(default_encoding);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    return -1;
-}
-#endif
-#endif
-
-
-#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_d;
-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[] = {
-  "csamtools.pyx",
-  "type.pxd",
-  "bool.pxd",
-  "complex.pxd",
-};
-
-/*--- Type declarations ---*/
-#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_XDECREF_SET(r, v) do {                            \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_XDECREF(tmp);                              \
-    } while (0)
-#define __Pyx_DECREF_SET(r, v) do {                             \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_DECREF(tmp);                               \
-    } while (0)
-#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)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_getattro))
-        return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_getattr))
-        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
-    return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-#ifndef CYTHON_PROFILE
-  #define CYTHON_PROFILE 1
-#endif
-#ifndef CYTHON_TRACE
-  #define CYTHON_TRACE 0
-#endif
-#if CYTHON_TRACE
-  #undef CYTHON_PROFILE_REUSE_FRAME
-#endif
-#ifndef CYTHON_PROFILE_REUSE_FRAME
-  #define CYTHON_PROFILE_REUSE_FRAME 0
-#endif
-#if CYTHON_PROFILE || CYTHON_TRACE
-  #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_CLEAR(__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 || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc)))) {      \
-      __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 || (CYTHON_TRACE && PyThreadState_GET()->c_tracefunc))) {  \
-      PyThreadState* tstate = PyThreadState_GET();                                         \
-      tstate->use_tracing = 0;                                                             \
-      PyObject *exc_info = __Pyx_GetExceptionTuple();                                      \
-      if (exc_info) {                                                                      \
-          if (CYTHON_TRACE && tstate->c_tracefunc)                                         \
-              tstate->c_tracefunc(                                                         \
-                  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);          \
-          tstate->c_profilefunc(                                                           \
-              tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);            \
-          Py_DECREF(exc_info);                                                             \
-      }                                                                                    \
-      tstate->use_tracing = 1;                                                             \
-  }
-  #define __Pyx_TraceReturn(result)                                                  \
-  if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing) {             \
-      PyThreadState* tstate = PyThreadState_GET();                                   \
-      tstate->use_tracing = 0;                                                        \
-      if (CYTHON_TRACE && tstate->c_tracefunc)                                       \
-          tstate->c_tracefunc(                                                       \
-              tstate->c_traceobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);  \
-      if (tstate->c_profilefunc)                                                     \
-          tstate->c_profilefunc(                                                     \
-              tstate->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result);  \
-      CYTHON_FRAME_DEL;                                                              \
-      tstate->use_tracing = 1;                                                       \
-  }
-  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 */
-#if CYTHON_TRACE
-  #define __Pyx_TraceLine(lineno)                                                          \
-  if (unlikely(__Pyx_use_tracing) && unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_tracefunc)) {    \
-      PyThreadState* tstate = PyThreadState_GET();                                         \
-      __pyx_frame->f_lineno = lineno;                                                     \
-      tstate->use_tracing = 0;                                                             \
-      tstate->c_tracefunc(tstate->c_traceobj, __pyx_frame, PyTrace_LINE, NULL);           \
-      tstate->use_tracing = 1;                                                             \
-  }
-#else
-  #define __Pyx_TraceLine(lineno)
-#endif
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
-#else
-#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
-#endif
-
-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 void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
-    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
-static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_setattro))
-        return tp->tp_setattro(obj, attr_name, value);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_setattr))
-        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
-#endif
-    return PyObject_SetAttr(obj, attr_name, value);
-}
-#else
-#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
-#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
-#endif
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
-    PyObject *method, *result = NULL;
-    if (unlikely(!args)) return NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto bad;
-    result = __Pyx_PyObject_Call(method, args, NULL);
-    Py_DECREF(method);
-bad:
-    Py_DECREF(args);
-    return result;
-}
-#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
-#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
-#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
-#define __Pyx_PyObject_CallMethod0(obj, name) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))
-
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/
-
-#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
-    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
-               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck);
-
-#define __Pyx_DelItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_DelItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound) : \
-    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
-               __Pyx_DelItem_Generic(o, to_py_func(i))))
-static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j);
-static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                               CYTHON_UNUSED int is_list, int wraparound);
-
-#include <string.h>
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
-#else
-#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
-#endif
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
-    int result = PySequence_Contains(seq, item);
-    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len)) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
-#endif
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-
-#if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000)
-static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
-    PyObject *res;
-    PyTypeObject *tp = Py_TYPE(obj);
-#if PY_MAJOR_VERSION < 3
-    if (unlikely(PyInstance_Check(obj)))
-        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
-#endif
-    res = _PyType_Lookup(tp, attr_name);
-    if (likely(res)) {
-        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
-        if (!f) {
-            Py_INCREF(res);
-        } else {
-            res = f(res, obj, (PyObject *)tp);
-        }
-    } else {
-        PyErr_SetObject(PyExc_AttributeError, attr_name);
-    }
-    return res;
-}
-#else
-#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
-#endif
-
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-
-#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;
-    PyObject *func_dict;
-    PyObject *func_weakreflist;
-    PyObject *func_name;
-    PyObject *func_qualname;
-    PyObject *func_doc;
-    PyObject *func_globals;
-    PyObject *func_code;
-    PyObject *func_closure;
-    PyObject *func_classobj; /* No-args super() class cell */
-    void *defaults;
-    int defaults_pyobjects;
-    int flags;
-    PyObject *defaults_tuple;   /* Const defaults tuple */
-    PyObject *defaults_kwdict;  /* Const kwonly defaults dict */
-    PyObject *(*defaults_getter)(PyObject *);
-    PyObject *func_annotations; /* function annotations dict */
-} __pyx_CyFunctionObject;
-static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
-    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
-static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
-                                      int flags, PyObject* qualname,
-                                      PyObject *self,
-                                      PyObject *module, PyObject *globals,
-                                      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 CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
-                                                             PyObject *dict);
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
-                                                              PyObject *dict);
-static int __Pyx_CyFunction_init(void);
-
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
-
-static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
-                                           PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/
-static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
-                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-static int __Pyx_check_binary_version(void);
-
-#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 PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*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 'libc.string' */
-
-/* Module declarations from 'libc.stdlib' */
-
-/* Module declarations from 'cpython.version' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'cpython.exc' */
-
-/* Module declarations from 'cpython.module' */
-
-/* Module declarations from 'cpython.mem' */
-
-/* Module declarations from 'cpython.tuple' */
-
-/* Module declarations from 'cpython.list' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from 'cpython.sequence' */
-
-/* Module declarations from 'cpython.mapping' */
-
-/* Module declarations from 'cpython.iterator' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'cpython.number' */
-
-/* Module declarations from 'cpython.int' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.bool' */
-static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
-
-/* Module declarations from 'cpython.long' */
-
-/* Module declarations from 'cpython.float' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.complex' */
-static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
-
-/* Module declarations from 'cpython.string' */
-
-/* Module declarations from 'cpython.unicode' */
-
-/* Module declarations from 'cpython.dict' */
-
-/* Module declarations from 'cpython.instance' */
-
-/* Module declarations from 'cpython.function' */
-
-/* Module declarations from 'cpython.method' */
-
-/* Module declarations from 'cpython.weakref' */
-
-/* Module declarations from 'cpython.getargs' */
-
-/* Module declarations from 'cpython.pythread' */
-
-/* Module declarations from 'cpython.pystate' */
-
-/* Module declarations from 'cpython.cobject' */
-
-/* Module declarations from 'cpython.oldbuffer' */
-
-/* Module declarations from 'cpython.set' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.bytes' */
-
-/* Module declarations from 'cpython.pycapsule' */
-
-/* Module declarations from 'cpython' */
-
-/* Module declarations from 'pysam.csamtools' */
-static PyObject *__pyx_f_5pysam_9csamtools__forceBytes(PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_9csamtools__forceCmdlineBytes(PyObject *); /*proto*/
-#define __Pyx_MODULE_NAME "pysam.csamtools"
-int __pyx_module_is_main_pysam__csamtools = 0;
-
-/* Implementation of 'pysam.csamtools' */
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_IOError;
-static PyObject *__pyx_builtin_AttributeError;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_open;
-static PyObject *__pyx_builtin_UnicodeDecodeError;
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs_2setdevice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs_4setfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs_6setfd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fd); /* proto */
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs_8restore(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_9csamtools__samtools_dispatch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_catch_stdout); /* proto */
-static char __pyx_k_a[] = "a";
-static char __pyx_k_i[] = "i";
-static char __pyx_k_n[] = "n";
-static char __pyx_k_o[] = "-o";
-static char __pyx_k_r[] = "r";
-static char __pyx_k_fd[] = "fd";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_os[] = "os";
-static char __pyx_k_rb[] = "rb";
-static char __pyx_k_doc[] = "__doc__";
-static char __pyx_k_dup[] = "dup";
-static char __pyx_k_inf[] = "inf";
-static char __pyx_k_ofd[] = "ofd";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_Outs[] = "Outs";
-static char __pyx_k_args[] = "args";
-static char __pyx_k_dup2[] = "dup2";
-static char __pyx_k_exit[] = "__exit__";
-static char __pyx_k_init[] = "__init__";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_open[] = "open";
-static char __pyx_k_path[] = "path";
-static char __pyx_k_read[] = "read";
-static char __pyx_k_self[] = "self";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_view[] = "view";
-static char __pyx_k_ascii[] = "ascii";
-static char __pyx_k_cargs[] = "cargs";
-static char __pyx_k_close[] = "close";
-static char __pyx_k_enter[] = "__enter__";
-static char __pyx_k_flush[] = "flush";
-static char __pyx_k_index[] = "index";
-static char __pyx_k_setfd[] = "setfd";
-static char __pyx_k_append[] = "append";
-static char __pyx_k_encode[] = "encode";
-static char __pyx_k_exists[] = "exists";
-static char __pyx_k_fileno[] = "fileno";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_method[] = "method";
-static char __pyx_k_module[] = "__module__";
-static char __pyx_k_remove[] = "remove";
-static char __pyx_k_retval[] = "retval";
-static char __pyx_k_stderr[] = "stderr";
-static char __pyx_k_stdout[] = "stdout";
-static char __pyx_k_IOError[] = "IOError";
-static char __pyx_k_O_CREAT[] = "O_CREAT";
-static char __pyx_k_mkstemp[] = "mkstemp";
-static char __pyx_k_prepare[] = "__prepare__";
-static char __pyx_k_restore[] = "restore";
-static char __pyx_k_setfile[] = "setfile";
-static char __pyx_k_streams[] = "streams";
-static char __pyx_k_O_WRONLY[] = "O_WRONLY";
-static char __pyx_k_filename[] = "filename";
-static char __pyx_k_platform[] = "platform";
-static char __pyx_k_qualname[] = "__qualname__";
-static char __pyx_k_samtools[] = "samtools";
-static char __pyx_k_stderr_f[] = "stderr_f";
-static char __pyx_k_stderr_h[] = "stderr_h";
-static char __pyx_k_stdout_f[] = "stdout_f";
-static char __pyx_k_stdout_h[] = "stdout_h";
-static char __pyx_k_tempfile[] = "tempfile";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_metaclass[] = "__metaclass__";
-static char __pyx_k_readlines[] = "readlines";
-static char __pyx_k_setdevice[] = "setdevice";
-static char __pyx_k_IS_PYTHON3[] = "IS_PYTHON3";
-static char __pyx_k_Outs_setfd[] = "Outs.setfd";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_out_stderr[] = "out_stderr";
-static char __pyx_k_out_stdout[] = "out_stdout";
-static char __pyx_k_Outs___init[] = "Outs.__init__";
-static char __pyx_k_stdout_save[] = "stdout_save";
-static char __pyx_k_Outs_restore[] = "Outs.restore";
-static char __pyx_k_Outs_setfile[] = "Outs.setfile";
-static char __pyx_k_catch_stdout[] = "catch_stdout";
-static char __pyx_k_AttributeError[] = "AttributeError";
-static char __pyx_k_Outs_setdevice[] = "Outs.setdevice";
-static char __pyx_k_pysam_csamtools[] = "pysam.csamtools";
-static char __pyx_k_samtools_dispatch[] = "_samtools_dispatch";
-static char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError";
-static char __pyx_k_No_such_file_or_directory_s[] = "No such file or directory: '%s'";
-static char __pyx_k_home_andreas_devel_pysam_pysam[] = "/home/andreas/devel/pysam/pysam/csamtools.pyx";
-static char __pyx_k_Argument_must_be_string_bytes_or[] = "Argument must be string, bytes or unicode.";
-static char __pyx_k_http_mail_python_org_pipermail_p[] = "http://mail.python.org/pipermail/python-list/2000-June/038406.html";
-static char __pyx_k_option_o_is_forbidden_in_samtool[] = "option -o is forbidden in samtools view";
-static PyObject *__pyx_kp_u_Argument_must_be_string_bytes_or;
-static PyObject *__pyx_n_s_AttributeError;
-static PyObject *__pyx_n_s_IOError;
-static PyObject *__pyx_n_s_IS_PYTHON3;
-static PyObject *__pyx_kp_s_No_such_file_or_directory_s;
-static PyObject *__pyx_n_s_O_CREAT;
-static PyObject *__pyx_n_s_O_WRONLY;
-static PyObject *__pyx_n_s_Outs;
-static PyObject *__pyx_n_s_Outs___init;
-static PyObject *__pyx_n_s_Outs_restore;
-static PyObject *__pyx_n_s_Outs_setdevice;
-static PyObject *__pyx_n_s_Outs_setfd;
-static PyObject *__pyx_n_s_Outs_setfile;
-static PyObject *__pyx_n_s_TypeError;
-static PyObject *__pyx_n_s_UnicodeDecodeError;
-static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_n_s_a;
-static PyObject *__pyx_n_s_append;
-static PyObject *__pyx_n_s_args;
-static PyObject *__pyx_n_s_ascii;
-static PyObject *__pyx_n_s_cargs;
-static PyObject *__pyx_n_s_catch_stdout;
-static PyObject *__pyx_n_s_close;
-static PyObject *__pyx_n_s_doc;
-static PyObject *__pyx_n_s_dup;
-static PyObject *__pyx_n_s_dup2;
-static PyObject *__pyx_n_s_encode;
-static PyObject *__pyx_n_s_enter;
-static PyObject *__pyx_n_s_exists;
-static PyObject *__pyx_n_s_exit;
-static PyObject *__pyx_n_s_fd;
-static PyObject *__pyx_n_s_filename;
-static PyObject *__pyx_n_s_fileno;
-static PyObject *__pyx_n_s_flush;
-static PyObject *__pyx_kp_s_home_andreas_devel_pysam_pysam;
-static PyObject *__pyx_kp_s_http_mail_python_org_pipermail_p;
-static PyObject *__pyx_n_s_i;
-static PyObject *__pyx_n_s_id;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_n_s_index;
-static PyObject *__pyx_n_s_inf;
-static PyObject *__pyx_n_s_init;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_n_s_metaclass;
-static PyObject *__pyx_n_s_method;
-static PyObject *__pyx_n_s_mkstemp;
-static PyObject *__pyx_n_s_module;
-static PyObject *__pyx_n_s_n;
-static PyObject *__pyx_kp_s_o;
-static PyObject *__pyx_n_s_ofd;
-static PyObject *__pyx_n_s_open;
-static PyObject *__pyx_kp_s_option_o_is_forbidden_in_samtool;
-static PyObject *__pyx_n_s_os;
-static PyObject *__pyx_n_s_out_stderr;
-static PyObject *__pyx_n_s_out_stdout;
-static PyObject *__pyx_n_s_path;
-static PyObject *__pyx_n_s_platform;
-static PyObject *__pyx_n_s_prepare;
-static PyObject *__pyx_n_s_pysam_csamtools;
-static PyObject *__pyx_n_s_qualname;
-static PyObject *__pyx_n_s_r;
-static PyObject *__pyx_n_s_rb;
-static PyObject *__pyx_n_s_read;
-static PyObject *__pyx_n_s_readlines;
-static PyObject *__pyx_n_s_remove;
-static PyObject *__pyx_n_s_restore;
-static PyObject *__pyx_n_s_retval;
-static PyObject *__pyx_n_s_samtools_dispatch;
-static PyObject *__pyx_n_s_self;
-static PyObject *__pyx_n_s_setdevice;
-static PyObject *__pyx_n_s_setfd;
-static PyObject *__pyx_n_s_setfile;
-static PyObject *__pyx_n_s_stderr;
-static PyObject *__pyx_n_s_stderr_f;
-static PyObject *__pyx_n_s_stderr_h;
-static PyObject *__pyx_n_s_stdout;
-static PyObject *__pyx_n_s_stdout_f;
-static PyObject *__pyx_n_s_stdout_h;
-static PyObject *__pyx_n_s_stdout_save;
-static PyObject *__pyx_n_s_streams;
-static PyObject *__pyx_n_s_sys;
-static PyObject *__pyx_n_s_tempfile;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_n_s_view;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_432;
-static PyObject *__pyx_tuple_;
-static PyObject *__pyx_tuple__2;
-static PyObject *__pyx_tuple__3;
-static PyObject *__pyx_tuple__4;
-static PyObject *__pyx_tuple__5;
-static PyObject *__pyx_tuple__6;
-static PyObject *__pyx_tuple__7;
-static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_tuple__10;
-static PyObject *__pyx_tuple__12;
-static PyObject *__pyx_tuple__14;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__18;
-static PyObject *__pyx_codeobj__8;
-static PyObject *__pyx_codeobj__11;
-static PyObject *__pyx_codeobj__13;
-static PyObject *__pyx_codeobj__15;
-static PyObject *__pyx_codeobj__17;
-static PyObject *__pyx_codeobj__19;
-
-/* "pysam/csamtools.pyx":18
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3
- * 
- * cdef bytes _forceBytes(object s):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-
-static PyObject *__pyx_f_5pysam_9csamtools__forceBytes(PyObject *__pyx_v_s) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  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("_forceBytes", 0);
-  __Pyx_TraceCall("_forceBytes", __pyx_f[0], 18);
-
-  /* "pysam/csamtools.pyx":21
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif s is None:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/csamtools.pyx":22
- *     """
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif s is None:
- *         return None
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/csamtools.pyx":23
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/csamtools.pyx":24
- *         return s
- *     elif s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/csamtools.pyx":25
- *     elif s is None:
- *         return None
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyUnicode_Check(s):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/csamtools.pyx":26
- *         return None
- *     elif PyBytes_Check(s):
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/csamtools.pyx":27
- *     elif PyBytes_Check(s):
- *         return s
- *     elif PyUnicode_Check(s):             # <<<<<<<<<<<<<<
- *         return s.encode('ascii')
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/csamtools.pyx":28
- *         return s
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_4);
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/csamtools.pyx":30
- *         return s.encode('ascii')
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_bytes_or, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/csamtools.pyx":18
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3
- * 
- * cdef bytes _forceBytes(object s):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.csamtools._forceBytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/csamtools.pyx":33
- * 
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):             # <<<<<<<<<<<<<<
- *     return _forceBytes(s)
- * 
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_9csamtools__forceCmdlineBytes(PyObject *__pyx_v_s) {
-  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("_forceCmdlineBytes", 0);
-  __Pyx_TraceCall("_forceCmdlineBytes", __pyx_f[0], 33);
-
-  /* "pysam/csamtools.pyx":34
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):
- *     return _forceBytes(s)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_5pysam_9csamtools__forceBytes(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/csamtools.pyx":33
- * 
- * 
- * cdef inline bytes _forceCmdlineBytes(object s):             # <<<<<<<<<<<<<<
- *     return _forceBytes(s)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.csamtools._forceCmdlineBytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/csamtools.pyx":39
- * class Outs:
- *     '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
- *     def __init__(self, id = 1):             # <<<<<<<<<<<<<<
- *         self.streams = []
- *         self.id = id
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_9csamtools_4Outs___init__[] = "Outs.__init__(self, id=1)";
-static PyMethodDef __pyx_mdef_5pysam_9csamtools_4Outs_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_5pysam_9csamtools_4Outs_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_9csamtools_4Outs___init__)};
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_id = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_id,0};
-    PyObject* values[2] = {0,0};
-    values[1] = ((PyObject *)((PyObject *)__pyx_int_1));
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id);
-          if (value) { values[1] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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_self = values[0];
-    __pyx_v_id = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.csamtools.Outs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_9csamtools_4Outs___init__(__pyx_self, __pyx_v_self, __pyx_v_id);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
-  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("__init__", 0);
-  __Pyx_TraceCall("__init__", __pyx_f[0], 39);
-
-  /* "pysam/csamtools.pyx":40
- *     '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
- *     def __init__(self, id = 1):
- *         self.streams = []             # <<<<<<<<<<<<<<
- *         self.id = id
- * 
- */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_streams, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":41
- *     def __init__(self, id = 1):
- *         self.streams = []
- *         self.id = id             # <<<<<<<<<<<<<<
- * 
- *     def setdevice(self, filename):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_id, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/csamtools.pyx":39
- * class Outs:
- *     '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
- *     def __init__(self, id = 1):             # <<<<<<<<<<<<<<
- *         self.streams = []
- *         self.id = id
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.csamtools.Outs.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/csamtools.pyx":43
- *         self.id = id
- * 
- *     def setdevice(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an existing file, like "/dev/null"'''
- *         fd = os.open(filename, os.O_WRONLY)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_3setdevice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_9csamtools_4Outs_2setdevice[] = "Outs.setdevice(self, filename)\nopen an existing file, like \"/dev/null\"";
-static PyMethodDef __pyx_mdef_5pysam_9csamtools_4Outs_3setdevice = {__Pyx_NAMESTR("setdevice"), (PyCFunction)__pyx_pw_5pysam_9csamtools_4Outs_3setdevice, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_9csamtools_4Outs_2setdevice)};
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_3setdevice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_filename = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setdevice (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setdevice", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setdevice") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __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_self = values[0];
-    __pyx_v_filename = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setdevice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.csamtools.Outs.setdevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_9csamtools_4Outs_2setdevice(__pyx_self, __pyx_v_self, __pyx_v_filename);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs_2setdevice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
-  PyObject *__pyx_v_fd = NULL;
-  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("setdevice", 0);
-  __Pyx_TraceCall("setdevice", __pyx_f[0], 43);
-
-  /* "pysam/csamtools.pyx":45
- *     def setdevice(self, filename):
- *         '''open an existing file, like "/dev/null"'''
- *         fd = os.open(filename, os.O_WRONLY)             # <<<<<<<<<<<<<<
- *         self.setfd(fd)
- * 
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_O_WRONLY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_fd = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/csamtools.pyx":46
- *         '''open an existing file, like "/dev/null"'''
- *         fd = os.open(filename, os.O_WRONLY)
- *         self.setfd(fd)             # <<<<<<<<<<<<<<
- * 
- *     def setfile(self, filename):
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_setfd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_fd);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fd);
-  __Pyx_GIVEREF(__pyx_v_fd);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/csamtools.pyx":43
- *         self.id = id
- * 
- *     def setdevice(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an existing file, like "/dev/null"'''
- *         fd = os.open(filename, os.O_WRONLY)
- */
-
-  /* function exit code */
-  __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("pysam.csamtools.Outs.setdevice", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_fd);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/csamtools.pyx":48
- *         self.setfd(fd)
- * 
- *     def setfile(self, filename):             # <<<<<<<<<<<<<<
- *         '''open a new file.'''
- *         fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_5setfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_9csamtools_4Outs_4setfile[] = "Outs.setfile(self, filename)\nopen a new file.";
-static PyMethodDef __pyx_mdef_5pysam_9csamtools_4Outs_5setfile = {__Pyx_NAMESTR("setfile"), (PyCFunction)__pyx_pw_5pysam_9csamtools_4Outs_5setfile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_9csamtools_4Outs_4setfile)};
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_5setfile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_filename = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setfile (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setfile", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setfile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __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_self = values[0];
-    __pyx_v_filename = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setfile", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.csamtools.Outs.setfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_9csamtools_4Outs_4setfile(__pyx_self, __pyx_v_self, __pyx_v_filename);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs_4setfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename) {
-  PyObject *__pyx_v_fd = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("setfile", 0);
-  __Pyx_TraceCall("setfile", __pyx_f[0], 48);
-
-  /* "pysam/csamtools.pyx":50
- *     def setfile(self, filename):
- *         '''open a new file.'''
- *         fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660)             # <<<<<<<<<<<<<<
- *         self.setfd(fd)
- * 
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_O_WRONLY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_O_CREAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyNumber_Or(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_int_432);
-  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_432);
-  __Pyx_GIVEREF(__pyx_int_432);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_v_fd = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":51
- *         '''open a new file.'''
- *         fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660)
- *         self.setfd(fd)             # <<<<<<<<<<<<<<
- * 
- *     def setfd(self, fd):
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_setfd); 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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_fd);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fd);
-  __Pyx_GIVEREF(__pyx_v_fd);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/csamtools.pyx":48
- *         self.setfd(fd)
- * 
- *     def setfile(self, filename):             # <<<<<<<<<<<<<<
- *         '''open a new file.'''
- *         fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660)
- */
-
-  /* function exit code */
-  __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("pysam.csamtools.Outs.setfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_fd);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/csamtools.pyx":53
- *         self.setfd(fd)
- * 
- *     def setfd(self, fd):             # <<<<<<<<<<<<<<
- *         ofd = os.dup(self.id)      #  Save old stream on new unit.
- *         self.streams.append(ofd)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_7setfd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_9csamtools_4Outs_6setfd[] = "Outs.setfd(self, fd)";
-static PyMethodDef __pyx_mdef_5pysam_9csamtools_4Outs_7setfd = {__Pyx_NAMESTR("setfd"), (PyCFunction)__pyx_pw_5pysam_9csamtools_4Outs_7setfd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_9csamtools_4Outs_6setfd)};
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_7setfd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_fd = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setfd (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_fd,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setfd", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setfd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __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_self = values[0];
-    __pyx_v_fd = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setfd", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.csamtools.Outs.setfd", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_9csamtools_4Outs_6setfd(__pyx_self, __pyx_v_self, __pyx_v_fd);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs_6setfd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fd) {
-  PyObject *__pyx_v_ofd = 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;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("setfd", 0);
-  __Pyx_TraceCall("setfd", __pyx_f[0], 53);
-
-  /* "pysam/csamtools.pyx":54
- * 
- *     def setfd(self, fd):
- *         ofd = os.dup(self.id)      #  Save old stream on new unit.             # <<<<<<<<<<<<<<
- *         self.streams.append(ofd)
- *         sys.stdout.flush()          #  Buffered data goes to old stream.
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __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 = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_v_ofd = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":55
- *     def setfd(self, fd):
- *         ofd = os.dup(self.id)      #  Save old stream on new unit.
- *         self.streams.append(ofd)             # <<<<<<<<<<<<<<
- *         sys.stdout.flush()          #  Buffered data goes to old stream.
- *         sys.stderr.flush()          #  Buffered data goes to old stream.
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_streams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_ofd); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":56
- *         ofd = os.dup(self.id)      #  Save old stream on new unit.
- *         self.streams.append(ofd)
- *         sys.stdout.flush()          #  Buffered data goes to old stream.             # <<<<<<<<<<<<<<
- *         sys.stderr.flush()          #  Buffered data goes to old stream.
- *         os.dup2(fd, self.id)        #  Open unit 1 on new stream.
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/csamtools.pyx":57
- *         self.streams.append(ofd)
- *         sys.stdout.flush()          #  Buffered data goes to old stream.
- *         sys.stderr.flush()          #  Buffered data goes to old stream.             # <<<<<<<<<<<<<<
- *         os.dup2(fd, self.id)        #  Open unit 1 on new stream.
- *         os.close(fd)                #  Close other unit (look out, caller.)
- */
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stderr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flush); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":58
- *         sys.stdout.flush()          #  Buffered data goes to old stream.
- *         sys.stderr.flush()          #  Buffered data goes to old stream.
- *         os.dup2(fd, self.id)        #  Open unit 1 on new stream.             # <<<<<<<<<<<<<<
- *         os.close(fd)                #  Close other unit (look out, caller.)
- * 
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dup2); 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_id); 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(2); 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(__pyx_v_fd);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fd);
-  __Pyx_GIVEREF(__pyx_v_fd);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":59
- *         sys.stderr.flush()          #  Buffered data goes to old stream.
- *         os.dup2(fd, self.id)        #  Open unit 1 on new stream.
- *         os.close(fd)                #  Close other unit (look out, caller.)             # <<<<<<<<<<<<<<
- * 
- *     def restore(self):
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_fd);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fd);
-  __Pyx_GIVEREF(__pyx_v_fd);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/csamtools.pyx":53
- *         self.setfd(fd)
- * 
- *     def setfd(self, fd):             # <<<<<<<<<<<<<<
- *         ofd = os.dup(self.id)      #  Save old stream on new unit.
- *         self.streams.append(ofd)
- */
-
-  /* function exit code */
-  __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("pysam.csamtools.Outs.setfd", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_ofd);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/csamtools.pyx":61
- *         os.close(fd)                #  Close other unit (look out, caller.)
- * 
- *     def restore(self):             # <<<<<<<<<<<<<<
- *         '''restore previous output stream'''
- *         if self.streams:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_9restore(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_9csamtools_4Outs_8restore[] = "Outs.restore(self)\nrestore previous output stream";
-static PyMethodDef __pyx_mdef_5pysam_9csamtools_4Outs_9restore = {__Pyx_NAMESTR("restore"), (PyCFunction)__pyx_pw_5pysam_9csamtools_4Outs_9restore, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_9csamtools_4Outs_8restore)};
-static PyObject *__pyx_pw_5pysam_9csamtools_4Outs_9restore(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("restore (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_9csamtools_4Outs_8restore(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_9csamtools_4Outs_8restore(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("restore", 0);
-  __Pyx_TraceCall("restore", __pyx_f[0], 61);
-
-  /* "pysam/csamtools.pyx":63
- *     def restore(self):
- *         '''restore previous output stream'''
- *         if self.streams:             # <<<<<<<<<<<<<<
- *             # the following was not sufficient, hence flush both stderr and stdout
- *             # os.fsync( self.id )
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_streams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/csamtools.pyx":66
- *             # the following was not sufficient, hence flush both stderr and stdout
- *             # os.fsync( self.id )
- *             sys.stdout.flush()             # <<<<<<<<<<<<<<
- *             sys.stderr.flush()
- *             os.dup2(self.streams[-1], self.id)
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/csamtools.pyx":67
- *             # os.fsync( self.id )
- *             sys.stdout.flush()
- *             sys.stderr.flush()             # <<<<<<<<<<<<<<
- *             os.dup2(self.streams[-1], self.id)
- *             os.close(self.streams[-1])
- */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stderr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flush); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/csamtools.pyx":68
- *             sys.stdout.flush()
- *             sys.stderr.flush()
- *             os.dup2(self.streams[-1], self.id)             # <<<<<<<<<<<<<<
- *             os.close(self.streams[-1])
- *             del self.streams[-1]
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dup2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_streams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_4 = 0;
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/csamtools.pyx":69
- *             sys.stderr.flush()
- *             os.dup2(self.streams[-1], self.id)
- *             os.close(self.streams[-1])             # <<<<<<<<<<<<<<
- *             del self.streams[-1]
- * 
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_streams); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_3);
-    __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 = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/csamtools.pyx":70
- *             os.dup2(self.streams[-1], self.id)
- *             os.close(self.streams[-1])
- *             del self.streams[-1]             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_streams); 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);
-    if (__Pyx_DelItemInt(__pyx_t_3, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/csamtools.pyx":61
- *         os.close(fd)                #  Close other unit (look out, caller.)
- * 
- *     def restore(self):             # <<<<<<<<<<<<<<
- *         '''restore previous output stream'''
- *         if self.streams:
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.csamtools.Outs.restore", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/csamtools.pyx":73
- * 
- * 
- * def _samtools_dispatch(method,             # <<<<<<<<<<<<<<
- *                        args = (),
- *                        catch_stdout = True):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_9csamtools_1_samtools_dispatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_9csamtools__samtools_dispatch[] = "_samtools_dispatch(method, args=(), catch_stdout=True)\ncall ``method`` in samtools providing arguments in args.\n    \n    .. note:: \n       This method redirects stdout to capture it \n       from samtools. If for some reason stdout disappears\n       the reason might be in this method.\n\n    .. note::\n       The current implementation might only work on linux.\n\n    .. note::\n       This method captures stdout and st [...]
-static PyMethodDef __pyx_mdef_5pysam_9csamtools_1_samtools_dispatch = {__Pyx_NAMESTR("_samtools_dispatch"), (PyCFunction)__pyx_pw_5pysam_9csamtools_1_samtools_dispatch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_9csamtools__samtools_dispatch)};
-static PyObject *__pyx_pw_5pysam_9csamtools_1_samtools_dispatch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_method = 0;
-  PyObject *__pyx_v_args = 0;
-  PyObject *__pyx_v_catch_stdout = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_samtools_dispatch (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_catch_stdout,0};
-    PyObject* values[3] = {0,0,0};
-
-    /* "pysam/csamtools.pyx":74
- * 
- * def _samtools_dispatch(method,
- *                        args = (),             # <<<<<<<<<<<<<<
- *                        catch_stdout = True):
- *     '''call ``method`` in samtools providing arguments in args.
- */
-    values[1] = ((PyObject *)__pyx_empty_tuple);
-
-    /* "pysam/csamtools.pyx":75
- * def _samtools_dispatch(method,
- *                        args = (),
- *                        catch_stdout = True):             # <<<<<<<<<<<<<<
- *     '''call ``method`` in samtools providing arguments in args.
- * 
- */
-    values[2] = ((PyObject *)Py_True);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_catch_stdout);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_samtools_dispatch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __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_method = values[0];
-    __pyx_v_args = values[1];
-    __pyx_v_catch_stdout = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_samtools_dispatch", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_9csamtools__samtools_dispatch(__pyx_self, __pyx_v_method, __pyx_v_args, __pyx_v_catch_stdout);
-
-  /* "pysam/csamtools.pyx":73
- * 
- * 
- * def _samtools_dispatch(method,             # <<<<<<<<<<<<<<
- *                        args = (),
- *                        catch_stdout = True):
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_9csamtools__samtools_dispatch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_catch_stdout) {
-  PyObject *__pyx_v_stderr_h = NULL;
-  PyObject *__pyx_v_stderr_f = NULL;
-  PyObject *__pyx_v_stdout_h = NULL;
-  PyObject *__pyx_v_stdout_f = NULL;
-  PyObject *__pyx_v_stdout_save = NULL;
-  char **__pyx_v_cargs;
-  int __pyx_v_i;
-  int __pyx_v_n;
-  int __pyx_v_retval;
-  PyObject *__pyx_v_inf = NULL;
-  PyObject *__pyx_v_out_stdout = NULL;
-  PyObject *__pyx_v_out_stderr = NULL;
-  PyObject *__pyx_v_a = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *(*__pyx_t_7)(PyObject *);
-  int __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  Py_ssize_t __pyx_t_12;
-  PyObject *(*__pyx_t_13)(PyObject *);
-  char *__pyx_t_14;
-  PyObject *__pyx_t_15 = NULL;
-  PyObject *__pyx_t_16 = NULL;
-  PyObject *__pyx_t_17 = NULL;
-  PyObject *__pyx_t_18 = NULL;
-  PyObject *__pyx_t_19 = NULL;
-  PyObject *__pyx_t_20 = NULL;
-  PyObject *__pyx_t_21 = NULL;
-  PyObject *__pyx_t_22 = NULL;
-  int __pyx_t_23;
-  char const *__pyx_t_24;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_TraceDeclarations
-  __Pyx_RefNannySetupContext("_samtools_dispatch", 0);
-  __Pyx_TraceCall("_samtools_dispatch", __pyx_f[0], 73);
-  __Pyx_INCREF(__pyx_v_method);
-  __Pyx_INCREF(__pyx_v_args);
-  __Pyx_INCREF(__pyx_v_catch_stdout);
-
-  /* "pysam/csamtools.pyx":99
- * 
- *     # some special cases
- *     if method == "index":             # <<<<<<<<<<<<<<
- *         if not os.path.exists(args[0]):
- *             raise IOError("No such file or directory: '%s'" % args[0])
- */
-  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_1) {
-
-    /* "pysam/csamtools.pyx":100
- *     # some special cases
- *     if method == "index":
- *         if not os.path.exists(args[0]):             # <<<<<<<<<<<<<<
- *             raise IOError("No such file or directory: '%s'" % args[0])
- * 
- */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_5 = ((!__pyx_t_1) != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/csamtools.pyx":101
- *     if method == "index":
- *         if not os.path.exists(args[0]):
- *             raise IOError("No such file or directory: '%s'" % args[0])             # <<<<<<<<<<<<<<
- * 
- *     # redirect stderr and stdout to file
- */
-      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_No_such_file_or_directory_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __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 = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
-      __Pyx_GIVEREF(__pyx_t_4);
-      __pyx_t_4 = 0;
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/csamtools.pyx":104
- * 
- *     # redirect stderr and stdout to file
- *     stderr_h, stderr_f = tempfile.mkstemp()             # <<<<<<<<<<<<<<
- *     pysam_set_stderr(stderr_h)
- * 
- */
-  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_tempfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mkstemp); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-    PyObject* sequence = __pyx_t_4;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 2)) {
-      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
-    } else {
-      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
-    }
-    __Pyx_INCREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_t_2);
-    #else
-    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    #endif
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
-    index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_3);
-    index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_2);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = NULL;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    goto __pyx_L6_unpacking_done;
-    __pyx_L5_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_7 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L6_unpacking_done:;
-  }
-  __pyx_v_stderr_h = __pyx_t_3;
-  __pyx_t_3 = 0;
-  __pyx_v_stderr_f = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/csamtools.pyx":105
- *     # redirect stderr and stdout to file
- *     stderr_h, stderr_f = tempfile.mkstemp()
- *     pysam_set_stderr(stderr_h)             # <<<<<<<<<<<<<<
- * 
- *     if catch_stdout:
- */
-  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_stderr_h); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  pysam_set_stderr(__pyx_t_8);
-
-  /* "pysam/csamtools.pyx":107
- *     pysam_set_stderr(stderr_h)
- * 
- *     if catch_stdout:             # <<<<<<<<<<<<<<
- *         stdout_h, stdout_f = tempfile.mkstemp()
- *         try:
- */
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_catch_stdout); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_5) {
-
-    /* "pysam/csamtools.pyx":108
- * 
- *     if catch_stdout:
- *         stdout_h, stdout_f = tempfile.mkstemp()             # <<<<<<<<<<<<<<
- *         try:
- *             stdout_save = Outs( sys.stdout.fileno() )
- */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_tempfile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mkstemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-      PyObject* sequence = __pyx_t_4;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 2)) {
-        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
-      } else {
-        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
-      }
-      __Pyx_INCREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_t_3);
-      #else
-      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      #endif
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
-      index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_2);
-      index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_7 = NULL;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      goto __pyx_L9_unpacking_done;
-      __pyx_L8_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_7 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L9_unpacking_done:;
-    }
-    __pyx_v_stdout_h = __pyx_t_2;
-    __pyx_t_2 = 0;
-    __pyx_v_stdout_f = __pyx_t_3;
-    __pyx_t_3 = 0;
-
-    /* "pysam/csamtools.pyx":109
- *     if catch_stdout:
- *         stdout_h, stdout_f = tempfile.mkstemp()
- *         try:             # <<<<<<<<<<<<<<
- *             stdout_save = Outs( sys.stdout.fileno() )
- *             stdout_save.setfd( stdout_h )
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_9);
-      __Pyx_XGOTREF(__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_11);
-      /*try:*/ {
-
-        /* "pysam/csamtools.pyx":110
- *         stdout_h, stdout_f = tempfile.mkstemp()
- *         try:
- *             stdout_save = Outs( sys.stdout.fileno() )             # <<<<<<<<<<<<<<
- *             stdout_save.setfd( stdout_h )
- *         except AttributeError:
- */
-        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Outs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fileno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __pyx_v_stdout_save = __pyx_t_2;
-        __pyx_t_2 = 0;
-
-        /* "pysam/csamtools.pyx":111
- *         try:
- *             stdout_save = Outs( sys.stdout.fileno() )
- *             stdout_save.setfd( stdout_h )             # <<<<<<<<<<<<<<
- *         except AttributeError:
- *             # stdout has already been redirected
- */
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stdout_save, __pyx_n_s_setfd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_INCREF(__pyx_v_stdout_h);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stdout_h);
-        __Pyx_GIVEREF(__pyx_v_stdout_h);
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      }
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      goto __pyx_L17_try_end;
-      __pyx_L10_error:;
-      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-      /* "pysam/csamtools.pyx":112
- *             stdout_save = Outs( sys.stdout.fileno() )
- *             stdout_save.setfd( stdout_h )
- *         except AttributeError:             # <<<<<<<<<<<<<<
- *             # stdout has already been redirected
- *             catch_stdout = False
- */
-      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
-      if (__pyx_t_8) {
-        __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_GOTREF(__pyx_t_2);
-
-        /* "pysam/csamtools.pyx":114
- *         except AttributeError:
- *             # stdout has already been redirected
- *             catch_stdout = False             # <<<<<<<<<<<<<<
- * 
- *         # patch for `samtools view`
- */
-        __Pyx_INCREF(Py_False);
-        __Pyx_DECREF_SET(__pyx_v_catch_stdout, Py_False);
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L11_exception_handled;
-      }
-      goto __pyx_L12_except_error;
-      __pyx_L12_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_9);
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
-      goto __pyx_L1_error;
-      __pyx_L11_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_9);
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
-      __pyx_L17_try_end:;
-    }
-
-    /* "pysam/csamtools.pyx":119
- *         # samtools `view` closes stdout, from which I can not
- *         # recover. Thus redirect output to file with -o option.
- *         if method == "view":             # <<<<<<<<<<<<<<
- *             if "-o" in args:
- *                 raise ValueError("option -o is forbidden in samtools view")
- */
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_method, __pyx_n_s_view, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_5) {
-
-      /* "pysam/csamtools.pyx":120
- *         # recover. Thus redirect output to file with -o option.
- *         if method == "view":
- *             if "-o" in args:             # <<<<<<<<<<<<<<
- *                 raise ValueError("option -o is forbidden in samtools view")
- *             args = ( "-o", stdout_f ) + args
- */
-      __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_kp_s_o, __pyx_v_args, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_1 = (__pyx_t_5 != 0);
-      if (__pyx_t_1) {
-
-        /* "pysam/csamtools.pyx":121
- *         if method == "view":
- *             if "-o" in args:
- *                 raise ValueError("option -o is forbidden in samtools view")             # <<<<<<<<<<<<<<
- *             args = ( "-o", stdout_f ) + args
- * 
- */
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-
-      /* "pysam/csamtools.pyx":122
- *             if "-o" in args:
- *                 raise ValueError("option -o is forbidden in samtools view")
- *             args = ( "-o", stdout_f ) + args             # <<<<<<<<<<<<<<
- * 
- *     # do the function call to samtools
- */
-      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_kp_s_o);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_o);
-      __Pyx_GIVEREF(__pyx_kp_s_o);
-      __Pyx_INCREF(__pyx_v_stdout_f);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_stdout_f);
-      __Pyx_GIVEREF(__pyx_v_stdout_f);
-      __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3);
-      __pyx_t_3 = 0;
-      goto __pyx_L20;
-    }
-    __pyx_L20:;
-    goto __pyx_L7;
-  }
-  __pyx_L7:;
-
-  /* "pysam/csamtools.pyx":128
- *     cdef int i, n, retval
- * 
- *     n = len(args)             # <<<<<<<<<<<<<<
- *     method = _forceCmdlineBytes(method)
- *     args = [ _forceCmdlineBytes(a) for a in args ]
- */
-  __pyx_t_12 = PyObject_Length(__pyx_v_args); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_n = __pyx_t_12;
-
-  /* "pysam/csamtools.pyx":129
- * 
- *     n = len(args)
- *     method = _forceCmdlineBytes(method)             # <<<<<<<<<<<<<<
- *     args = [ _forceCmdlineBytes(a) for a in args ]
- * 
- */
-  __pyx_t_3 = __pyx_f_5pysam_9csamtools__forceCmdlineBytes(__pyx_v_method); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF_SET(__pyx_v_method, __pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/csamtools.pyx":130
- *     n = len(args)
- *     method = _forceCmdlineBytes(method)
- *     args = [ _forceCmdlineBytes(a) for a in args ]             # <<<<<<<<<<<<<<
- * 
- *     # allocate two more for first (dummy) argument (contains command)
- */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  if (PyList_CheckExact(__pyx_v_args) || PyTuple_CheckExact(__pyx_v_args)) {
-    __pyx_t_2 = __pyx_v_args; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0;
-    __pyx_t_13 = NULL;
-  } else {
-    __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_4 = __pyx_t_13(__pyx_t_2);
-      if (unlikely(!__pyx_t_4)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_4);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = __pyx_f_5pysam_9csamtools__forceCmdlineBytes(__pyx_v_a); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/csamtools.pyx":133
- * 
- *     # allocate two more for first (dummy) argument (contains command)
- *     cargs = <char**>calloc( n+2, sizeof( char *) )             # <<<<<<<<<<<<<<
- *     cargs[0] = "samtools"
- *     cargs[1] = method
- */
-  __pyx_v_cargs = ((char **)calloc((__pyx_v_n + 2), (sizeof(char *))));
-
-  /* "pysam/csamtools.pyx":134
- *     # allocate two more for first (dummy) argument (contains command)
- *     cargs = <char**>calloc( n+2, sizeof( char *) )
- *     cargs[0] = "samtools"             # <<<<<<<<<<<<<<
- *     cargs[1] = method
- *     for i from 0 <= i < n: cargs[i+2] = args[i]
- */
-  (__pyx_v_cargs[0]) = __pyx_k_samtools;
-
-  /* "pysam/csamtools.pyx":135
- *     cargs = <char**>calloc( n+2, sizeof( char *) )
- *     cargs[0] = "samtools"
- *     cargs[1] = method             # <<<<<<<<<<<<<<
- *     for i from 0 <= i < n: cargs[i+2] = args[i]
- * 
- */
-  __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_v_method); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  (__pyx_v_cargs[1]) = __pyx_t_14;
-
-  /* "pysam/csamtools.pyx":136
- *     cargs[0] = "samtools"
- *     cargs[1] = method
- *     for i from 0 <= i < n: cargs[i+2] = args[i]             # <<<<<<<<<<<<<<
- * 
- *     retval = pysam_dispatch(n+2, cargs)
- */
-  __pyx_t_8 = __pyx_v_n;
-  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {
-    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_args, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_14 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_14) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    (__pyx_v_cargs[(__pyx_v_i + 2)]) = __pyx_t_14;
-  }
-
-  /* "pysam/csamtools.pyx":138
- *     for i from 0 <= i < n: cargs[i+2] = args[i]
- * 
- *     retval = pysam_dispatch(n+2, cargs)             # <<<<<<<<<<<<<<
- *     free( cargs )
- * 
- */
-  __pyx_v_retval = pysam_dispatch((__pyx_v_n + 2), __pyx_v_cargs);
-
-  /* "pysam/csamtools.pyx":139
- * 
- *     retval = pysam_dispatch(n+2, cargs)
- *     free( cargs )             # <<<<<<<<<<<<<<
- * 
- *     # restore stdout/stderr. This will also flush, so
- */
-  free(__pyx_v_cargs);
-
-  /* "pysam/csamtools.pyx":143
- *     # restore stdout/stderr. This will also flush, so
- *     # needs to be before reading back the file contents
- *     if catch_stdout:             # <<<<<<<<<<<<<<
- *         stdout_save.restore()
- *         try:
- */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_catch_stdout); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_1) {
-
-    /* "pysam/csamtools.pyx":144
- *     # needs to be before reading back the file contents
- *     if catch_stdout:
- *         stdout_save.restore()             # <<<<<<<<<<<<<<
- *         try:
- *             with open( stdout_f, "r") as inf:
- */
-    if (unlikely(!__pyx_v_stdout_save)) { __Pyx_RaiseUnboundLocalError("stdout_save"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stdout_save, __pyx_n_s_restore); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-    /* "pysam/csamtools.pyx":145
- *     if catch_stdout:
- *         stdout_save.restore()
- *         try:             # <<<<<<<<<<<<<<
- *             with open( stdout_f, "r") as inf:
- *                 out_stdout = inf.readlines()
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
-      __Pyx_XGOTREF(__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_9);
-      /*try:*/ {
-
-        /* "pysam/csamtools.pyx":146
- *         stdout_save.restore()
- *         try:
- *             with open( stdout_f, "r") as inf:             # <<<<<<<<<<<<<<
- *                 out_stdout = inf.readlines()
- *         except UnicodeDecodeError:
- */
-        /*with:*/ {
-          if (unlikely(!__pyx_v_stdout_f)) { __Pyx_RaiseUnboundLocalError("stdout_f"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L27_error;} }
-          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_INCREF(__pyx_v_stdout_f);
-          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stdout_f);
-          __Pyx_GIVEREF(__pyx_v_stdout_f);
-          __Pyx_INCREF(__pyx_n_s_r);
-          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_r);
-          __Pyx_GIVEREF(__pyx_n_s_r);
-          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
-          __Pyx_GOTREF(__pyx_t_15);
-          __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L35_error;}
-          __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          /*try:*/ {
-            {
-              __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:*/ {
-                __Pyx_INCREF(__pyx_t_4);
-                __pyx_v_inf = __pyx_t_4;
-                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-                /* "pysam/csamtools.pyx":147
- *         try:
- *             with open( stdout_f, "r") as inf:
- *                 out_stdout = inf.readlines()             # <<<<<<<<<<<<<<
- *         except UnicodeDecodeError:
- *             with open( stdout_f, "rb") as inf:
- */
-                __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_inf, __pyx_n_s_readlines); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L41_error;}
-                __Pyx_GOTREF(__pyx_t_4);
-                __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L41_error;}
-                __Pyx_GOTREF(__pyx_t_3);
-                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-                __pyx_v_out_stdout = __pyx_t_3;
-                __pyx_t_3 = 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_L48_try_end;
-              __pyx_L41_error:;
-              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-              /* "pysam/csamtools.pyx":146
- *         stdout_save.restore()
- *         try:
- *             with open( stdout_f, "r") as inf:             # <<<<<<<<<<<<<<
- *                 out_stdout = inf.readlines()
- *         except UnicodeDecodeError:
- */
-              /*except:*/ {
-                __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-                if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
-                __Pyx_GOTREF(__pyx_t_3);
-                __Pyx_GOTREF(__pyx_t_4);
-                __Pyx_GOTREF(__pyx_t_2);
-                __pyx_t_6 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
-                __Pyx_GOTREF(__pyx_t_6);
-                __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_6, NULL);
-                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-                if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
-                __Pyx_GOTREF(__pyx_t_19);
-                __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_19);
-                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
-                if (__pyx_t_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
-                __pyx_t_5 = ((!(__pyx_t_1 != 0)) != 0);
-                if (__pyx_t_5) {
-                  __Pyx_GIVEREF(__pyx_t_3);
-                  __Pyx_GIVEREF(__pyx_t_4);
-                  __Pyx_XGIVEREF(__pyx_t_2);
-                  __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_2);
-                  __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; 
-                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
-                }
-                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-                goto __pyx_L42_exception_handled;
-              }
-              __pyx_L43_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_L27_error;
-              __pyx_L42_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_L48_try_end:;
-            }
-          }
-          /*finally:*/ {
-            /*normal exit:*/{
-              if (__pyx_t_15) {
-                __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__3, NULL);
-                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-                if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L27_error;}
-                __Pyx_GOTREF(__pyx_t_18);
-                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
-              }
-              goto __pyx_L40;
-            }
-            __pyx_L40:;
-          }
-          goto __pyx_L53;
-          __pyx_L35_error:;
-          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-          goto __pyx_L27_error;
-          __pyx_L53:;
-        }
-      }
-      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      goto __pyx_L34_try_end;
-      __pyx_L27_error:;
-      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-      /* "pysam/csamtools.pyx":148
- *             with open( stdout_f, "r") as inf:
- *                 out_stdout = inf.readlines()
- *         except UnicodeDecodeError:             # <<<<<<<<<<<<<<
- *             with open( stdout_f, "rb") as inf:
- *                 # read binary output
- */
-      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
-      if (__pyx_t_8) {
-        __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_GOTREF(__pyx_t_3);
-
-        /* "pysam/csamtools.pyx":149
- *                 out_stdout = inf.readlines()
- *         except UnicodeDecodeError:
- *             with open( stdout_f, "rb") as inf:             # <<<<<<<<<<<<<<
- *                 # read binary output
- *                 out_stdout = inf.read()
- */
-        /*with:*/ {
-          if (unlikely(!__pyx_v_stdout_f)) { __Pyx_RaiseUnboundLocalError("stdout_f"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;} }
-          __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_INCREF(__pyx_v_stdout_f);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_stdout_f);
-          __Pyx_GIVEREF(__pyx_v_stdout_f);
-          __Pyx_INCREF(__pyx_n_s_rb);
-          PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_rb);
-          __Pyx_GIVEREF(__pyx_n_s_rb);
-          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_6, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
-          __Pyx_GOTREF(__pyx_t_20);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_20, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
-          __Pyx_GOTREF(__pyx_t_15);
-          __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_20, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-          __Pyx_GOTREF(__pyx_t_21);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
-          /*try:*/ {
-            {
-              __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
-              __Pyx_XGOTREF(__pyx_t_18);
-              __Pyx_XGOTREF(__pyx_t_17);
-              __Pyx_XGOTREF(__pyx_t_16);
-              /*try:*/ {
-                __Pyx_INCREF(__pyx_t_21);
-                __Pyx_XDECREF_SET(__pyx_v_inf, __pyx_t_21);
-                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
-
-                /* "pysam/csamtools.pyx":151
- *             with open( stdout_f, "rb") as inf:
- *                 # read binary output
- *                 out_stdout = inf.read()             # <<<<<<<<<<<<<<
- *         os.remove( stdout_f )
- *     else:
- */
-                __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_inf, __pyx_n_s_read); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L62_error;}
-                __Pyx_GOTREF(__pyx_t_21);
-                __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L62_error;}
-                __Pyx_GOTREF(__pyx_t_20);
-                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
-                __Pyx_XDECREF_SET(__pyx_v_out_stdout, __pyx_t_20);
-                __pyx_t_20 = 0;
-              }
-              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
-              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
-              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
-              goto __pyx_L69_try_end;
-              __pyx_L62_error:;
-              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
-              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
-
-              /* "pysam/csamtools.pyx":149
- *                 out_stdout = inf.readlines()
- *         except UnicodeDecodeError:
- *             with open( stdout_f, "rb") as inf:             # <<<<<<<<<<<<<<
- *                 # read binary output
- *                 out_stdout = inf.read()
- */
-              /*except:*/ {
-                __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-                if (__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L64_except_error;}
-                __Pyx_GOTREF(__pyx_t_20);
-                __Pyx_GOTREF(__pyx_t_21);
-                __Pyx_GOTREF(__pyx_t_6);
-                __pyx_t_22 = PyTuple_Pack(3, __pyx_t_20, __pyx_t_21, __pyx_t_6); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L64_except_error;}
-                __Pyx_GOTREF(__pyx_t_22);
-                __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_22, NULL);
-                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
-                if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L64_except_error;}
-                __Pyx_GOTREF(__pyx_t_19);
-                __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_19);
-                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
-                if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L64_except_error;}
-                __pyx_t_1 = ((!(__pyx_t_5 != 0)) != 0);
-                if (__pyx_t_1) {
-                  __Pyx_GIVEREF(__pyx_t_20);
-                  __Pyx_GIVEREF(__pyx_t_21);
-                  __Pyx_XGIVEREF(__pyx_t_6);
-                  __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_6);
-                  __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_6 = 0; 
-                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L64_except_error;}
-                }
-                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
-                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
-                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-                goto __pyx_L63_exception_handled;
-              }
-              __pyx_L64_except_error:;
-              __Pyx_XGIVEREF(__pyx_t_18);
-              __Pyx_XGIVEREF(__pyx_t_17);
-              __Pyx_XGIVEREF(__pyx_t_16);
-              __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
-              goto __pyx_L29_except_error;
-              __pyx_L63_exception_handled:;
-              __Pyx_XGIVEREF(__pyx_t_18);
-              __Pyx_XGIVEREF(__pyx_t_17);
-              __Pyx_XGIVEREF(__pyx_t_16);
-              __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
-              __pyx_L69_try_end:;
-            }
-          }
-          /*finally:*/ {
-            /*normal exit:*/{
-              if (__pyx_t_15) {
-                __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__4, NULL);
-                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-                if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L29_except_error;}
-                __Pyx_GOTREF(__pyx_t_16);
-                __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-              }
-              goto __pyx_L61;
-            }
-            __pyx_L61:;
-          }
-          goto __pyx_L74;
-          __pyx_L56_error:;
-          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-          goto __pyx_L29_except_error;
-          __pyx_L74:;
-        }
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        goto __pyx_L28_exception_handled;
-      }
-      goto __pyx_L29_except_error;
-      __pyx_L29_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_9);
-      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
-      goto __pyx_L1_error;
-      __pyx_L28_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_9);
-      __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
-      __pyx_L34_try_end:;
-    }
-
-    /* "pysam/csamtools.pyx":152
- *                 # read binary output
- *                 out_stdout = inf.read()
- *         os.remove( stdout_f )             # <<<<<<<<<<<<<<
- *     else:
- *         out_stdout = []
- */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (unlikely(!__pyx_v_stdout_f)) { __Pyx_RaiseUnboundLocalError("stdout_f"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_stdout_f);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stdout_f);
-    __Pyx_GIVEREF(__pyx_v_stdout_f);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    goto __pyx_L26;
-  }
-  /*else*/ {
-
-    /* "pysam/csamtools.pyx":154
- *         os.remove( stdout_f )
- *     else:
- *         out_stdout = []             # <<<<<<<<<<<<<<
- * 
- *     # get error messages
- */
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_out_stdout = __pyx_t_2;
-    __pyx_t_2 = 0;
-  }
-  __pyx_L26:;
-
-  /* "pysam/csamtools.pyx":157
- * 
- *     # get error messages
- *     pysam_unset_stderr()             # <<<<<<<<<<<<<<
- *     try:
- *         with open( stderr_f, "r") as inf:
- */
-  pysam_unset_stderr();
-
-  /* "pysam/csamtools.pyx":158
- *     # get error messages
- *     pysam_unset_stderr()
- *     try:             # <<<<<<<<<<<<<<
- *         with open( stderr_f, "r") as inf:
- *             out_stderr = inf.readlines()
- */
-  /*try:*/ {
-    {
-      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_9);
-      __Pyx_XGOTREF(__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_11);
-      /*try:*/ {
-
-        /* "pysam/csamtools.pyx":159
- *     pysam_unset_stderr()
- *     try:
- *         with open( stderr_f, "r") as inf:             # <<<<<<<<<<<<<<
- *             out_stderr = inf.readlines()
- *     except UnicodeDecodeError:
- */
-        /*with:*/ {
-          __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_INCREF(__pyx_v_stderr_f);
-          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stderr_f);
-          __Pyx_GIVEREF(__pyx_v_stderr_f);
-          __Pyx_INCREF(__pyx_n_s_r);
-          PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_r);
-          __Pyx_GIVEREF(__pyx_n_s_r);
-          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-          __Pyx_GOTREF(__pyx_t_3);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-          __Pyx_GOTREF(__pyx_t_15);
-          __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L86_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L86_error;}
-          __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          /*try:*/ {
-            {
-              __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:*/ {
-                __Pyx_INCREF(__pyx_t_4);
-                __Pyx_XDECREF_SET(__pyx_v_inf, __pyx_t_4);
-                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-                /* "pysam/csamtools.pyx":160
- *     try:
- *         with open( stderr_f, "r") as inf:
- *             out_stderr = inf.readlines()             # <<<<<<<<<<<<<<
- *     except UnicodeDecodeError:
- *         with open( stderr_f, "rb") as inf:
- */
-                __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_inf, __pyx_n_s_readlines); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
-                __Pyx_GOTREF(__pyx_t_4);
-                __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L92_error;}
-                __Pyx_GOTREF(__pyx_t_3);
-                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-                __pyx_v_out_stderr = __pyx_t_3;
-                __pyx_t_3 = 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_L99_try_end;
-              __pyx_L92_error:;
-              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
-              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
-              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
-              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-              /* "pysam/csamtools.pyx":159
- *     pysam_unset_stderr()
- *     try:
- *         with open( stderr_f, "r") as inf:             # <<<<<<<<<<<<<<
- *             out_stderr = inf.readlines()
- *     except UnicodeDecodeError:
- */
-              /*except:*/ {
-                __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-                if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L94_except_error;}
-                __Pyx_GOTREF(__pyx_t_3);
-                __Pyx_GOTREF(__pyx_t_4);
-                __Pyx_GOTREF(__pyx_t_2);
-                __pyx_t_6 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L94_except_error;}
-                __Pyx_GOTREF(__pyx_t_6);
-                __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_6, NULL);
-                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-                if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L94_except_error;}
-                __Pyx_GOTREF(__pyx_t_19);
-                __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_19);
-                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
-                if (__pyx_t_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L94_except_error;}
-                __pyx_t_5 = ((!(__pyx_t_1 != 0)) != 0);
-                if (__pyx_t_5) {
-                  __Pyx_GIVEREF(__pyx_t_3);
-                  __Pyx_GIVEREF(__pyx_t_4);
-                  __Pyx_XGIVEREF(__pyx_t_2);
-                  __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_2);
-                  __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; 
-                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L94_except_error;}
-                }
-                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-                goto __pyx_L93_exception_handled;
-              }
-              __pyx_L94_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_L78_error;
-              __pyx_L93_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_L99_try_end:;
-            }
-          }
-          /*finally:*/ {
-            /*normal exit:*/{
-              if (__pyx_t_15) {
-                __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__5, NULL);
-                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-                if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L78_error;}
-                __Pyx_GOTREF(__pyx_t_18);
-                __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
-              }
-              goto __pyx_L91;
-            }
-            __pyx_L91:;
-          }
-          goto __pyx_L104;
-          __pyx_L86_error:;
-          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-          goto __pyx_L78_error;
-          __pyx_L104:;
-        }
-      }
-      /*else:*/ {
-
-        /* "pysam/csamtools.pyx":166
- *             out_stderr = inf.read()
- *     else:
- *         out_stderr = []             # <<<<<<<<<<<<<<
- *     finally:
- *         os.remove( stderr_f )
- */
-        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L80_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_XDECREF_SET(__pyx_v_out_stderr, __pyx_t_2);
-        __pyx_t_2 = 0;
-      }
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      goto __pyx_L85_try_end;
-      __pyx_L78_error:;
-      __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
-      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
-      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
-      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-      /* "pysam/csamtools.pyx":161
- *         with open( stderr_f, "r") as inf:
- *             out_stderr = inf.readlines()
- *     except UnicodeDecodeError:             # <<<<<<<<<<<<<<
- *         with open( stderr_f, "rb") as inf:
- *             # read binary output
- */
-      __pyx_t_8 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
-      if (__pyx_t_8) {
-        __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L80_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_GOTREF(__pyx_t_3);
-
-        /* "pysam/csamtools.pyx":162
- *             out_stderr = inf.readlines()
- *     except UnicodeDecodeError:
- *         with open( stderr_f, "rb") as inf:             # <<<<<<<<<<<<<<
- *             # read binary output
- *             out_stderr = inf.read()
- */
-        /*with:*/ {
-          __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L80_except_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_INCREF(__pyx_v_stderr_f);
-          PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_stderr_f);
-          __Pyx_GIVEREF(__pyx_v_stderr_f);
-          __Pyx_INCREF(__pyx_n_s_rb);
-          PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_rb);
-          __Pyx_GIVEREF(__pyx_n_s_rb);
-          __pyx_t_21 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_6, NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L80_except_error;}
-          __Pyx_GOTREF(__pyx_t_21);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __pyx_t_15 = __Pyx_PyObject_LookupSpecial(__pyx_t_21, __pyx_n_s_exit); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L80_except_error;}
-          __Pyx_GOTREF(__pyx_t_15);
-          __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_21, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L107_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L107_error;}
-          __Pyx_GOTREF(__pyx_t_20);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
-          /*try:*/ {
-            {
-              __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
-              __Pyx_XGOTREF(__pyx_t_18);
-              __Pyx_XGOTREF(__pyx_t_17);
-              __Pyx_XGOTREF(__pyx_t_16);
-              /*try:*/ {
-                __Pyx_INCREF(__pyx_t_20);
-                __Pyx_XDECREF_SET(__pyx_v_inf, __pyx_t_20);
-                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
-
-                /* "pysam/csamtools.pyx":164
- *         with open( stderr_f, "rb") as inf:
- *             # read binary output
- *             out_stderr = inf.read()             # <<<<<<<<<<<<<<
- *     else:
- *         out_stderr = []
- */
-                __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_inf, __pyx_n_s_read); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L113_error;}
-                __Pyx_GOTREF(__pyx_t_20);
-                __pyx_t_21 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L113_error;}
-                __Pyx_GOTREF(__pyx_t_21);
-                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
-                __Pyx_XDECREF_SET(__pyx_v_out_stderr, __pyx_t_21);
-                __pyx_t_21 = 0;
-              }
-              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
-              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
-              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
-              goto __pyx_L120_try_end;
-              __pyx_L113_error:;
-              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
-              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
-              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
-
-              /* "pysam/csamtools.pyx":162
- *             out_stderr = inf.readlines()
- *     except UnicodeDecodeError:
- *         with open( stderr_f, "rb") as inf:             # <<<<<<<<<<<<<<
- *             # read binary output
- *             out_stderr = inf.read()
- */
-              /*except:*/ {
-                __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-                if (__Pyx_GetException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L115_except_error;}
-                __Pyx_GOTREF(__pyx_t_21);
-                __Pyx_GOTREF(__pyx_t_20);
-                __Pyx_GOTREF(__pyx_t_6);
-                __pyx_t_22 = PyTuple_Pack(3, __pyx_t_21, __pyx_t_20, __pyx_t_6); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L115_except_error;}
-                __Pyx_GOTREF(__pyx_t_22);
-                __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_22, NULL);
-                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
-                if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L115_except_error;}
-                __Pyx_GOTREF(__pyx_t_19);
-                __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_19);
-                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
-                if (__pyx_t_5 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L115_except_error;}
-                __pyx_t_1 = ((!(__pyx_t_5 != 0)) != 0);
-                if (__pyx_t_1) {
-                  __Pyx_GIVEREF(__pyx_t_21);
-                  __Pyx_GIVEREF(__pyx_t_20);
-                  __Pyx_XGIVEREF(__pyx_t_6);
-                  __Pyx_ErrRestore(__pyx_t_21, __pyx_t_20, __pyx_t_6);
-                  __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_6 = 0; 
-                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L115_except_error;}
-                }
-                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
-                __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
-                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-                goto __pyx_L114_exception_handled;
-              }
-              __pyx_L115_except_error:;
-              __Pyx_XGIVEREF(__pyx_t_18);
-              __Pyx_XGIVEREF(__pyx_t_17);
-              __Pyx_XGIVEREF(__pyx_t_16);
-              __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
-              goto __pyx_L80_except_error;
-              __pyx_L114_exception_handled:;
-              __Pyx_XGIVEREF(__pyx_t_18);
-              __Pyx_XGIVEREF(__pyx_t_17);
-              __Pyx_XGIVEREF(__pyx_t_16);
-              __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_17, __pyx_t_16);
-              __pyx_L120_try_end:;
-            }
-          }
-          /*finally:*/ {
-            /*normal exit:*/{
-              if (__pyx_t_15) {
-                __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_tuple__6, NULL);
-                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-                if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L80_except_error;}
-                __Pyx_GOTREF(__pyx_t_16);
-                __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-              }
-              goto __pyx_L112;
-            }
-            __pyx_L112:;
-          }
-          goto __pyx_L125;
-          __pyx_L107_error:;
-          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-          goto __pyx_L80_except_error;
-          __pyx_L125:;
-        }
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        goto __pyx_L79_exception_handled;
-      }
-      goto __pyx_L80_except_error;
-      __pyx_L80_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_9);
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
-      goto __pyx_L76_error;
-      __pyx_L79_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_9);
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
-      __pyx_L85_try_end:;
-    }
-  }
-
-  /* "pysam/csamtools.pyx":168
- *         out_stderr = []
- *     finally:
- *         os.remove( stderr_f )             # <<<<<<<<<<<<<<
- * 
- *     return retval, out_stderr, out_stdout
- */
-  /*finally:*/ {
-    /*normal exit:*/{
-      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_remove); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_v_stderr_f);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stderr_f);
-      __Pyx_GIVEREF(__pyx_v_stderr_f);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L77;
-    }
-    /*exception exit:*/{
-      __pyx_L76_error:;
-      __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
-      __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
-      __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
-      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
-      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
-      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
-      __Pyx_XGOTREF(__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_9);
-      __Pyx_XGOTREF(__pyx_t_15);
-      __Pyx_XGOTREF(__pyx_t_16);
-      __Pyx_XGOTREF(__pyx_t_17);
-      __pyx_t_8 = __pyx_lineno; __pyx_t_23 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
-      {
-        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L127_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L127_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L127_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_v_stderr_f);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stderr_f);
-        __Pyx_GIVEREF(__pyx_v_stderr_f);
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L127_error;}
-        __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      }
-      if (PY_MAJOR_VERSION >= 3) {
-        __Pyx_XGIVEREF(__pyx_t_15);
-        __Pyx_XGIVEREF(__pyx_t_16);
-        __Pyx_XGIVEREF(__pyx_t_17);
-        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
-      }
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_9);
-      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
-      __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
-      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_23; __pyx_filename = __pyx_t_24;
-      goto __pyx_L1_error;
-      __pyx_L127_error:;
-      if (PY_MAJOR_VERSION >= 3) {
-        __Pyx_XGIVEREF(__pyx_t_15);
-        __Pyx_XGIVEREF(__pyx_t_16);
-        __Pyx_XGIVEREF(__pyx_t_17);
-        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
-      }
-      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
-      goto __pyx_L1_error;
-    }
-    __pyx_L77:;
-  }
-
-  /* "pysam/csamtools.pyx":170
- *         os.remove( stderr_f )
- * 
- *     return retval, out_stderr, out_stdout             # <<<<<<<<<<<<<<
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_retval); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (unlikely(!__pyx_v_out_stderr)) { __Pyx_RaiseUnboundLocalError("out_stderr"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  if (unlikely(!__pyx_v_out_stdout)) { __Pyx_RaiseUnboundLocalError("out_stdout"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  __pyx_t_2 = PyTuple_New(3); 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);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_out_stderr);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_out_stderr);
-  __Pyx_GIVEREF(__pyx_v_out_stderr);
-  __Pyx_INCREF(__pyx_v_out_stdout);
-  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_out_stdout);
-  __Pyx_GIVEREF(__pyx_v_out_stdout);
-  __pyx_t_4 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/csamtools.pyx":73
- * 
- * 
- * def _samtools_dispatch(method,             # <<<<<<<<<<<<<<
- *                        args = (),
- *                        catch_stdout = True):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_20);
-  __Pyx_XDECREF(__pyx_t_21);
-  __Pyx_XDECREF(__pyx_t_22);
-  __Pyx_AddTraceback("pysam.csamtools._samtools_dispatch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_stderr_h);
-  __Pyx_XDECREF(__pyx_v_stderr_f);
-  __Pyx_XDECREF(__pyx_v_stdout_h);
-  __Pyx_XDECREF(__pyx_v_stdout_f);
-  __Pyx_XDECREF(__pyx_v_stdout_save);
-  __Pyx_XDECREF(__pyx_v_inf);
-  __Pyx_XDECREF(__pyx_v_out_stdout);
-  __Pyx_XDECREF(__pyx_v_out_stderr);
-  __Pyx_XDECREF(__pyx_v_a);
-  __Pyx_XDECREF(__pyx_v_method);
-  __Pyx_XDECREF(__pyx_v_args);
-  __Pyx_XDECREF(__pyx_v_catch_stdout);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_TraceReturn(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyMethodDef __pyx_methods[] = {
-  {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
-    PyModuleDef_HEAD_INIT,
-  #endif
-    __Pyx_NAMESTR("csamtools"),
-    0, /* m_doc */
-    -1, /* m_size */
-    __pyx_methods /* m_methods */,
-    NULL, /* m_reload */
-    NULL, /* m_traverse */
-    NULL, /* m_clear */
-    NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_u_Argument_must_be_string_bytes_or, __pyx_k_Argument_must_be_string_bytes_or, sizeof(__pyx_k_Argument_must_be_string_bytes_or), 0, 1, 0, 0},
-  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
-  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
-  {&__pyx_n_s_IS_PYTHON3, __pyx_k_IS_PYTHON3, sizeof(__pyx_k_IS_PYTHON3), 0, 0, 1, 1},
-  {&__pyx_kp_s_No_such_file_or_directory_s, __pyx_k_No_such_file_or_directory_s, sizeof(__pyx_k_No_such_file_or_directory_s), 0, 0, 1, 0},
-  {&__pyx_n_s_O_CREAT, __pyx_k_O_CREAT, sizeof(__pyx_k_O_CREAT), 0, 0, 1, 1},
-  {&__pyx_n_s_O_WRONLY, __pyx_k_O_WRONLY, sizeof(__pyx_k_O_WRONLY), 0, 0, 1, 1},
-  {&__pyx_n_s_Outs, __pyx_k_Outs, sizeof(__pyx_k_Outs), 0, 0, 1, 1},
-  {&__pyx_n_s_Outs___init, __pyx_k_Outs___init, sizeof(__pyx_k_Outs___init), 0, 0, 1, 1},
-  {&__pyx_n_s_Outs_restore, __pyx_k_Outs_restore, sizeof(__pyx_k_Outs_restore), 0, 0, 1, 1},
-  {&__pyx_n_s_Outs_setdevice, __pyx_k_Outs_setdevice, sizeof(__pyx_k_Outs_setdevice), 0, 0, 1, 1},
-  {&__pyx_n_s_Outs_setfd, __pyx_k_Outs_setfd, sizeof(__pyx_k_Outs_setfd), 0, 0, 1, 1},
-  {&__pyx_n_s_Outs_setfile, __pyx_k_Outs_setfile, sizeof(__pyx_k_Outs_setfile), 0, 0, 1, 1},
-  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
-  {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1},
-  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
-  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
-  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
-  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
-  {&__pyx_n_s_cargs, __pyx_k_cargs, sizeof(__pyx_k_cargs), 0, 0, 1, 1},
-  {&__pyx_n_s_catch_stdout, __pyx_k_catch_stdout, sizeof(__pyx_k_catch_stdout), 0, 0, 1, 1},
-  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
-  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
-  {&__pyx_n_s_dup, __pyx_k_dup, sizeof(__pyx_k_dup), 0, 0, 1, 1},
-  {&__pyx_n_s_dup2, __pyx_k_dup2, sizeof(__pyx_k_dup2), 0, 0, 1, 1},
-  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
-  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
-  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
-  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
-  {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1},
-  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
-  {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1},
-  {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
-  {&__pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_k_home_andreas_devel_pysam_pysam, sizeof(__pyx_k_home_andreas_devel_pysam_pysam), 0, 0, 1, 0},
-  {&__pyx_kp_s_http_mail_python_org_pipermail_p, __pyx_k_http_mail_python_org_pipermail_p, sizeof(__pyx_k_http_mail_python_org_pipermail_p), 0, 0, 1, 0},
-  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
-  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
-  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
-  {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
-  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
-  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
-  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
-  {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
-  {&__pyx_n_s_mkstemp, __pyx_k_mkstemp, sizeof(__pyx_k_mkstemp), 0, 0, 1, 1},
-  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
-  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
-  {&__pyx_kp_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 0},
-  {&__pyx_n_s_ofd, __pyx_k_ofd, sizeof(__pyx_k_ofd), 0, 0, 1, 1},
-  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
-  {&__pyx_kp_s_option_o_is_forbidden_in_samtool, __pyx_k_option_o_is_forbidden_in_samtool, sizeof(__pyx_k_option_o_is_forbidden_in_samtool), 0, 0, 1, 0},
-  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
-  {&__pyx_n_s_out_stderr, __pyx_k_out_stderr, sizeof(__pyx_k_out_stderr), 0, 0, 1, 1},
-  {&__pyx_n_s_out_stdout, __pyx_k_out_stdout, sizeof(__pyx_k_out_stdout), 0, 0, 1, 1},
-  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
-  {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
-  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
-  {&__pyx_n_s_pysam_csamtools, __pyx_k_pysam_csamtools, sizeof(__pyx_k_pysam_csamtools), 0, 0, 1, 1},
-  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
-  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
-  {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1},
-  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
-  {&__pyx_n_s_readlines, __pyx_k_readlines, sizeof(__pyx_k_readlines), 0, 0, 1, 1},
-  {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
-  {&__pyx_n_s_restore, __pyx_k_restore, sizeof(__pyx_k_restore), 0, 0, 1, 1},
-  {&__pyx_n_s_retval, __pyx_k_retval, sizeof(__pyx_k_retval), 0, 0, 1, 1},
-  {&__pyx_n_s_samtools_dispatch, __pyx_k_samtools_dispatch, sizeof(__pyx_k_samtools_dispatch), 0, 0, 1, 1},
-  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
-  {&__pyx_n_s_setdevice, __pyx_k_setdevice, sizeof(__pyx_k_setdevice), 0, 0, 1, 1},
-  {&__pyx_n_s_setfd, __pyx_k_setfd, sizeof(__pyx_k_setfd), 0, 0, 1, 1},
-  {&__pyx_n_s_setfile, __pyx_k_setfile, sizeof(__pyx_k_setfile), 0, 0, 1, 1},
-  {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
-  {&__pyx_n_s_stderr_f, __pyx_k_stderr_f, sizeof(__pyx_k_stderr_f), 0, 0, 1, 1},
-  {&__pyx_n_s_stderr_h, __pyx_k_stderr_h, sizeof(__pyx_k_stderr_h), 0, 0, 1, 1},
-  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
-  {&__pyx_n_s_stdout_f, __pyx_k_stdout_f, sizeof(__pyx_k_stdout_f), 0, 0, 1, 1},
-  {&__pyx_n_s_stdout_h, __pyx_k_stdout_h, sizeof(__pyx_k_stdout_h), 0, 0, 1, 1},
-  {&__pyx_n_s_stdout_save, __pyx_k_stdout_save, sizeof(__pyx_k_stdout_save), 0, 0, 1, 1},
-  {&__pyx_n_s_streams, __pyx_k_streams, sizeof(__pyx_k_streams), 0, 0, 1, 1},
-  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
-  {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
-  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
-  {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
-  {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __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);
-
-  /* "pysam/csamtools.pyx":28
- *         return s
- *     elif PyUnicode_Check(s):
- *         return s.encode('ascii')             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- */
-  __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple_);
-  __Pyx_GIVEREF(__pyx_tuple_);
-
-  /* "pysam/csamtools.pyx":121
- *         if method == "view":
- *             if "-o" in args:
- *                 raise ValueError("option -o is forbidden in samtools view")             # <<<<<<<<<<<<<<
- *             args = ( "-o", stdout_f ) + args
- * 
- */
-  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_option_o_is_forbidden_in_samtool); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__2);
-  __Pyx_GIVEREF(__pyx_tuple__2);
-
-  /* "pysam/csamtools.pyx":146
- *         stdout_save.restore()
- *         try:
- *             with open( stdout_f, "r") as inf:             # <<<<<<<<<<<<<<
- *                 out_stdout = inf.readlines()
- *         except UnicodeDecodeError:
- */
-  __pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__3);
-  __Pyx_GIVEREF(__pyx_tuple__3);
-
-  /* "pysam/csamtools.pyx":149
- *                 out_stdout = inf.readlines()
- *         except UnicodeDecodeError:
- *             with open( stdout_f, "rb") as inf:             # <<<<<<<<<<<<<<
- *                 # read binary output
- *                 out_stdout = inf.read()
- */
-  __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__4);
-  __Pyx_GIVEREF(__pyx_tuple__4);
-
-  /* "pysam/csamtools.pyx":159
- *     pysam_unset_stderr()
- *     try:
- *         with open( stderr_f, "r") as inf:             # <<<<<<<<<<<<<<
- *             out_stderr = inf.readlines()
- *     except UnicodeDecodeError:
- */
-  __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__5);
-  __Pyx_GIVEREF(__pyx_tuple__5);
-
-  /* "pysam/csamtools.pyx":162
- *             out_stderr = inf.readlines()
- *     except UnicodeDecodeError:
- *         with open( stderr_f, "rb") as inf:             # <<<<<<<<<<<<<<
- *             # read binary output
- *             out_stderr = inf.read()
- */
-  __pyx_tuple__6 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__6);
-  __Pyx_GIVEREF(__pyx_tuple__6);
-
-  /* "pysam/csamtools.pyx":39
- * class Outs:
- *     '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
- *     def __init__(self, id = 1):             # <<<<<<<<<<<<<<
- *         self.streams = []
- *         self.id = id
- */
-  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_id); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__7);
-  __Pyx_GIVEREF(__pyx_tuple__7);
-  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_init, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__9 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__9);
-  __Pyx_GIVEREF(__pyx_tuple__9);
-
-  /* "pysam/csamtools.pyx":43
- *         self.id = id
- * 
- *     def setdevice(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an existing file, like "/dev/null"'''
- *         fd = os.open(filename, os.O_WRONLY)
- */
-  __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_fd); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__10);
-  __Pyx_GIVEREF(__pyx_tuple__10);
-  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setdevice, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/csamtools.pyx":48
- *         self.setfd(fd)
- * 
- *     def setfile(self, filename):             # <<<<<<<<<<<<<<
- *         '''open a new file.'''
- *         fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660)
- */
-  __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_fd); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__12);
-  __Pyx_GIVEREF(__pyx_tuple__12);
-  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setfile, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/csamtools.pyx":53
- *         self.setfd(fd)
- * 
- *     def setfd(self, fd):             # <<<<<<<<<<<<<<
- *         ofd = os.dup(self.id)      #  Save old stream on new unit.
- *         self.streams.append(ofd)
- */
-  __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_fd, __pyx_n_s_ofd); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__14);
-  __Pyx_GIVEREF(__pyx_tuple__14);
-  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setfd, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/csamtools.pyx":61
- *         os.close(fd)                #  Close other unit (look out, caller.)
- * 
- *     def restore(self):             # <<<<<<<<<<<<<<
- *         '''restore previous output stream'''
- *         if self.streams:
- */
-  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__16);
-  __Pyx_GIVEREF(__pyx_tuple__16);
-  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_restore, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/csamtools.pyx":73
- * 
- * 
- * def _samtools_dispatch(method,             # <<<<<<<<<<<<<<
- *                        args = (),
- *                        catch_stdout = True):
- */
-  __pyx_tuple__18 = PyTuple_Pack(16, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_catch_stdout, __pyx_n_s_stderr_h, __pyx_n_s_stderr_f, __pyx_n_s_stdout_h, __pyx_n_s_stdout_f, __pyx_n_s_stdout_save, __pyx_n_s_cargs, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_retval, __pyx_n_s_inf, __pyx_n_s_out_stdout, __pyx_n_s_out_stderr, __pyx_n_s_a); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__18);
-  __Pyx_GIVEREF(__pyx_tuple__18);
-  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 16, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_samtools_dispatch, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __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_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_432 = PyInt_FromLong(432); if (unlikely(!__pyx_int_432)) {__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 initcsamtools(void); /*proto*/
-PyMODINIT_FUNC initcsamtools(void)
-#else
-PyMODINIT_FUNC PyInit_csamtools(void); /*proto*/
-PyMODINIT_FUNC PyInit_csamtools(void)
-#endif
-{
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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_csamtools(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("csamtools"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
-  #else
-  __pyx_m = PyModule_Create(&__pyx_moduledef);
-  #endif
-  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_d);
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  if (__pyx_module_is_main_pysam__csamtools) {
-    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;};
-  }
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pysam.csamtools")) {
-      if (unlikely(PyDict_SetItemString(modules, "pysam.csamtools", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  /*--- Builtin init code ---*/
-  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Constants init code ---*/
-  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Global init code ---*/
-  /*--- Variable export code ---*/
-  /*--- Function export code ---*/
-  /*--- Type init code ---*/
-  /*--- Type import code ---*/
-  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
-  #if CYTHON_COMPILING_IN_PYPY
-  sizeof(PyTypeObject),
-  #else
-  sizeof(PyHeapTypeObject),
-  #endif
-  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Variable import code ---*/
-  /*--- Function import code ---*/
-  /*--- Execution code ---*/
-
-  /* "pysam/csamtools.pyx":4
- * # cython: profile=True
- * # adds doc-strings for sphinx
- * import tempfile             # <<<<<<<<<<<<<<
- * import os
- * import sys
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_tempfile, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":5
- * # adds doc-strings for sphinx
- * import tempfile
- * import os             # <<<<<<<<<<<<<<
- * import sys
- * import platform
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":6
- * import tempfile
- * import os
- * import sys             # <<<<<<<<<<<<<<
- * import platform
- * from cpython cimport PyBytes_Check, PyUnicode_Check
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":7
- * import os
- * import sys
- * import platform             # <<<<<<<<<<<<<<
- * from cpython cimport PyBytes_Check, PyUnicode_Check
- * from cpython.version cimport PY_MAJOR_VERSION
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_platform, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":16
- * ## Python 3 compatibility functions
- * ########################################################################
- * IS_PYTHON3 = PY_MAJOR_VERSION >= 3             # <<<<<<<<<<<<<<
- * 
- * cdef bytes _forceBytes(object s):
- */
-  __pyx_t_1 = __Pyx_PyBool_FromLong((PY_MAJOR_VERSION >= 3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IS_PYTHON3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":37
- * 
- * 
- * class Outs:             # <<<<<<<<<<<<<<
- *     '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
- *     def __init__(self, id = 1):
- */
-  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Outs, __pyx_n_s_Outs, (PyObject *) NULL, __pyx_n_s_pysam_csamtools, __pyx_kp_s_http_mail_python_org_pipermail_p); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/csamtools.pyx":39
- * class Outs:
- *     '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
- *     def __init__(self, id = 1):             # <<<<<<<<<<<<<<
- *         self.streams = []
- *         self.id = id
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_9csamtools_4Outs_1__init__, 0, __pyx_n_s_Outs___init, NULL, __pyx_n_s_pysam_csamtools, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__9);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/csamtools.pyx":43
- *         self.id = id
- * 
- *     def setdevice(self, filename):             # <<<<<<<<<<<<<<
- *         '''open an existing file, like "/dev/null"'''
- *         fd = os.open(filename, os.O_WRONLY)
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_9csamtools_4Outs_3setdevice, 0, __pyx_n_s_Outs_setdevice, NULL, __pyx_n_s_pysam_csamtools, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_setdevice, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/csamtools.pyx":48
- *         self.setfd(fd)
- * 
- *     def setfile(self, filename):             # <<<<<<<<<<<<<<
- *         '''open a new file.'''
- *         fd = os.open(filename, os.O_WRONLY|os.O_CREAT, 0660)
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_9csamtools_4Outs_5setfile, 0, __pyx_n_s_Outs_setfile, NULL, __pyx_n_s_pysam_csamtools, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__13)); 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 (PyObject_SetItem(__pyx_t_1, __pyx_n_s_setfile, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/csamtools.pyx":53
- *         self.setfd(fd)
- * 
- *     def setfd(self, fd):             # <<<<<<<<<<<<<<
- *         ofd = os.dup(self.id)      #  Save old stream on new unit.
- *         self.streams.append(ofd)
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_9csamtools_4Outs_7setfd, 0, __pyx_n_s_Outs_setfd, NULL, __pyx_n_s_pysam_csamtools, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_setfd, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/csamtools.pyx":61
- *         os.close(fd)                #  Close other unit (look out, caller.)
- * 
- *     def restore(self):             # <<<<<<<<<<<<<<
- *         '''restore previous output stream'''
- *         if self.streams:
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_9csamtools_4Outs_9restore, 0, __pyx_n_s_Outs_restore, NULL, __pyx_n_s_pysam_csamtools, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__17)); 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);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_restore, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/csamtools.pyx":37
- * 
- * 
- * class Outs:             # <<<<<<<<<<<<<<
- *     '''http://mail.python.org/pipermail/python-list/2000-June/038406.html'''
- *     def __init__(self, id = 1):
- */
-  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Outs, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Outs, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":73
- * 
- * 
- * def _samtools_dispatch(method,             # <<<<<<<<<<<<<<
- *                        args = (),
- *                        catch_stdout = True):
- */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysam_9csamtools_1_samtools_dispatch, NULL, __pyx_n_s_pysam_csamtools); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_samtools_dispatch, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/csamtools.pyx":1
- * # cython: embedsignature=True             # <<<<<<<<<<<<<<
- * # cython: profile=True
- * # adds doc-strings for sphinx
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  if (__pyx_m) {
-    __Pyx_AddTraceback("init pysam.csamtools", __pyx_clineno, __pyx_lineno, __pyx_filename);
-    Py_DECREF(__pyx_m); __pyx_m = 0;
-  } else if (!PyErr_Occurred()) {
-    PyErr_SetString(PyExc_ImportError, "init pysam.csamtools");
-  }
-  __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_GetBuiltinName(PyObject *name) {
-    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
-    if (unlikely(!result)) {
-        PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
-            "name '%U' is not defined", name);
-#else
-            "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
-    }
-    return result;
-}
-
-#if CYTHON_PROFILE
-static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
-                                   PyFrameObject** frame,
-                                   const char *funcname,
-                                   const char *srcfile,
-                                   int firstlineno) {
-    int retval;
-    PyThreadState* tstate = PyThreadState_GET();
-    if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
-        if (*code == NULL) {
-            *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
-            if (*code == NULL) return 0;
-        }
-        *frame = PyFrame_New(
-            tstate,                          /*PyThreadState *tstate*/
-            *code,                           /*PyCodeObject *code*/
-            __pyx_d,                  /*PyObject *globals*/
-            0                                /*PyObject *locals*/
-        );
-        if (*frame == NULL) return 0;
-        if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
-            Py_INCREF(Py_None);
-            (*frame)->f_trace = Py_None;
-        }
-#if PY_VERSION_HEX < 0x030400B1
-    } else {
-        (*frame)->f_tstate = tstate;
-#endif
-    }
-    (*frame)->f_lineno = firstlineno;
-    tstate->use_tracing = 0;
-    #if CYTHON_TRACE
-    if (tstate->c_tracefunc)
-        tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL);
-    if (!tstate->c_profilefunc)
-        retval = 1;
-    else
-    #endif
-        retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
-    tstate->use_tracing = (tstate->c_profilefunc ||
-                           (CYTHON_TRACE && tstate->c_tracefunc));
-    return tstate->use_tracing && retval;
-}
-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 */
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyObject *result;
-    ternaryfunc call = func->ob_type->tp_call;
-    if (unlikely(!call))
-        return PyObject_Call(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
-        return NULL;
-#endif
-    result = (*call)(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    Py_LeaveRecursiveCall();
-#endif
-    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
-        PyErr_SetString(
-            PyExc_SystemError,
-            "NULL result without error in PyObject_Call");
-    }
-    return result;
-}
-#endif
-
-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);
-    if (!value || value == Py_None)
-        value = NULL;
-    else
-        Py_INCREF(value);
-    if (!tb || tb == Py_None)
-        tb = NULL;
-    else {
-        Py_INCREF(tb);
-        if (!PyTraceBack_Check(tb)) {
-            PyErr_SetString(PyExc_TypeError,
-                "raise: arg 3 must be a traceback or None");
-            goto raise_error;
-        }
-    }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
-    if (PyType_Check(type)) {
-    #endif
-#if CYTHON_COMPILING_IN_PYPY
-        if (!value) {
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-#endif
-        PyErr_NormalizeException(&type, &value, &tb);
-    } else {
-        if (value) {
-            PyErr_SetString(PyExc_TypeError,
-                "instance exception may not have a separate value");
-            goto raise_error;
-        }
-        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) {
-    PyObject* owned_instance = NULL;
-    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)) {
-        PyObject *instance_class = NULL;
-        if (value && PyExceptionInstance_Check(value)) {
-            instance_class = (PyObject*) Py_TYPE(value);
-            if (instance_class != type) {
-                if (PyObject_IsSubclass(instance_class, type)) {
-                    type = instance_class;
-                } else {
-                    instance_class = NULL;
-                }
-            }
-        }
-        if (!instance_class) {
-            PyObject *args;
-            if (!value)
-                args = PyTuple_New(0);
-            else if (PyTuple_Check(value)) {
-                Py_INCREF(value);
-                args = value;
-            } else
-                args = PyTuple_Pack(1, value);
-            if (!args)
-                goto bad;
-            owned_instance = PyObject_Call(type, args, NULL);
-            Py_DECREF(args);
-            if (!owned_instance)
-                goto bad;
-            value = owned_instance;
-            if (!PyExceptionInstance_Check(value)) {
-                PyErr_Format(PyExc_TypeError,
-                             "calling %R should have returned an instance of "
-                             "BaseException, not %R",
-                             type, Py_TYPE(value));
-                goto bad;
-            }
-        }
-    } else {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: exception class must be a subclass of BaseException");
-        goto bad;
-    }
-#if PY_VERSION_HEX >= 0x03030000
-    if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
-        PyObject *fixed_cause;
-        if (cause == Py_None) {
-            fixed_cause = NULL;
-        } else 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;
-        }
-        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:
-    Py_XDECREF(owned_instance);
-    return;
-}
-#endif
-
-static void __Pyx_RaiseDoubleKeywordsError(
-    const char* func_name,
-    PyObject* kw_name)
-{
-    PyErr_Format(PyExc_TypeError,
-        #if PY_MAJOR_VERSION >= 3
-        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
-        #else
-        "%s() got multiple values for keyword argument '%s'", func_name,
-        PyString_AsString(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;
-            continue;
-        }
-        name = first_kw_arg;
-        #if PY_MAJOR_VERSION < 3
-        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
-            while (*name) {
-                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
-                        && _PyString_Eq(**name, key)) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    if ((**argname == key) || (
-                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
-                             && _PyString_Eq(**argname, key))) {
-                        goto arg_passed_twice;
-                    }
-                    argname++;
-                }
-            }
-        } else
-        #endif
-        if (likely(PyUnicode_Check(key))) {
-            while (*name) {
-                int cmp = (**name == key) ? 0 :
-                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
-                #endif
-                    PyUnicode_Compare(**name, key);
-                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                if (cmp == 0) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    int cmp = (**argname == key) ? 0 :
-                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
-                    #endif
-                        PyUnicode_Compare(**argname, key);
-                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                    if (cmp == 0) goto arg_passed_twice;
-                    argname++;
-                }
-            }
-        } else
-            goto invalid_keyword_type;
-        if (kwds2) {
-            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
-        } else {
-            goto invalid_keyword;
-        }
-    }
-    return 0;
-arg_passed_twice:
-    __Pyx_RaiseDoubleKeywordsError(function_name, key);
-    goto bad;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    goto bad;
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-bad:
-    return -1;
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
-    const char* func_name,
-    int exact,
-    Py_ssize_t num_min,
-    Py_ssize_t num_max,
-    Py_ssize_t num_found)
-{
-    Py_ssize_t num_expected;
-    const char *more_or_less;
-    if (num_found < num_min) {
-        num_expected = num_min;
-        more_or_less = "at least";
-    } else {
-        num_expected = num_max;
-        more_or_less = "at most";
-    }
-    if (exact) {
-        more_or_less = "exactly";
-    }
-    PyErr_Format(PyExc_TypeError,
-                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
-                 func_name, more_or_less, num_expected,
-                 (num_expected == 1) ? "" : "s", num_found);
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
-    PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
-    result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
-        Py_INCREF(result);
-    } else {
-#else
-    result = PyObject_GetItem(__pyx_d, name);
-    if (!result) {
-        PyErr_Clear();
-#endif
-        result = __Pyx_GetBuiltinName(name);
-    }
-    return result;
-}
-
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
-    if (likely(PyList_CheckExact(L))) {
-        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
-    } else {
-        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
-        if (unlikely(!retval))
-            return -1;
-        Py_DECREF(retval);
-    }
-    return 0;
-}
-
-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;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        PyObject *r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        PyObject *r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (is_list || PyList_CheckExact(o)) {
-        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if ((!boundscheck) || (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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
-        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    } else {
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_item)) {
-            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (likely(l >= 0)) {
-                    i += l;
-                } else {
-                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                        PyErr_Clear();
-                    else
-                        return NULL;
-                }
-            }
-            return m->sq_item(o, i);
-        }
-    }
-#else
-    if (is_list || PySequence_Check(o)) {
-        return PySequence_GetItem(o, i);
-    }
-#endif
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
-    int r;
-    if (!j) return -1;
-    r = PyObject_DelItem(o, j);
-    Py_DECREF(j);
-    return r;
-}
-static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                               CYTHON_UNUSED int is_list, int wraparound) {
-#if CYTHON_COMPILING_IN_PYPY
-    if (is_list || PySequence_Check(o)) {
-        return PySequence_DelItem(o, i);
-    }
-#else
-    PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-    if (likely(m && m->sq_ass_item)) {
-        if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
-            Py_ssize_t l = m->sq_length(o);
-            if (likely(l >= 0)) {
-                i += l;
-            } else {
-                if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                    PyErr_Clear();
-                else
-                    return -1;
-            }
-        }
-        return m->sq_ass_item(o, i, (PyObject *)NULL);
-    }
-#endif
-    return __Pyx_DelItem_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-    if (s1 == s2) {
-        return (equals == Py_EQ);
-    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
-        const char *ps1, *ps2;
-        Py_ssize_t length = PyBytes_GET_SIZE(s1);
-        if (length != PyBytes_GET_SIZE(s2))
-            return (equals == Py_NE);
-        ps1 = PyBytes_AS_STRING(s1);
-        ps2 = PyBytes_AS_STRING(s2);
-        if (ps1[0] != ps2[0]) {
-            return (equals == Py_NE);
-        } else if (length == 1) {
-            return (equals == Py_EQ);
-        } else {
-            int result = memcmp(ps1, ps2, (size_t)length);
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
-        return (equals == Py_NE);
-    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
-        return (equals == Py_NE);
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-#endif
-}
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-#if PY_MAJOR_VERSION < 3
-    PyObject* owned_ref = NULL;
-#endif
-    int s1_is_unicode, s2_is_unicode;
-    if (s1 == s2) {
-        goto return_eq;
-    }
-    s1_is_unicode = PyUnicode_CheckExact(s1);
-    s2_is_unicode = PyUnicode_CheckExact(s2);
-#if PY_MAJOR_VERSION < 3
-    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
-        owned_ref = PyUnicode_FromObject(s2);
-        if (unlikely(!owned_ref))
-            return -1;
-        s2 = owned_ref;
-        s2_is_unicode = 1;
-    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
-        owned_ref = PyUnicode_FromObject(s1);
-        if (unlikely(!owned_ref))
-            return -1;
-        s1 = owned_ref;
-        s1_is_unicode = 1;
-    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
-        return __Pyx_PyBytes_Equals(s1, s2, equals);
-    }
-#endif
-    if (s1_is_unicode & s2_is_unicode) {
-        Py_ssize_t length;
-        int kind;
-        void *data1, *data2;
-        #if CYTHON_PEP393_ENABLED
-        if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
-            return -1;
-        #endif
-        length = __Pyx_PyUnicode_GET_LENGTH(s1);
-        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
-            goto return_ne;
-        }
-        kind = __Pyx_PyUnicode_KIND(s1);
-        if (kind != __Pyx_PyUnicode_KIND(s2)) {
-            goto return_ne;
-        }
-        data1 = __Pyx_PyUnicode_DATA(s1);
-        data2 = __Pyx_PyUnicode_DATA(s2);
-        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
-            goto return_ne;
-        } else if (length == 1) {
-            goto return_eq;
-        } else {
-            int result = memcmp(data1, data2, length * kind);
-            #if PY_MAJOR_VERSION < 3
-            Py_XDECREF(owned_ref);
-            #endif
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & s2_is_unicode) {
-        goto return_ne;
-    } else if ((s2 == Py_None) & s1_is_unicode) {
-        goto return_ne;
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-return_eq:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_EQ);
-return_ne:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_NE);
-#endif
-}
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
-    PyErr_Format(PyExc_ValueError,
-                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
-    PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
-                 index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyThreadState *tstate = PyThreadState_GET();
-    PyObject* exc_type = tstate->curexc_type;
-    if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
-            PyObject *exc_value, *exc_tb;
-            exc_value = tstate->curexc_value;
-            exc_tb = tstate->curexc_traceback;
-            tstate->curexc_type = 0;
-            tstate->curexc_value = 0;
-            tstate->curexc_traceback = 0;
-            Py_DECREF(exc_type);
-            Py_XDECREF(exc_value);
-            Py_XDECREF(exc_tb);
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#endif
-}
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
-    if (unlikely(retval)) {
-        Py_DECREF(retval);
-        __Pyx_RaiseTooManyValuesError(expected);
-        return -1;
-    } else {
-        return __Pyx_IterFinish();
-    }
-    return 0;
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    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);
-#else
-    PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(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->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);
-#else
-    PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
-    PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
-    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (unlikely(tstate->curexc_type))
-#else
-    if (unlikely(PyErr_Occurred()))
-#endif
-        goto bad;
-    #if PY_MAJOR_VERSION >= 3
-    if (local_tb) {
-        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
-            goto bad;
-    }
-    #endif
-    Py_XINCREF(local_tb);
-    Py_XINCREF(local_type);
-    Py_XINCREF(local_value);
-    *type = local_type;
-    *value = local_value;
-    *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-    Py_XDECREF(tmp_type);
-    Py_XDECREF(tmp_value);
-    Py_XDECREF(tmp_tb);
-#else
-    PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
-    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_RaiseUnboundLocalError(const char *varname) {
-    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
-    PyObject *tmp_type, *tmp_value, *tmp_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
-    PyErr_SetExcInfo(*type, *value, *tb);
-#endif
-    *type = tmp_type;
-    *value = tmp_value;
-    *tb = tmp_tb;
-}
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
-    PyObject* fake_module;
-    PyTypeObject* cached_type = NULL;
-    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
-    if (!fake_module) return NULL;
-    Py_INCREF(fake_module);
-    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
-    if (cached_type) {
-        if (!PyType_Check((PyObject*)cached_type)) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s is not a type object",
-                type->tp_name);
-            goto bad;
-        }
-        if (cached_type->tp_basicsize != type->tp_basicsize) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s has the wrong size, try recompiling",
-                type->tp_name);
-            goto bad;
-        }
-    } else {
-        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
-        PyErr_Clear();
-        if (PyType_Ready(type) < 0) goto bad;
-        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
-            goto bad;
-        Py_INCREF(type);
-        cached_type = type;
-    }
-done:
-    Py_DECREF(fake_module);
-    return cached_type;
-bad:
-    Py_XDECREF(cached_type);
-    cached_type = NULL;
-    goto done;
-}
-
-static PyObject *
-__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
-{
-    if (unlikely(op->func_doc == NULL)) {
-        if (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 (unlikely(op->func_doc == NULL))
-                return NULL;
-        } else {
-            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)
-        value = Py_None; /* Mark as deleted */
-    Py_INCREF(value);
-    op->func_doc = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
-{
-    if (unlikely(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
-        if (unlikely(op->func_name == NULL))
-            return NULL;
-    }
-    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 (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
-    if (unlikely(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_qualname(__pyx_CyFunctionObject *op)
-{
-    Py_INCREF(op->func_qualname);
-    return op->func_qualname;
-}
-static int
-__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
-{
-    PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
-    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
-    if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
-        PyErr_SetString(PyExc_TypeError,
-                        "__qualname__ must be set to a string object");
-        return -1;
-    }
-    tmp = op->func_qualname;
-    Py_INCREF(value);
-    op->func_qualname = 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 (unlikely(op->func_dict == NULL)) {
-        op->func_dict = PyDict_New();
-        if (unlikely(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 (unlikely(value == NULL)) {
-        PyErr_SetString(PyExc_TypeError,
-               "function's dictionary may not be deleted");
-        return -1;
-    }
-    if (unlikely(!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(__pyx_CyFunctionObject *op)
-{
-    Py_INCREF(op->func_globals);
-    return op->func_globals;
-}
-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 int
-__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
-    PyObject *res = op->defaults_getter((PyObject *) op);
-    if (unlikely(!res))
-        return -1;
-    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
-    Py_INCREF(op->defaults_tuple);
-    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
-    Py_INCREF(op->defaults_kwdict);
-    Py_DECREF(res);
-    return 0;
-}
-static int
-__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value) {
-        value = Py_None;
-    } else if (value != Py_None && !PyTuple_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__defaults__ must be set to a tuple object");
-        return -1;
-    }
-    Py_INCREF(value);
-    tmp = op->defaults_tuple;
-    op->defaults_tuple = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->defaults_tuple;
-    if (unlikely(!result)) {
-        if (op->defaults_getter) {
-            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
-            result = op->defaults_tuple;
-        } else {
-            result = Py_None;
-        }
-    }
-    Py_INCREF(result);
-    return result;
-}
-static int
-__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value) {
-        value = Py_None;
-    } else if (value != Py_None && !PyDict_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__kwdefaults__ must be set to a dict object");
-        return -1;
-    }
-    Py_INCREF(value);
-    tmp = op->defaults_kwdict;
-    op->defaults_kwdict = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->defaults_kwdict;
-    if (unlikely(!result)) {
-        if (op->defaults_getter) {
-            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
-            result = op->defaults_kwdict;
-        } else {
-            result = Py_None;
-        }
-    }
-    Py_INCREF(result);
-    return result;
-}
-static int
-__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value || value == Py_None) {
-        value = NULL;
-    } else if (!PyDict_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__annotations__ must be set to a dict object");
-        return -1;
-    }
-    Py_XINCREF(value);
-    tmp = op->func_annotations;
-    op->func_annotations = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->func_annotations;
-    if (unlikely(!result)) {
-        result = PyDict_New();
-        if (unlikely(!result)) return NULL;
-        op->func_annotations = result;
-    }
-    Py_INCREF(result);
-    return result;
-}
-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 *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 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, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
-    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
-    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
-    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 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* qualname,
-                                      PyObject *closure, PyObject *module, PyObject* globals, 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;
-    Py_INCREF(qualname);
-    op->func_qualname = qualname;
-    op->func_doc = NULL;
-    op->func_classobj = NULL;
-    op->func_globals = globals;
-    Py_INCREF(op->func_globals);
-    Py_XINCREF(code);
-    op->func_code = code;
-    op->defaults_pyobjects = 0;
-    op->defaults = NULL;
-    op->defaults_tuple = NULL;
-    op->defaults_kwdict = NULL;
-    op->defaults_getter = NULL;
-    op->func_annotations = 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_qualname);
-    Py_CLEAR(m->func_doc);
-    Py_CLEAR(m->func_globals);
-    Py_CLEAR(m->func_code);
-    Py_CLEAR(m->func_classobj);
-    Py_CLEAR(m->defaults_tuple);
-    Py_CLEAR(m->defaults_kwdict);
-    Py_CLEAR(m->func_annotations);
-    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_qualname);
-    Py_VISIT(m->func_doc);
-    Py_VISIT(m->func_globals);
-    Py_VISIT(m->func_code);
-    Py_VISIT(m->func_classobj);
-    Py_VISIT(m->defaults_tuple);
-    Py_VISIT(m->defaults_kwdict);
-    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)
-{
-#if PY_MAJOR_VERSION >= 3
-    return PyUnicode_FromFormat("<cyfunction %U at %p>",
-                                op->func_qualname, (void *)op);
-#else
-    return PyString_FromFormat("<cyfunction %s at %p>",
-                               PyString_AsString(op->func_qualname), (void *)op);
-#endif
-}
-#if CYTHON_COMPILING_IN_PYPY
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyCFunctionObject* f = (PyCFunctionObject*)func;
-    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
-    PyObject *self = PyCFunction_GET_SELF(func);
-    Py_ssize_t size;
-    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
-    case METH_VARARGS:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
-            return (*meth)(self, arg);
-        break;
-    case METH_VARARGS | METH_KEYWORDS:
-        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
-    case METH_NOARGS:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
-            size = PyTuple_GET_SIZE(arg);
-            if (size == 0)
-                return (*meth)(self, NULL);
-            PyErr_Format(PyExc_TypeError,
-                "%.200s() takes no arguments (%zd given)",
-                f->m_ml->ml_name, size);
-            return NULL;
-        }
-        break;
-    case METH_O:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
-            size = PyTuple_GET_SIZE(arg);
-            if (size == 1)
-                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
-            PyErr_Format(PyExc_TypeError,
-                "%.200s() takes exactly one argument (%zd given)",
-                f->m_ml->ml_name, size);
-            return NULL;
-        }
-        break;
-    default:
-        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
-                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
-                        "longer supported!");
-        return NULL;
-    }
-    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
-                 f->m_ml->ml_name);
-    return NULL;
-}
-#else
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-	return PyCFunction_Call(func, arg, kw);
-}
-#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_CyFunction_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
-#if PY_VERSION_HEX >= 0x030400a1
-    0,                                  /*tp_finalize*/
-#endif
-};
-static int __Pyx_CyFunction_init(void) {
-#if !CYTHON_COMPILING_IN_PYPY
-    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
-#endif
-    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
-        return -1;
-    }
-    return 0;
-}
-static CYTHON_INLINE 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, size);
-    m->defaults_pyobjects = pyobjects;
-    return m->defaults;
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->defaults_tuple = tuple;
-    Py_INCREF(tuple);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->defaults_kwdict = dict;
-    Py_INCREF(dict);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->func_annotations = dict;
-    Py_INCREF(dict);
-}
-
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
-    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
-    for (i=0; i < nbases; i++) {
-        PyTypeObject *tmptype;
-        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
-        tmptype = Py_TYPE(tmp);
-#if PY_MAJOR_VERSION < 3
-        if (tmptype == &PyClass_Type)
-            continue;
-#endif
-        if (!metaclass) {
-            metaclass = tmptype;
-            continue;
-        }
-        if (PyType_IsSubtype(metaclass, tmptype))
-            continue;
-        if (PyType_IsSubtype(tmptype, metaclass)) {
-            metaclass = tmptype;
-            continue;
-        }
-        PyErr_SetString(PyExc_TypeError,
-                        "metaclass conflict: "
-                        "the metaclass of a derived class "
-                        "must be a (non-strict) subclass "
-                        "of the metaclasses of all its bases");
-        return NULL;
-    }
-    if (!metaclass) {
-#if PY_MAJOR_VERSION < 3
-        metaclass = &PyClass_Type;
-#else
-        metaclass = &PyType_Type;
-#endif
-    }
-    Py_INCREF((PyObject*) metaclass);
-    return (PyObject*) metaclass;
-}
-
-static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
-                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
-    PyObject *ns;
-    if (metaclass) {
-        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
-        if (prep) {
-            PyObject *pargs = PyTuple_Pack(2, name, bases);
-            if (unlikely(!pargs)) {
-                Py_DECREF(prep);
-                return NULL;
-            }
-            ns = PyObject_Call(prep, pargs, mkw);
-            Py_DECREF(prep);
-            Py_DECREF(pargs);
-        } else {
-            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
-                return NULL;
-            PyErr_Clear();
-            ns = PyDict_New();
-        }
-    } else {
-        ns = PyDict_New();
-    }
-    if (unlikely(!ns))
-        return NULL;
-    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
-    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
-    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
-    return ns;
-bad:
-    Py_DECREF(ns);
-    return NULL;
-}
-static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
-                                      PyObject *dict, PyObject *mkw,
-                                      int calculate_metaclass, int allow_py2_metaclass) {
-    PyObject *result, *margs;
-    PyObject *owned_metaclass = NULL;
-    if (allow_py2_metaclass) {
-        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
-        if (owned_metaclass) {
-            metaclass = owned_metaclass;
-        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
-            PyErr_Clear();
-        } else {
-            return NULL;
-        }
-    }
-    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
-        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
-        Py_XDECREF(owned_metaclass);
-        if (unlikely(!metaclass))
-            return NULL;
-        owned_metaclass = metaclass;
-    }
-    margs = PyTuple_Pack(3, name, bases, dict);
-    if (unlikely(!margs)) {
-        result = NULL;
-    } else {
-        result = PyObject_Call(metaclass, margs, mkw);
-        Py_DECREF(margs);
-    }
-    Py_XDECREF(owned_metaclass);
-    return result;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
-    PyObject *empty_list = 0;
-    PyObject *module = 0;
-    PyObject *global_dict = 0;
-    PyObject *empty_dict = 0;
-    PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
-    PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
-    if (!py_import)
-        goto bad;
-    #endif
-    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, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                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);
-                #else
-                module = PyImport_ImportModuleLevelObject(
-                    name, global_dict, empty_dict, list, 1);
-                #endif
-                if (!module) {
-                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
-                        goto bad;
-                    PyErr_Clear();
-                }
-            }
-            level = 0; /* try absolute import on failure */
-        }
-        #endif
-        if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
-            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
-            module = PyImport_ImportModuleLevelObject(
-                name, global_dict, empty_dict, list, level);
-            #endif
-        }
-    }
-    #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:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(long) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(long) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(long),
-                                     little, !is_unsigned);
-    }
-}
-
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
-    {                                                                     \
-        func_type value = func(x);                                        \
-        if (sizeof(target_type) < sizeof(func_type)) {                    \
-            if (unlikely(value != (func_type) (target_type) value)) {     \
-                func_type zero = 0;                                       \
-                PyErr_SetString(PyExc_OverflowError,                      \
-                    (is_unsigned && unlikely(value < zero)) ?             \
-                    "can't convert negative value to " #target_type :     \
-                    "value too large to convert to " #target_type);       \
-                return (target_type) -1;                                  \
-            }                                                             \
-        }                                                                 \
-        return (target_type) value;                                       \
-    }
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            return (int) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            if (sizeof(int) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
-            } else if (sizeof(int) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int) -1;
-        }
-    } else {
-        int val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int) -1;
-        val = __Pyx_PyInt_As_int(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int),
-                                     little, !is_unsigned);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(long) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long) -1;
-            }
-            if (sizeof(long) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(long) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(long) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
-            } else if (sizeof(long) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            long val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (long) -1;
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long) -1;
-        val = __Pyx_PyInt_As_long(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-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;
-}
-
-#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
-
-#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_ssize_t basicsize;
-#ifdef Py_LIMITED_API
-    PyObject *py_basicsize;
-#endif
-    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,
-            "%.200s.%.200s is not a type object",
-            module_name, class_name);
-        goto bad;
-    }
-#ifndef Py_LIMITED_API
-    basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
-    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
-    if (!py_basicsize)
-        goto bad;
-    basicsize = PyLong_AsSsize_t(py_basicsize);
-    Py_DECREF(py_basicsize);
-    py_basicsize = 0;
-    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
-        goto bad;
-#endif
-    if (!strict && (size_t)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)basicsize != size) {
-        PyErr_Format(PyExc_ValueError,
-            "%.200s.%.200s 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
-
-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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
-    Py_ssize_t ignore;
-    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
-            }
-        }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-        return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
-    } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
-#if !CYTHON_COMPILING_IN_PYPY
-#if PY_VERSION_HEX >= 0x02060000
-    if (PyByteArray_Check(o)) {
-        *length = PyByteArray_GET_SIZE(o);
-        return PyByteArray_AS_STRING(o);
-    } else
-#endif
-#endif
-    {
-        char* result;
-        int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (unlikely(r < 0)) {
-            return NULL;
-        } else {
-            return result;
-        }
-    }
-}
-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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
-    if (!PyLong_Check(res)) {
-#endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (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;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
-  Py_ssize_t ival;
-  PyObject *x;
-#if PY_MAJOR_VERSION < 3
-  if (likely(PyInt_CheckExact(b)))
-      return PyInt_AS_LONG(b);
-#endif
-  if (likely(PyLong_CheckExact(b))) {
-    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-     #if CYTHON_USE_PYLONG_INTERNALS
-       switch (Py_SIZE(b)) {
-       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
-       case  0: return 0;
-       case  1: return ((PyLongObject*)b)->ob_digit[0];
-       }
-     #endif
-    #endif
-  #if PY_VERSION_HEX < 0x02060000
-    return PyInt_AsSsize_t(b);
-  #else
-    return PyLong_AsSsize_t(b);
-  #endif
-  }
-  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
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/pysam/ctabix.c b/pysam/ctabix.c
deleted file mode 100644
index 266f5cc..0000000
--- a/pysam/ctabix.c
+++ /dev/null
@@ -1,15462 +0,0 @@
-/* Generated by Cython 0.20.1 on Fri Nov 21 19:49:04 2014 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#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
-#define CYTHON_ABI "0_20_1"
-#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 Py_OptimizeFlag 0
-#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 CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #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"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-  #define __Pyx_DefaultClassType PyClass_Type
-#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)
-  #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #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 < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
-  #define Py_TPFLAGS_IS_ABSTRACT 0
-#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
-  #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
-  #define CYTHON_PEP393_ENABLED 1
-  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
-                                              0 : _PyUnicode_Ready((PyObject *)(op)))
-  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
-  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
-  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
-  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
-  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
-#else
-  #define CYTHON_PEP393_ENABLED 0
-  #define __Pyx_PyUnicode_READY(op)       (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]))
-  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
-  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
-  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
-#else
-  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
-      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
-#else
-  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
-#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_MAJOR_VERSION >= 3
-  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
-  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#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
-  #define PyNumber_Int                 PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyBoolObject                 PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x030200A4
-  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
-#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
-#ifndef CYTHON_RESTRICT
-  #if defined(__GNUC__)
-    #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER) && _MSC_VER >= 1400
-    #define CYTHON_RESTRICT __restrict
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_RESTRICT restrict
-  #else
-    #define CYTHON_RESTRICT
-  #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
-  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
-   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
-   a quiet NaN. */
-  float value;
-  memset(&value, 0xFF, sizeof(value));
-  return value;
-}
-#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__pysam__ctabix
-#define __PYX_HAVE_API__pysam__ctabix
-#include "stdint.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
-#include "fcntl.h"
-#include "unistd.h"
-#include "zlib.h"
-#include "htslib/kstring.h"
-#include "htslib/hfile.h"
-#include "htslib/bgzf.h"
-#include "htslib/hts.h"
-#include "htslib/sam.h"
-#include "pysam_stream.h"
-#include "htslib/faidx.h"
-#include "htslib/tbx.h"
-#include "errno.h"
-#include "pythread.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#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 Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
-    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
-    (sizeof(type) > sizeof(Py_ssize_t) &&               \
-          likely(v < (type)PY_SSIZE_T_MAX ||            \
-                 v == (type)PY_SSIZE_T_MAX)  &&         \
-          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
-                                v == (type)PY_SSIZE_T_MIN)))  ||  \
-    (sizeof(type) == sizeof(Py_ssize_t) &&              \
-          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
-                               v == (type)PY_SSIZE_T_MAX)))  )
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString        PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
-    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
-    const Py_UNICODE *u_end = u;
-    while (*u_end++) ;
-    return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
-#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);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    PyObject* ascii_chars_u = NULL;
-    PyObject* ascii_chars_b = NULL;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
-        __Pyx_sys_getdefaultencoding_not_ascii = 0;
-    } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
-        char ascii_chars[128];
-        int c;
-        for (c = 0; c < 128; c++) {
-            ascii_chars[c] = c;
-        }
-        __Pyx_sys_getdefaultencoding_not_ascii = 1;
-        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
-        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
-            PyErr_Format(
-                PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
-                default_encoding_c);
-            goto bad;
-        }
-    }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    char* default_encoding_c;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
-    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
-    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
-    Py_DECREF(default_encoding);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    return -1;
-}
-#endif
-#endif
-
-
-#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_d;
-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[] = {
-  "ctabix.pyx",
-  "type.pxd",
-  "bool.pxd",
-  "complex.pxd",
-  "TabProxies.pxd",
-};
-
-/*--- Type declarations ---*/
-struct __pyx_obj_5pysam_10TabProxies_TupleProxy;
-struct __pyx_obj_5pysam_10TabProxies_GTFProxy;
-struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy;
-struct __pyx_obj_5pysam_10TabProxies_BedProxy;
-struct __pyx_obj_5pysam_10TabProxies_VCFProxy;
-struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator;
-struct __pyx_obj_5pysam_6ctabix_TabixFile;
-struct __pyx_obj_5pysam_6ctabix_Parser;
-struct __pyx_obj_5pysam_6ctabix_asTuple;
-struct __pyx_obj_5pysam_6ctabix_asGTF;
-struct __pyx_obj_5pysam_6ctabix_asBed;
-struct __pyx_obj_5pysam_6ctabix_asVCF;
-struct __pyx_obj_5pysam_6ctabix_TabixIterator;
-struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed;
-struct __pyx_obj_5pysam_6ctabix_GZIterator;
-struct __pyx_obj_5pysam_6ctabix_GZIteratorHead;
-struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed;
-struct __pyx_obj_5pysam_6ctabix_Tabixfile;
-struct __pyx_opt_args_5pysam_6ctabix__force_str;
-struct __pyx_opt_args_5pysam_6ctabix__force_bytes;
-struct __pyx_opt_args_5pysam_6ctabix__charptr_to_str;
-
-/* "pysam/ctabix.pxd":50
- * ###########################################
- * # used by cvcf.pyx
- * cdef _force_str(object s, encoding=?)             # <<<<<<<<<<<<<<
- * 
- * ###########################################
- */
-struct __pyx_opt_args_5pysam_6ctabix__force_str {
-  int __pyx_n;
-  PyObject *encoding;
-};
-
-/* "pysam/ctabix.pyx":51
- *         raise TypeError, u"Argument must be string or unicode."
- * 
- * cdef inline bytes _force_bytes(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-struct __pyx_opt_args_5pysam_6ctabix__force_bytes {
-  int __pyx_n;
-  PyObject *encoding;
-};
-
-/* "pysam/ctabix.pyx":65
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline _charptr_to_str(char* s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-struct __pyx_opt_args_5pysam_6ctabix__charptr_to_str {
-  int __pyx_n;
-  PyObject *encoding;
-};
-
-/* "TabProxies.pxd":41
- *   ctypedef int uint64_t
- * 
- * cdef class TupleProxy:             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_TupleProxy {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *__pyx_vtab;
-  char *data;
-  char **fields;
-  int nfields;
-  int index;
-  int nbytes;
-  int offset;
-  int is_modified;
-  PyObject *encoding;
-};
-
-
-/* "TabProxies.pxd":63
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class GTFProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_GTFProxy {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy __pyx_base;
-  char *_attributes;
-  int hasOwnAttributes;
-};
-
-
-/* "TabProxies.pxd":73
- *     cdef char * getAttributes( self )
- * 
- * cdef class NamedTupleProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy __pyx_base;
-};
-
-
-/* "TabProxies.pxd":76
- *     pass
- * 
- * cdef class BedProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_BedProxy {
-  struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-  char *contig;
-  uint32_t start;
-  uint32_t end;
-  int bedfields;
-};
-
-
-/* "TabProxies.pxd":88
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class VCFProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_VCFProxy {
-  struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-  char *contig;
-  uint32_t pos;
-};
-
-
-/* "pysam/ctabix.pxd":19
- *     kstream_t, kstring_t, gzFile, tbx_t
- * 
- * cdef class tabix_file_iterator:             # <<<<<<<<<<<<<<
- *     cdef gzFile fh
- *     cdef kstream_t * kstream
- */
-struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator *__pyx_vtab;
-  gzFile fh;
-  kstream_t *kstream;
-  kstring_t buffer;
-  size_t size;
-  struct __pyx_obj_5pysam_6ctabix_Parser *parser;
-  int fd;
-  int duplicated_fd;
-  PyObject *infile;
-};
-
-
-/* "pysam/ctabix.pxd":31
- *     cdef __cnext__(self)
- * 
- * cdef class TabixFile:             # <<<<<<<<<<<<<<
- * 
- *     # pointer to tabixfile
- */
-struct __pyx_obj_5pysam_6ctabix_TabixFile {
-  PyObject_HEAD
-  htsFile *tabixfile;
-  tbx_t *index;
-  int isremote;
-  PyObject *_filename;
-  PyObject *_filename_index;
-  struct __pyx_obj_5pysam_6ctabix_Parser *parser;
-  PyObject *encoding;
-};
-
-
-/* "pysam/ctabix.pxd":53
- * 
- * ###########################################
- * cdef class Parser:             # <<<<<<<<<<<<<<
- *     cdef encoding
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_Parser {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser *__pyx_vtab;
-  PyObject *encoding;
-};
-
-
-/* "pysam/ctabix.pxd":58
- *     cdef parse(self, char * buffer, int len)
- * 
- * cdef class asTuple(Parser):             # <<<<<<<<<<<<<<
- *     cdef parse(self, char * buffer, int len)
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_asTuple {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-};
-
-
-/* "pysam/ctabix.pxd":61
- *     cdef parse(self, char * buffer, int len)
- * 
- * cdef class asGTF(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_asGTF {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-};
-
-
-/* "pysam/ctabix.pxd":64
- *     pass
- * 
- * cdef class asBed(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_asBed {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-};
-
-
-/* "pysam/ctabix.pxd":67
- *     pass
- * 
- * cdef class asVCF(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_asVCF {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-};
-
-
-/* "pysam/ctabix.pxd":70
- *     pass
- * 
- * cdef class TabixIterator:             # <<<<<<<<<<<<<<
- *     cdef hts_itr_t * iterator
- *     cdef TabixFile tabixfile
- */
-struct __pyx_obj_5pysam_6ctabix_TabixIterator {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator *__pyx_vtab;
-  hts_itr_t *iterator;
-  struct __pyx_obj_5pysam_6ctabix_TabixFile *tabixfile;
-  kstring_t buffer;
-  PyObject *encoding;
-};
-
-
-/* "pysam/ctabix.pxd":77
- *     cdef int __cnext__(self)
- * 
- * cdef class TabixIteratorParsed(TabixIterator):             # <<<<<<<<<<<<<<
- *     cdef Parser parser
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed {
-  struct __pyx_obj_5pysam_6ctabix_TabixIterator __pyx_base;
-  struct __pyx_obj_5pysam_6ctabix_Parser *parser;
-};
-
-
-/* "pysam/ctabix.pxd":80
- *     cdef Parser parser
- * 
- * cdef class GZIterator:             # <<<<<<<<<<<<<<
- *     cdef object _filename
- *     cdef gzFile gzipfile
- */
-struct __pyx_obj_5pysam_6ctabix_GZIterator {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator *__pyx_vtab;
-  PyObject *_filename;
-  gzFile gzipfile;
-  kstream_t *kstream;
-  kstring_t buffer;
-  PyObject *encoding;
-};
-
-
-/* "pysam/ctabix.pxd":88
- *     cdef encoding
- * 
- * cdef class GZIteratorHead(GZIterator):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_GZIteratorHead {
-  struct __pyx_obj_5pysam_6ctabix_GZIterator __pyx_base;
-};
-
-
-/* "pysam/ctabix.pxd":91
- *     pass
- * 
- * cdef class GZIteratorParsed(GZIterator):             # <<<<<<<<<<<<<<
- *     cdef Parser parser
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed {
-  struct __pyx_obj_5pysam_6ctabix_GZIterator __pyx_base;
-  struct __pyx_obj_5pysam_6ctabix_Parser *parser;
-};
-
-
-/* "pysam/ctabix.pxd":95
- * 
- * # Compatibility Layer for pysam < 0.8
- * cdef class Tabixfile(TabixFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_Tabixfile {
-  struct __pyx_obj_5pysam_6ctabix_TabixFile __pyx_base;
-};
-
-
-
-/* "TabProxies.pxd":41
- *   ctypedef int uint64_t
- * 
- * cdef class TupleProxy:             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy {
-  int (*getMaxFields)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *);
-  int (*getMinFields)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *);
-  PyObject *(*take)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*present)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*copy)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*update)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *__pyx_vtabptr_5pysam_10TabProxies_TupleProxy;
-
-
-/* "TabProxies.pxd":63
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class GTFProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy __pyx_base;
-  char *(*getAttributes)(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *);
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy *__pyx_vtabptr_5pysam_10TabProxies_GTFProxy;
-
-
-/* "TabProxies.pxd":73
- *     cdef char * getAttributes( self )
- * 
- * cdef class NamedTupleProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy *__pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy;
-
-
-/* "TabProxies.pxd":76
- *     pass
- * 
- * cdef class BedProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy *__pyx_vtabptr_5pysam_10TabProxies_BedProxy;
-
-
-/* "TabProxies.pxd":88
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class VCFProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy *__pyx_vtabptr_5pysam_10TabProxies_VCFProxy;
-
-
-/* "pysam/ctabix.pyx":923
- * 
- * 
- * cdef class tabix_file_iterator:             # <<<<<<<<<<<<<<
- *     '''iterate over a compressed or uncompressed ``infile``.
- *     '''
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator {
-  PyObject *(*__pyx___cnext__)(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *);
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator *__pyx_vtabptr_5pysam_6ctabix_tabix_file_iterator;
-
-
-/* "pysam/ctabix.pyx":85
- * 
- * 
- * cdef class Parser:             # <<<<<<<<<<<<<<
- * 
- *     def __init__(self, encoding="ascii"):
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_Parser {
-  PyObject *(*parse)(struct __pyx_obj_5pysam_6ctabix_Parser *, char *, int);
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_Parser *__pyx_vtabptr_5pysam_6ctabix_Parser;
-
-
-/* "pysam/ctabix.pyx":104
- * 
- * 
- * cdef class asTuple(Parser):             # <<<<<<<<<<<<<<
- *     '''converts a :term:`tabix row` into a python tuple.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_asTuple {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asTuple *__pyx_vtabptr_5pysam_6ctabix_asTuple;
-
-
-/* "pysam/ctabix.pyx":118
- * 
- * 
- * cdef class asGTF(Parser):             # <<<<<<<<<<<<<<
- *     '''converts a :term:`tabix row` into a GTF record with the following
- *     fields:
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_asGTF {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asGTF *__pyx_vtabptr_5pysam_6ctabix_asGTF;
-
-
-/* "pysam/ctabix.pyx":165
- * 
- * 
- * cdef class asBed(Parser):             # <<<<<<<<<<<<<<
- *     '''converts a :term:`tabix row` into a bed record
- *     with the following fields:
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_asBed {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asBed *__pyx_vtabptr_5pysam_6ctabix_asBed;
-
-
-/* "pysam/ctabix.pyx":213
- * 
- * 
- * cdef class asVCF(Parser):             # <<<<<<<<<<<<<<
- *     '''converts a :term:`tabix row` into a VCF record with
- *     the following fields:
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_asVCF {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asVCF *__pyx_vtabptr_5pysam_6ctabix_asVCF;
-
-
-/* "pysam/ctabix.pyx":490
- * 
- * 
- * cdef class TabixIterator:             # <<<<<<<<<<<<<<
- *     """iterates over rows in *tabixfile* in region
- *     given by *tid*, *start* and *end*.
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator {
-  int (*__pyx___cnext__)(struct __pyx_obj_5pysam_6ctabix_TabixIterator *);
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator *__pyx_vtabptr_5pysam_6ctabix_TabixIterator;
-
-
-/* "pysam/ctabix.pyx":568
- * 
- * 
- * cdef class TabixIteratorParsed(TabixIterator):             # <<<<<<<<<<<<<<
- *     """iterates over mapped reads in a region.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_TabixIteratorParsed {
-  struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_TabixIteratorParsed *__pyx_vtabptr_5pysam_6ctabix_TabixIteratorParsed;
-
-
-/* "pysam/ctabix.pyx":598
- * 
- * 
- * cdef class GZIterator:             # <<<<<<<<<<<<<<
- *     def __init__(self, filename, int buffer_size=65536, encoding="ascii"):
- *         '''iterate line-by-line through gzip (or bgzip)
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator {
-  int (*__pyx___cnext__)(struct __pyx_obj_5pysam_6ctabix_GZIterator *);
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator *__pyx_vtabptr_5pysam_6ctabix_GZIterator;
-
-
-/* "pysam/ctabix.pyx":649
- * 
- * 
- * cdef class GZIteratorHead(GZIterator):             # <<<<<<<<<<<<<<
- *     '''iterate line-by-line through gzip (or bgzip)
- *     compressed file returning comments at top of file.
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorHead {
-  struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorHead *__pyx_vtabptr_5pysam_6ctabix_GZIteratorHead;
-
-
-/* "pysam/ctabix.pyx":666
- * 
- * 
- * cdef class GZIteratorParsed(GZIterator):             # <<<<<<<<<<<<<<
- *     '''iterate line-by-line through gzip (or bgzip)
- *     compressed file returning comments at top of file.
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorParsed {
-  struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorParsed *__pyx_vtabptr_5pysam_6ctabix_GZIteratorParsed;
-#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_XDECREF_SET(r, v) do {                            \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_XDECREF(tmp);                              \
-    } while (0)
-#define __Pyx_DECREF_SET(r, v) do {                             \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_DECREF(tmp);                               \
-    } while (0)
-#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)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_getattro))
-        return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_getattr))
-        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
-    return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
-#else
-#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
-#endif
-
-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 void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
-    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
-    const char* function_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-#include <string.h>
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
-#else
-#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
-#endif
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact); /*proto*/
-
-#if PY_MAJOR_VERSION >= 3
-static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
-    PyObject *value;
-    value = PyDict_GetItemWithError(d, key);
-    if (unlikely(!value)) {
-        if (!PyErr_Occurred()) {
-            PyObject* args = PyTuple_Pack(1, key);
-            if (likely(args))
-                PyErr_SetObject(PyExc_KeyError, args);
-            Py_XDECREF(args);
-        }
-        return NULL;
-    }
-    Py_INCREF(value);
-    return value;
-}
-#else
-    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
-#endif
-
-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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-#if PY_MAJOR_VERSION < 3
-#define __Pyx_PyString_Join __Pyx_PyBytes_Join
-#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
-#else
-#define __Pyx_PyString_Join PyUnicode_Join
-#define __Pyx_PyBaseString_Join PyUnicode_Join
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
-    #if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyBytes_Join _PyString_Join
-    #else
-    #define __Pyx_PyBytes_Join _PyBytes_Join
-    #endif
-#else
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/
-#endif
-
-static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
-    PyObject *method, *result = NULL;
-    if (unlikely(!args)) return NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto bad;
-    result = __Pyx_PyObject_Call(method, args, NULL);
-    Py_DECREF(method);
-bad:
-    Py_DECREF(args);
-    return result;
-}
-#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
-#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
-#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
-#define __Pyx_PyObject_CallMethod0(obj, name) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))
-
-static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); /*proto*/
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
-static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_setattro))
-        return tp->tp_setattro(obj, attr_name, value);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_setattr))
-        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
-#endif
-    return PyObject_SetAttr(obj, attr_name, value);
-}
-#else
-#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
-#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
-#endif
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-static void* __Pyx_GetVtable(PyObject *dict); /*proto*/
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-
-#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;
-    PyObject *func_dict;
-    PyObject *func_weakreflist;
-    PyObject *func_name;
-    PyObject *func_qualname;
-    PyObject *func_doc;
-    PyObject *func_globals;
-    PyObject *func_code;
-    PyObject *func_closure;
-    PyObject *func_classobj; /* No-args super() class cell */
-    void *defaults;
-    int defaults_pyobjects;
-    int flags;
-    PyObject *defaults_tuple;   /* Const defaults tuple */
-    PyObject *defaults_kwdict;  /* Const kwonly defaults dict */
-    PyObject *(*defaults_getter)(PyObject *);
-    PyObject *func_annotations; /* function annotations dict */
-} __pyx_CyFunctionObject;
-static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
-    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
-static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
-                                      int flags, PyObject* qualname,
-                                      PyObject *self,
-                                      PyObject *module, PyObject *globals,
-                                      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 CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
-                                                             PyObject *dict);
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
-                                                              PyObject *dict);
-static int __Pyx_CyFunction_init(void);
-
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
-
-static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
-                                           PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/
-static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
-                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-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 PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*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 'libc.stdint' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdlib' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'pysam.chtslib' */
-
-/* Module declarations from 'libc.errno' */
-
-/* Module declarations from 'posix.unistd' */
-
-/* Module declarations from 'cpython.version' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'cpython.exc' */
-
-/* Module declarations from 'cpython.module' */
-
-/* Module declarations from 'cpython.mem' */
-
-/* Module declarations from 'cpython.tuple' */
-
-/* Module declarations from 'cpython.list' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from 'cpython.sequence' */
-
-/* Module declarations from 'cpython.mapping' */
-
-/* Module declarations from 'cpython.iterator' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'cpython.number' */
-
-/* Module declarations from 'cpython.int' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.bool' */
-static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
-
-/* Module declarations from 'cpython.long' */
-
-/* Module declarations from 'cpython.float' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.complex' */
-static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
-
-/* Module declarations from 'cpython.string' */
-
-/* Module declarations from 'cpython.unicode' */
-
-/* Module declarations from 'cpython.dict' */
-
-/* Module declarations from 'cpython.instance' */
-
-/* Module declarations from 'cpython.function' */
-
-/* Module declarations from 'cpython.method' */
-
-/* Module declarations from 'cpython.weakref' */
-
-/* Module declarations from 'cpython.getargs' */
-
-/* Module declarations from 'cpython.pythread' */
-
-/* Module declarations from 'cpython.pystate' */
-
-/* Module declarations from 'cpython.cobject' */
-
-/* Module declarations from 'cpython.oldbuffer' */
-
-/* Module declarations from 'cpython.set' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.bytes' */
-
-/* Module declarations from 'cpython.pycapsule' */
-
-/* Module declarations from 'cpython' */
-
-/* Module declarations from 'pysam.TabProxies' */
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_TupleProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_GTFProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_BedProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_VCFProxy = 0;
-
-/* Module declarations from 'pysam.ctabix' */
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_tabix_file_iterator = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_TabixFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_Parser = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_asTuple = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_asGTF = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_asBed = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_asVCF = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_TabixIterator = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_TabixIteratorParsed = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_GZIterator = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_GZIteratorHead = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_GZIteratorParsed = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_Tabixfile = 0;
-static PyObject *__pyx_v_5pysam_6ctabix__FILENAME_ENCODING = 0;
-static PyObject *__pyx_f_5pysam_6ctabix__force_str(PyObject *, struct __pyx_opt_args_5pysam_6ctabix__force_str *__pyx_optional_args); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_6ctabix__encodeFilename(PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_6ctabix__force_bytes(PyObject *, struct __pyx_opt_args_5pysam_6ctabix__force_bytes *__pyx_optional_args); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_6ctabix__charptr_to_str(char *, struct __pyx_opt_args_5pysam_6ctabix__charptr_to_str *__pyx_optional_args); /*proto*/
-#define __Pyx_MODULE_NAME "pysam.ctabix"
-int __pyx_module_is_main_pysam__ctabix = 0;
-
-/* Implementation of 'pysam.ctabix' */
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_NotImplementedError;
-static PyObject *__pyx_builtin_IOError;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_StopIteration;
-static PyObject *__pyx_builtin_OSError;
-static PyObject *__pyx_builtin_ord;
-static PyObject *__pyx_builtin_KeyError;
-static int __pyx_pf_5pysam_6ctabix_6Parser___init__(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_6Parser_2set_encoding(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_6Parser_4get_encoding(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_6Parser_6__call__(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_length); /* proto */
-static int __pyx_pf_5pysam_6ctabix_9TabixFile___cinit__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_parser, PyObject *__pyx_v_index, PyObject *__pyx_v_encoding, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_2_open(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_index); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_4_dup(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_6_isOpen(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_8fetch(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_parser, PyObject *__pyx_v_multiple_iterators); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_8filename___get__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_6header___get__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_7contigs___get__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_10close(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_6ctabix_9TabixFile_12__dealloc__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_6ctabix_13TabixIterator___init__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self, PyObject *__pyx_v_encoding); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_13TabixIterator_2__iter__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_13TabixIterator_4__next__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_13TabixIterator_6next(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_6ctabix_13TabixIterator_8__dealloc__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_13EmptyIterator___iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_13EmptyIterator_2next(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_13EmptyIterator_4__next__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_6ctabix_19TabixIteratorParsed___init__(struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *__pyx_v_self, struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_parser); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_19TabixIteratorParsed_2__next__(struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_6ctabix_10GZIterator___init__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_v_buffer_size, PyObject *__pyx_v_encoding); /* proto */
-static void __pyx_pf_5pysam_6ctabix_10GZIterator_2__dealloc__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_10GZIterator_4__iter__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_10GZIterator_6__next__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_14GZIteratorHead___next__(struct __pyx_obj_5pysam_6ctabix_GZIteratorHead *__pyx_v_self); /* proto */
-static int __pyx_pf_5pysam_6ctabix_16GZIteratorParsed___init__(struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *__pyx_v_self, PyObject *__pyx_v_parser); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_16GZIteratorParsed_2__next__(struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_tabix_compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_in, PyObject *__pyx_v_filename_out, PyObject *__pyx_v_force); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_2tabix_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_force, PyObject *__pyx_v_seq_col, PyObject *__pyx_v_start_col, PyObject *__pyx_v_end_col, PyObject *__pyx_v_preset, PyObject *__pyx_v_meta_char, PyObject *__pyx_v_zerobased, PyObject *__pyx_v_min_shift); /* proto */
-static int __pyx_pf_5pysam_6ctabix_19tabix_file_iterator___cinit__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self, PyObject *__pyx_v_infile, struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_parser, int __pyx_v_buffer_size); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_19tabix_file_iterator_2__iter__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self); /* proto */
-static void __pyx_pf_5pysam_6ctabix_19tabix_file_iterator_4__dealloc__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_19tabix_file_iterator_6__next__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_19tabix_file_iterator_8next(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_22tabix_generic_iterator___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_parser); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_4__next__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_6next(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_6ctabix_4tabix_iterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_parser); /* proto */
-static PyObject *__pyx_tp_new_5pysam_6ctabix_tabix_file_iterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_TabixFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_Parser(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_asTuple(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_asGTF(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_asBed(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_asVCF(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_TabixIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_TabixIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_GZIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_GZIteratorHead(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_GZIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_6ctabix_Tabixfile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_b[] = "b";
-static char __pyx_k_c[] = "c";
-static char __pyx_k_r[] = "r";
-static char __pyx_k_s[] = "%s";
-static char __pyx_k_w[] = "w";
-static char __pyx_k_fn[] = "fn";
-static char __pyx_k_fp[] = "fp";
-static char __pyx_k_gz[] = ".gz";
-static char __pyx_k_os[] = "os";
-static char __pyx_k__10[] = "#";
-static char __pyx_k__14[] = ",";
-static char __pyx_k_all[] = "__all__";
-static char __pyx_k_bed[] = "bed";
-static char __pyx_k_cpy[] = "cpy";
-static char __pyx_k_doc[] = "__doc__";
-static char __pyx_k_dup[] = "_dup";
-static char __pyx_k_end[] = "end";
-static char __pyx_k_ftp[] = "ftp:";
-static char __pyx_k_gff[] = "gff";
-static char __pyx_k_ord[] = "ord";
-static char __pyx_k_s_2[] = "s";
-static char __pyx_k_s_i[] = "%s:%i";
-static char __pyx_k_sam[] = "sam";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_tbi[] = ".tbi";
-static char __pyx_k_vcf[] = "vcf";
-static char __pyx_k_conf[] = "conf";
-static char __pyx_k_http[] = "http:";
-static char __pyx_k_init[] = "__init__";
-static char __pyx_k_iter[] = "__iter__";
-static char __pyx_k_join[] = "join";
-static char __pyx_k_keys[] = "keys";
-static char __pyx_k_line[] = "line";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_mode[] = "mode";
-static char __pyx_k_next[] = "__next__";
-static char __pyx_k_open[] = "_open";
-static char __pyx_k_path[] = "path";
-static char __pyx_k_self[] = "self";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_asBed[] = "asBed";
-static char __pyx_k_asGTF[] = "asGTF";
-static char __pyx_k_asVCF[] = "asVCF";
-static char __pyx_k_ascii[] = "ascii";
-static char __pyx_k_close[] = "close";
-static char __pyx_k_force[] = "force";
-static char __pyx_k_index[] = "index";
-static char __pyx_k_s_i_i[] = "%s:%i-%i";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_buffer[] = "buffer";
-static char __pyx_k_closed[] = "closed";
-static char __pyx_k_decode[] = "decode";
-static char __pyx_k_encode[] = "encode";
-static char __pyx_k_exists[] = "exists";
-static char __pyx_k_fd_src[] = "fd_src";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_infile[] = "infile";
-static char __pyx_k_isOpen[] = "_isOpen";
-static char __pyx_k_length[] = "length";
-static char __pyx_k_module[] = "__module__";
-static char __pyx_k_nbytes[] = "nbytes";
-static char __pyx_k_next_2[] = "next";
-static char __pyx_k_parser[] = "parser";
-static char __pyx_k_pileup[] = "pileup";
-static char __pyx_k_preset[] = "preset";
-static char __pyx_k_psltbl[] = "psltbl";
-static char __pyx_k_region[] = "region";
-static char __pyx_k_unlink[] = "unlink";
-static char __pyx_k_IOError[] = "IOError";
-static char __pyx_k_OSError[] = "OSError";
-static char __pyx_k_PYTHON3[] = "PYTHON3";
-static char __pyx_k_asTuple[] = "asTuple";
-static char __pyx_k_end_col[] = "end_col";
-static char __pyx_k_prepare[] = "__prepare__";
-static char __pyx_k_seq_col[] = "seq_col";
-static char __pyx_k_KeyError[] = "KeyError";
-static char __pyx_k_O_RDONLY[] = "O_RDONLY";
-static char __pyx_k_encoding[] = "encoding";
-static char __pyx_k_endswith[] = "endswith";
-static char __pyx_k_filename[] = "filename";
-static char __pyx_k_qualname[] = "__qualname__";
-static char __pyx_k_readline[] = "readline";
-static char __pyx_k_TabixFile[] = "TabixFile";
-static char __pyx_k_Tabixfile[] = "Tabixfile";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_bytes_cpy[] = "bytes_cpy";
-static char __pyx_k_conf_data[] = "conf_data";
-static char __pyx_k_meta_char[] = "meta_char";
-static char __pyx_k_metaclass[] = "__metaclass__";
-static char __pyx_k_min_shift[] = "min_shift";
-static char __pyx_k_reference[] = "reference";
-static char __pyx_k_start_col[] = "start_col";
-static char __pyx_k_zerobased[] = "zerobased";
-static char __pyx_k_GZIterator[] = "GZIterator";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_startswith[] = "startswith";
-static char __pyx_k_WINDOW_SIZE[] = "WINDOW_SIZE";
-static char __pyx_k_buffer_size[] = "buffer_size";
-static char __pyx_k_filename_in[] = "filename_in";
-static char __pyx_k_preset2conf[] = "preset2conf";
-static char __pyx_k_tabix_index[] = "tabix_index";
-static char __pyx_k_filename_out[] = "filename_out";
-static char __pyx_k_get_encoding[] = "get_encoding";
-static char __pyx_k_pysam_ctabix[] = "pysam.ctabix";
-static char __pyx_k_set_encoding[] = "set_encoding";
-static char __pyx_k_EmptyIterator[] = "EmptyIterator";
-static char __pyx_k_StopIteration[] = "StopIteration";
-static char __pyx_k_error_d_s_d_s[] = "error (%d): %s (%d: %s)";
-static char __pyx_k_start_i_end_i[] = "start (%i) > end (%i)";
-static char __pyx_k_GZIteratorHead[] = "GZIteratorHead";
-static char __pyx_k_No_such_file_s[] = "No such file '%s'";
-static char __pyx_k_empty_iterator[] = "empty iterator";
-static char __pyx_k_tabix_compress[] = "tabix_compress";
-static char __pyx_k_tabix_iterator[] = "tabix_iterator";
-static char __pyx_k_writing_failed[] = "writing failed";
-static char __pyx_k_file_s_not_found[] = "file `%s` not found";
-static char __pyx_k_index_s_not_found[] = "index `%s` not found";
-static char __pyx_k_EmptyIterator_next[] = "EmptyIterator.next";
-static char __pyx_k_getdefaultencoding[] = "getdefaultencoding";
-static char __pyx_k_multiple_iterators[] = "multiple_iterators";
-static char __pyx_k_NotImplementedError[] = "NotImplementedError";
-static char __pyx_k_tabix_file_iterator[] = "tabix_file_iterator";
-static char __pyx_k_EmptyIterator___iter[] = "EmptyIterator.__iter__";
-static char __pyx_k_EmptyIterator___next[] = "EmptyIterator.__next__";
-static char __pyx_k_incomplete_line_at_s[] = "incomplete line at %s";
-static char __pyx_k_could_not_open_file_s[] = "could not open file `%s`";
-static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding";
-static char __pyx_k_tabix_generic_iterator[] = "tabix_generic_iterator";
-static char __pyx_k_iteration_on_closed_file[] = "iteration on closed file";
-static char __pyx_k_list_of_chromosome_names[] = "list of chromosome names";
-static char __pyx_k_writing_to_file_s_failed[] = "writing to file %s failed";
-static char __pyx_k_error_when_closing_file_s[] = "error when closing file %s";
-static char __pyx_k_could_not_open_index_for_s[] = "could not open index for `%s`";
-static char __pyx_k_No_such_file_or_directory_s[] = "No such file or directory: %s";
-static char __pyx_k_invalid_file_opening_mode_s[] = "invalid file opening mode `%s`";
-static char __pyx_k_tabix_generic_iterator_next[] = "tabix_generic_iterator.next";
-static char __pyx_k_I_O_operation_on_closed_file[] = "I/O operation on closed file";
-static char __pyx_k_could_not_open_s_for_reading[] = "could not open '%s' for reading";
-static char __pyx_k_could_not_open_s_for_writing[] = "could not open '%s' for writing";
-static char __pyx_k_tabix_generic_iterator___init[] = "tabix_generic_iterator.__init__";
-static char __pyx_k_tabix_generic_iterator___iter[] = "tabix_generic_iterator.__iter__";
-static char __pyx_k_tabix_generic_iterator___next[] = "tabix_generic_iterator.__next__";
-static char __pyx_k_I_O_operation_on_closed_file_2[] = "I/O operation on closed file.";
-static char __pyx_k_home_andreas_devel_pysam_pysam[] = "/home/andreas/devel/pysam/pysam/ctabix.pyx";
-static char __pyx_k_iterate_over_infile_Permits_the[] = "iterate over ``infile``.\n    \n    Permits the use of file-like objects for example from the gzip module.\n    ";
-static char __pyx_k_the_file_header_note_The_header[] = "the file header.\n          \n        .. note::\n            The header is returned as an iterator presenting lines without the\n            newline character.\n        ";
-static char __pyx_k_Argument_must_be_string_bytes_or[] = "Argument must be string, bytes or unicode.";
-static char __pyx_k_Argument_must_be_string_or_unico[] = "Argument must be string or unicode.";
-static char __pyx_k_Filename_s_already_exists_use_fo[] = "Filename '%s' already exists, use *force* to overwrite";
-static char __pyx_k_Filename_s_tbi_already_exists_us[] = "Filename '%s.tbi' already exists, use *force* to overwrite";
-static char __pyx_k_could_not_create_iterator_for_re[] = "could not create iterator for region '%s'";
-static char __pyx_k_filename_associated_with_this_ob[] = "filename associated with this object.";
-static char __pyx_k_neither_preset_nor_seq_col_start[] = "neither preset nor seq_col,start_col and end_col given";
-static char __pyx_k_parse_method_of_s_not_implemente[] = "parse method of %s not implemented";
-static char __pyx_k_unknown_preset_s_valid_presets_a[] = "unknown preset '%s', valid presets are '%s'";
-static PyObject *__pyx_kp_u_Argument_must_be_string_bytes_or;
-static PyObject *__pyx_kp_u_Argument_must_be_string_or_unico;
-static PyObject *__pyx_n_s_EmptyIterator;
-static PyObject *__pyx_n_s_EmptyIterator___iter;
-static PyObject *__pyx_n_s_EmptyIterator___next;
-static PyObject *__pyx_n_s_EmptyIterator_next;
-static PyObject *__pyx_kp_s_Filename_s_already_exists_use_fo;
-static PyObject *__pyx_kp_s_Filename_s_tbi_already_exists_us;
-static PyObject *__pyx_n_s_GZIterator;
-static PyObject *__pyx_n_s_GZIteratorHead;
-static PyObject *__pyx_n_s_IOError;
-static PyObject *__pyx_kp_s_I_O_operation_on_closed_file;
-static PyObject *__pyx_kp_s_I_O_operation_on_closed_file_2;
-static PyObject *__pyx_n_s_KeyError;
-static PyObject *__pyx_kp_s_No_such_file_or_directory_s;
-static PyObject *__pyx_kp_s_No_such_file_s;
-static PyObject *__pyx_n_s_NotImplementedError;
-static PyObject *__pyx_n_s_OSError;
-static PyObject *__pyx_n_s_O_RDONLY;
-static PyObject *__pyx_n_s_PYTHON3;
-static PyObject *__pyx_n_s_StopIteration;
-static PyObject *__pyx_n_s_TabixFile;
-static PyObject *__pyx_n_s_Tabixfile;
-static PyObject *__pyx_n_s_TypeError;
-static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_n_s_WINDOW_SIZE;
-static PyObject *__pyx_kp_s__10;
-static PyObject *__pyx_kp_s__14;
-static PyObject *__pyx_n_s_all;
-static PyObject *__pyx_n_s_asBed;
-static PyObject *__pyx_n_s_asGTF;
-static PyObject *__pyx_n_s_asTuple;
-static PyObject *__pyx_n_s_asVCF;
-static PyObject *__pyx_n_s_ascii;
-static PyObject *__pyx_n_s_b;
-static PyObject *__pyx_n_s_bed;
-static PyObject *__pyx_n_s_buffer;
-static PyObject *__pyx_n_s_buffer_size;
-static PyObject *__pyx_n_s_bytes_cpy;
-static PyObject *__pyx_n_s_c;
-static PyObject *__pyx_n_s_close;
-static PyObject *__pyx_n_s_closed;
-static PyObject *__pyx_n_s_conf;
-static PyObject *__pyx_n_s_conf_data;
-static PyObject *__pyx_kp_s_could_not_create_iterator_for_re;
-static PyObject *__pyx_kp_s_could_not_open_file_s;
-static PyObject *__pyx_kp_s_could_not_open_index_for_s;
-static PyObject *__pyx_kp_s_could_not_open_s_for_reading;
-static PyObject *__pyx_kp_s_could_not_open_s_for_writing;
-static PyObject *__pyx_n_s_cpy;
-static PyObject *__pyx_n_s_decode;
-static PyObject *__pyx_n_s_doc;
-static PyObject *__pyx_n_s_dup;
-static PyObject *__pyx_kp_s_empty_iterator;
-static PyObject *__pyx_n_s_encode;
-static PyObject *__pyx_n_s_encoding;
-static PyObject *__pyx_n_s_end;
-static PyObject *__pyx_n_s_end_col;
-static PyObject *__pyx_n_s_endswith;
-static PyObject *__pyx_kp_s_error_d_s_d_s;
-static PyObject *__pyx_kp_s_error_when_closing_file_s;
-static PyObject *__pyx_n_s_exists;
-static PyObject *__pyx_n_s_fd_src;
-static PyObject *__pyx_kp_s_file_s_not_found;
-static PyObject *__pyx_n_s_filename;
-static PyObject *__pyx_n_s_filename_in;
-static PyObject *__pyx_n_s_filename_out;
-static PyObject *__pyx_n_s_fn;
-static PyObject *__pyx_n_s_force;
-static PyObject *__pyx_n_s_fp;
-static PyObject *__pyx_kp_s_ftp;
-static PyObject *__pyx_n_s_get_encoding;
-static PyObject *__pyx_n_s_getdefaultencoding;
-static PyObject *__pyx_n_s_getfilesystemencoding;
-static PyObject *__pyx_n_s_gff;
-static PyObject *__pyx_kp_s_gz;
-static PyObject *__pyx_kp_s_home_andreas_devel_pysam_pysam;
-static PyObject *__pyx_kp_s_http;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_kp_s_incomplete_line_at_s;
-static PyObject *__pyx_n_s_index;
-static PyObject *__pyx_kp_s_index_s_not_found;
-static PyObject *__pyx_n_s_infile;
-static PyObject *__pyx_n_s_init;
-static PyObject *__pyx_kp_s_invalid_file_opening_mode_s;
-static PyObject *__pyx_n_s_isOpen;
-static PyObject *__pyx_n_s_iter;
-static PyObject *__pyx_kp_s_iterate_over_infile_Permits_the;
-static PyObject *__pyx_kp_s_iteration_on_closed_file;
-static PyObject *__pyx_n_s_join;
-static PyObject *__pyx_n_s_keys;
-static PyObject *__pyx_n_s_length;
-static PyObject *__pyx_n_s_line;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_n_s_meta_char;
-static PyObject *__pyx_n_s_metaclass;
-static PyObject *__pyx_n_s_min_shift;
-static PyObject *__pyx_n_s_mode;
-static PyObject *__pyx_n_s_module;
-static PyObject *__pyx_n_s_multiple_iterators;
-static PyObject *__pyx_n_s_nbytes;
-static PyObject *__pyx_kp_s_neither_preset_nor_seq_col_start;
-static PyObject *__pyx_n_s_next;
-static PyObject *__pyx_n_s_next_2;
-static PyObject *__pyx_n_s_open;
-static PyObject *__pyx_n_s_ord;
-static PyObject *__pyx_n_s_os;
-static PyObject *__pyx_kp_s_parse_method_of_s_not_implemente;
-static PyObject *__pyx_n_s_parser;
-static PyObject *__pyx_n_s_path;
-static PyObject *__pyx_n_s_pileup;
-static PyObject *__pyx_n_s_prepare;
-static PyObject *__pyx_n_s_preset;
-static PyObject *__pyx_n_s_preset2conf;
-static PyObject *__pyx_n_s_psltbl;
-static PyObject *__pyx_n_s_pysam_ctabix;
-static PyObject *__pyx_n_s_pyx_vtable;
-static PyObject *__pyx_n_s_qualname;
-static PyObject *__pyx_n_s_r;
-static PyObject *__pyx_n_s_readline;
-static PyObject *__pyx_n_s_reference;
-static PyObject *__pyx_n_s_region;
-static PyObject *__pyx_kp_s_s;
-static PyObject *__pyx_n_s_s_2;
-static PyObject *__pyx_kp_s_s_i;
-static PyObject *__pyx_kp_s_s_i_i;
-static PyObject *__pyx_n_s_sam;
-static PyObject *__pyx_n_s_self;
-static PyObject *__pyx_n_s_seq_col;
-static PyObject *__pyx_n_s_set_encoding;
-static PyObject *__pyx_n_s_start;
-static PyObject *__pyx_n_s_start_col;
-static PyObject *__pyx_kp_s_start_i_end_i;
-static PyObject *__pyx_n_s_startswith;
-static PyObject *__pyx_n_s_sys;
-static PyObject *__pyx_n_s_tabix_compress;
-static PyObject *__pyx_n_s_tabix_file_iterator;
-static PyObject *__pyx_n_s_tabix_generic_iterator;
-static PyObject *__pyx_n_s_tabix_generic_iterator___init;
-static PyObject *__pyx_n_s_tabix_generic_iterator___iter;
-static PyObject *__pyx_n_s_tabix_generic_iterator___next;
-static PyObject *__pyx_n_s_tabix_generic_iterator_next;
-static PyObject *__pyx_n_s_tabix_index;
-static PyObject *__pyx_n_s_tabix_iterator;
-static PyObject *__pyx_kp_s_tbi;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_kp_s_unknown_preset_s_valid_presets_a;
-static PyObject *__pyx_n_s_unlink;
-static PyObject *__pyx_n_s_vcf;
-static PyObject *__pyx_kp_s_writing_failed;
-static PyObject *__pyx_kp_s_writing_to_file_s_failed;
-static PyObject *__pyx_n_s_zerobased;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_2;
-static PyObject *__pyx_int_3;
-static PyObject *__pyx_int_4;
-static PyObject *__pyx_int_5;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_int_17;
-static PyObject *__pyx_int_18;
-static PyObject *__pyx_int_35;
-static PyObject *__pyx_int_64;
-static PyObject *__pyx_int_65536;
-static PyObject *__pyx_int_neg_1;
-static PyObject *__pyx_tuple_;
-static PyObject *__pyx_tuple__2;
-static PyObject *__pyx_tuple__3;
-static PyObject *__pyx_tuple__4;
-static PyObject *__pyx_tuple__5;
-static PyObject *__pyx_tuple__6;
-static PyObject *__pyx_tuple__7;
-static PyObject *__pyx_tuple__8;
-static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_tuple__11;
-static PyObject *__pyx_tuple__12;
-static PyObject *__pyx_tuple__13;
-static PyObject *__pyx_tuple__15;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__17;
-static PyObject *__pyx_tuple__18;
-static PyObject *__pyx_tuple__19;
-static PyObject *__pyx_tuple__21;
-static PyObject *__pyx_tuple__23;
-static PyObject *__pyx_tuple__25;
-static PyObject *__pyx_tuple__27;
-static PyObject *__pyx_tuple__29;
-static PyObject *__pyx_tuple__31;
-static PyObject *__pyx_tuple__33;
-static PyObject *__pyx_tuple__35;
-static PyObject *__pyx_tuple__37;
-static PyObject *__pyx_codeobj__20;
-static PyObject *__pyx_codeobj__22;
-static PyObject *__pyx_codeobj__24;
-static PyObject *__pyx_codeobj__26;
-static PyObject *__pyx_codeobj__28;
-static PyObject *__pyx_codeobj__30;
-static PyObject *__pyx_codeobj__32;
-static PyObject *__pyx_codeobj__34;
-static PyObject *__pyx_codeobj__36;
-static PyObject *__pyx_codeobj__38;
-
-/* "pysam/ctabix.pyx":39
- * #_C_FILENAME_ENCODING = <char*>_FILENAME_ENCODING
- * 
- * cdef inline bytes _encodeFilename(object filename):             # <<<<<<<<<<<<<<
- *     u"""Make sure a filename is 8-bit encoded (or None).
- *     """
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_6ctabix__encodeFilename(PyObject *__pyx_v_filename) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_encodeFilename", 0);
-
-  /* "pysam/ctabix.pyx":42
- *     u"""Make sure a filename is 8-bit encoded (or None).
- *     """
- *     if filename is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(filename):
- */
-  __pyx_t_1 = (__pyx_v_filename == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":43
- *     """
- *     if filename is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(filename):
- *         return filename
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":44
- *     if filename is None:
- *         return None
- *     elif PyBytes_Check(filename):             # <<<<<<<<<<<<<<
- *         return filename
- *     elif PyUnicode_Check(filename):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_filename) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":45
- *         return None
- *     elif PyBytes_Check(filename):
- *         return filename             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(filename):
- *         return filename.encode(_FILENAME_ENCODING)
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_filename))||((__pyx_v_filename) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_filename)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_filename);
-    __pyx_r = ((PyObject*)__pyx_v_filename);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":46
- *     elif PyBytes_Check(filename):
- *         return filename
- *     elif PyUnicode_Check(filename):             # <<<<<<<<<<<<<<
- *         return filename.encode(_FILENAME_ENCODING)
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_filename) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":47
- *         return filename
- *     elif PyUnicode_Check(filename):
- *         return filename.encode(_FILENAME_ENCODING)             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_5pysam_6ctabix__FILENAME_ENCODING);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_5pysam_6ctabix__FILENAME_ENCODING);
-    __Pyx_GIVEREF(__pyx_v_5pysam_6ctabix__FILENAME_ENCODING);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_5);
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":49
- *         return filename.encode(_FILENAME_ENCODING)
- *     else:
- *         raise TypeError, u"Argument must be string or unicode."             # <<<<<<<<<<<<<<
- * 
- * cdef inline bytes _force_bytes(object s, encoding="ascii"):
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_or_unico, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":39
- * #_C_FILENAME_ENCODING = <char*>_FILENAME_ENCODING
- * 
- * cdef inline bytes _encodeFilename(object filename):             # <<<<<<<<<<<<<<
- *     u"""Make sure a filename is 8-bit encoded (or None).
- *     """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.ctabix._encodeFilename", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":51
- *         raise TypeError, u"Argument must be string or unicode."
- * 
- * cdef inline bytes _force_bytes(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_6ctabix__force_bytes(PyObject *__pyx_v_s, struct __pyx_opt_args_5pysam_6ctabix__force_bytes *__pyx_optional_args) {
-  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_n_s_ascii);
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_force_bytes", 0);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_encoding = __pyx_optional_args->encoding;
-    }
-  }
-
-  /* "pysam/ctabix.pyx":54
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif s is None:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":55
- *     """
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif s is None:
- *         return None
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":56
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":57
- *         return s
- *     elif s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = ((PyObject*)Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":58
- *     elif s is None:
- *         return None
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyUnicode_Check(s):
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":59
- *         return None
- *     elif PyBytes_Check(s):
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyUnicode_Check(s):
- *         return s.encode(encoding)
- */
-    __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = ((PyObject*)__pyx_v_s);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":60
- *     elif PyBytes_Check(s):
- *         return s
- *     elif PyUnicode_Check(s):             # <<<<<<<<<<<<<<
- *         return s.encode(encoding)
- *     else:
- */
-  __pyx_t_2 = (PyUnicode_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":61
- *         return s
- *     elif PyUnicode_Check(s):
- *         return s.encode(encoding)             # <<<<<<<<<<<<<<
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_encoding);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_encoding);
-    __Pyx_GIVEREF(__pyx_v_encoding);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_r = ((PyObject*)__pyx_t_5);
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":63
- *         return s.encode(encoding)
- *     else:
- *         raise TypeError, u"Argument must be string, bytes or unicode."             # <<<<<<<<<<<<<<
- * 
- * cdef inline _charptr_to_str(char* s, encoding="ascii"):
- */
-    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Argument_must_be_string_bytes_or, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":51
- *         raise TypeError, u"Argument must be string or unicode."
- * 
- * cdef inline bytes _force_bytes(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     u"""convert string or unicode object to bytes, assuming ascii encoding.
- *     """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.ctabix._force_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":65
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline _charptr_to_str(char* s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5pysam_6ctabix__charptr_to_str(char *__pyx_v_s, struct __pyx_opt_args_5pysam_6ctabix__charptr_to_str *__pyx_optional_args) {
-  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_n_s_ascii);
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_charptr_to_str", 0);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_encoding = __pyx_optional_args->encoding;
-    }
-  }
-
-  /* "pysam/ctabix.pyx":66
- * 
- * cdef inline _charptr_to_str(char* s, encoding="ascii"):
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     else:
- */
-  __pyx_t_1 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":67
- * cdef inline _charptr_to_str(char* s, encoding="ascii"):
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     else:
- *         return s.decode(encoding)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":69
- *         return s
- *     else:
- *         return s.decode(encoding)             # <<<<<<<<<<<<<<
- * 
- * cdef _force_str(object s, encoding="ascii"):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_encoding);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_encoding);
-    __Pyx_GIVEREF(__pyx_v_encoding);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":65
- *         raise TypeError, u"Argument must be string, bytes or unicode."
- * 
- * cdef inline _charptr_to_str(char* s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.ctabix._charptr_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":71
- *         return s.decode(encoding)
- * 
- * cdef _force_str(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- */
-
-static PyObject *__pyx_f_5pysam_6ctabix__force_str(PyObject *__pyx_v_s, struct __pyx_opt_args_5pysam_6ctabix__force_str *__pyx_optional_args) {
-  PyObject *__pyx_v_encoding = ((PyObject *)__pyx_n_s_ascii);
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_force_str", 0);
-  if (__pyx_optional_args) {
-    if (__pyx_optional_args->__pyx_n > 0) {
-      __pyx_v_encoding = __pyx_optional_args->encoding;
-    }
-  }
-
-  /* "pysam/ctabix.pyx":74
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- *     if s is None:             # <<<<<<<<<<<<<<
- *         return None
- *     if PY_MAJOR_VERSION < 3:
- */
-  __pyx_t_1 = (__pyx_v_s == Py_None);
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":75
- *     (bytes in Py2, unicode in Py3)"""
- *     if s is None:
- *         return None             # <<<<<<<<<<<<<<
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":76
- *     if s is None:
- *         return None
- *     if PY_MAJOR_VERSION < 3:             # <<<<<<<<<<<<<<
- *         return s
- *     elif PyBytes_Check(s):
- */
-  __pyx_t_2 = ((PY_MAJOR_VERSION < 3) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":77
- *         return None
- *     if PY_MAJOR_VERSION < 3:
- *         return s             # <<<<<<<<<<<<<<
- *     elif PyBytes_Check(s):
- *         return s.decode(encoding)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = __pyx_v_s;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":78
- *     if PY_MAJOR_VERSION < 3:
- *         return s
- *     elif PyBytes_Check(s):             # <<<<<<<<<<<<<<
- *         return s.decode(encoding)
- *     else:
- */
-  __pyx_t_2 = (PyBytes_Check(__pyx_v_s) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":79
- *         return s
- *     elif PyBytes_Check(s):
- *         return s.decode(encoding)             # <<<<<<<<<<<<<<
- *     else:
- *         # assume unicode
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_encoding);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_encoding);
-    __Pyx_GIVEREF(__pyx_v_encoding);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_r = __pyx_t_5;
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":82
- *     else:
- *         # assume unicode
- *         return s             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_s);
-    __pyx_r = __pyx_v_s;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":71
- *         return s.decode(encoding)
- * 
- * cdef _force_str(object s, encoding="ascii"):             # <<<<<<<<<<<<<<
- *     """Return s converted to str type of current Python
- *     (bytes in Py2, unicode in Py3)"""
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.ctabix._force_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":87
- * cdef class Parser:
- * 
- *     def __init__(self, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6ctabix_6Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6ctabix_6Parser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_encoding = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0};
-    PyObject* values[1] = {0};
-    values[0] = ((PyObject *)__pyx_n_s_ascii);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
-          if (value) { values[0] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_encoding = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.Parser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_6Parser___init__(((struct __pyx_obj_5pysam_6ctabix_Parser *)__pyx_v_self), __pyx_v_encoding);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6ctabix_6Parser___init__(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self, PyObject *__pyx_v_encoding) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-
-  /* "pysam/ctabix.pyx":88
- * 
- *     def __init__(self, encoding="ascii"):
- *         self.encoding = encoding             # <<<<<<<<<<<<<<
- * 
- *     def set_encoding(self, encoding):
- */
-  __Pyx_INCREF(__pyx_v_encoding);
-  __Pyx_GIVEREF(__pyx_v_encoding);
-  __Pyx_GOTREF(__pyx_v_self->encoding);
-  __Pyx_DECREF(__pyx_v_self->encoding);
-  __pyx_v_self->encoding = __pyx_v_encoding;
-
-  /* "pysam/ctabix.pyx":87
- * cdef class Parser:
- * 
- *     def __init__(self, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":90
- *         self.encoding = encoding
- * 
- *     def set_encoding(self, encoding):             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_6Parser_3set_encoding(PyObject *__pyx_v_self, PyObject *__pyx_v_encoding); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_6Parser_2set_encoding[] = "Parser.set_encoding(self, encoding)";
-static PyObject *__pyx_pw_5pysam_6ctabix_6Parser_3set_encoding(PyObject *__pyx_v_self, PyObject *__pyx_v_encoding) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("set_encoding (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_6Parser_2set_encoding(((struct __pyx_obj_5pysam_6ctabix_Parser *)__pyx_v_self), ((PyObject *)__pyx_v_encoding));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_6Parser_2set_encoding(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self, PyObject *__pyx_v_encoding) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("set_encoding", 0);
-
-  /* "pysam/ctabix.pyx":91
- * 
- *     def set_encoding(self, encoding):
- *         self.encoding = encoding             # <<<<<<<<<<<<<<
- * 
- *     def get_encoding(self):
- */
-  __Pyx_INCREF(__pyx_v_encoding);
-  __Pyx_GIVEREF(__pyx_v_encoding);
-  __Pyx_GOTREF(__pyx_v_self->encoding);
-  __Pyx_DECREF(__pyx_v_self->encoding);
-  __pyx_v_self->encoding = __pyx_v_encoding;
-
-  /* "pysam/ctabix.pyx":90
- *         self.encoding = encoding
- * 
- *     def set_encoding(self, encoding):             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":93
- *         self.encoding = encoding
- * 
- *     def get_encoding(self):             # <<<<<<<<<<<<<<
- *         return self.encoding
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_6Parser_5get_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_6Parser_4get_encoding[] = "Parser.get_encoding(self)";
-static PyObject *__pyx_pw_5pysam_6ctabix_6Parser_5get_encoding(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_encoding (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_6Parser_4get_encoding(((struct __pyx_obj_5pysam_6ctabix_Parser *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_6Parser_4get_encoding(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_encoding", 0);
-
-  /* "pysam/ctabix.pyx":94
- * 
- *     def get_encoding(self):
- *         return self.encoding             # <<<<<<<<<<<<<<
- * 
- *     cdef parse(self, char * buffer, int length):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self->encoding);
-  __pyx_r = __pyx_v_self->encoding;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":93
- *         self.encoding = encoding
- * 
- *     def get_encoding(self):             # <<<<<<<<<<<<<<
- *         return self.encoding
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":96
- *         return self.encoding
- * 
- *     cdef parse(self, char * buffer, int length):             # <<<<<<<<<<<<<<
- *         raise NotImplementedError(
- *             'parse method of %s not implemented' % str(self))
- */
-
-static PyObject *__pyx_f_5pysam_6ctabix_6Parser_parse(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self, CYTHON_UNUSED char *__pyx_v_buffer, CYTHON_UNUSED int __pyx_v_length) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse", 0);
-
-  /* "pysam/ctabix.pyx":98
- *     cdef parse(self, char * buffer, int length):
- *         raise NotImplementedError(
- *             'parse method of %s not implemented' % str(self))             # <<<<<<<<<<<<<<
- * 
- *     def __call__(self, char * buffer, int length):
- */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_parse_method_of_s_not_implemente, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":97
- * 
- *     cdef parse(self, char * buffer, int length):
- *         raise NotImplementedError(             # <<<<<<<<<<<<<<
- *             'parse method of %s not implemented' % str(self))
- * 
- */
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":96
- *         return self.encoding
- * 
- *     cdef parse(self, char * buffer, int length):             # <<<<<<<<<<<<<<
- *         raise NotImplementedError(
- *             'parse method of %s not implemented' % str(self))
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.Parser.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":100
- *             'parse method of %s not implemented' % str(self))
- * 
- *     def __call__(self, char * buffer, int length):             # <<<<<<<<<<<<<<
- *         return self.parse(buffer, length)
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_6Parser_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_pw_5pysam_6ctabix_6Parser_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  char *__pyx_v_buffer;
-  int __pyx_v_length;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_buffer,&__pyx_n_s_length,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __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_buffer = __Pyx_PyObject_AsString(values[0]); if (unlikely((!__pyx_v_buffer) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    __pyx_v_length = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_length == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.Parser.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_6Parser_6__call__(((struct __pyx_obj_5pysam_6ctabix_Parser *)__pyx_v_self), __pyx_v_buffer, __pyx_v_length);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_6Parser_6__call__(struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_length) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__call__", 0);
-
-  /* "pysam/ctabix.pyx":101
- * 
- *     def __call__(self, char * buffer, int length):
- *         return self.parse(buffer, length)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_6ctabix_Parser *)__pyx_v_self->__pyx_vtab)->parse(__pyx_v_self, __pyx_v_buffer, __pyx_v_length); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":100
- *             'parse method of %s not implemented' % str(self))
- * 
- *     def __call__(self, char * buffer, int length):             # <<<<<<<<<<<<<<
- *         return self.parse(buffer, length)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.ctabix.Parser.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":109
- *     A field in a row is accessed by numeric index.
- *     '''
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef TabProxies.TupleProxy r
- *         r = TabProxies.TupleProxy(self.encoding)
- */
-
-static PyObject *__pyx_f_5pysam_6ctabix_7asTuple_parse(struct __pyx_obj_5pysam_6ctabix_asTuple *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy *__pyx_v_r = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse", 0);
-
-  /* "pysam/ctabix.pyx":111
- *     cdef parse(self, char * buffer, int len):
- *         cdef TabProxies.TupleProxy r
- *         r = TabProxies.TupleProxy(self.encoding)             # <<<<<<<<<<<<<<
- *         # need to copy - there were some
- *         # persistence issues with "present"
- */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding);
-  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding);
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_TupleProxy)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_r = ((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":114
- *         # need to copy - there were some
- *         # persistence issues with "present"
- *         r.copy(buffer, len)             # <<<<<<<<<<<<<<
- *         return r
- * 
- */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *)__pyx_v_r->__pyx_vtab)->copy(__pyx_v_r, __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":115
- *         # persistence issues with "present"
- *         r.copy(buffer, len)
- *         return r             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_r));
-  __pyx_r = ((PyObject *)__pyx_v_r);
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":109
- *     A field in a row is accessed by numeric index.
- *     '''
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef TabProxies.TupleProxy r
- *         r = TabProxies.TupleProxy(self.encoding)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.asTuple.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":158
- * 
- *     '''
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef TabProxies.GTFProxy r
- *         r = TabProxies.GTFProxy(self.encoding)
- */
-
-static PyObject *__pyx_f_5pysam_6ctabix_5asGTF_parse(struct __pyx_obj_5pysam_6ctabix_asGTF *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) {
-  struct __pyx_obj_5pysam_10TabProxies_GTFProxy *__pyx_v_r = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse", 0);
-
-  /* "pysam/ctabix.pyx":160
- *     cdef parse(self, char * buffer, int len):
- *         cdef TabProxies.GTFProxy r
- *         r = TabProxies.GTFProxy(self.encoding)             # <<<<<<<<<<<<<<
- *         r.copy(buffer, len)
- *         return r
- */
-  __pyx_t_1 = PyTuple_New(1); 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_INCREF(__pyx_v_self->__pyx_base.encoding);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding);
-  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding);
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_GTFProxy)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_r = ((struct __pyx_obj_5pysam_10TabProxies_GTFProxy *)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":161
- *         cdef TabProxies.GTFProxy r
- *         r = TabProxies.GTFProxy(self.encoding)
- *         r.copy(buffer, len)             # <<<<<<<<<<<<<<
- *         return r
- * 
- */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy *)__pyx_v_r->__pyx_base.__pyx_vtab)->__pyx_base.copy(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":162
- *         r = TabProxies.GTFProxy(self.encoding)
- *         r.copy(buffer, len)
- *         return r             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_r));
-  __pyx_r = ((PyObject *)__pyx_v_r);
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":158
- * 
- *     '''
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef TabProxies.GTFProxy r
- *         r = TabProxies.GTFProxy(self.encoding)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.asGTF.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":206
- * 
- *     '''
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef TabProxies.BedProxy r
- *         r = TabProxies.BedProxy(self.encoding)
- */
-
-static PyObject *__pyx_f_5pysam_6ctabix_5asBed_parse(struct __pyx_obj_5pysam_6ctabix_asBed *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) {
-  struct __pyx_obj_5pysam_10TabProxies_BedProxy *__pyx_v_r = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse", 0);
-
-  /* "pysam/ctabix.pyx":208
- *     cdef parse(self, char * buffer, int len):
- *         cdef TabProxies.BedProxy r
- *         r = TabProxies.BedProxy(self.encoding)             # <<<<<<<<<<<<<<
- *         r.copy(buffer, len)
- *         return r
- */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding);
-  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding);
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_BedProxy)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_r = ((struct __pyx_obj_5pysam_10TabProxies_BedProxy *)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":209
- *         cdef TabProxies.BedProxy r
- *         r = TabProxies.BedProxy(self.encoding)
- *         r.copy(buffer, len)             # <<<<<<<<<<<<<<
- *         return r
- * 
- */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy *)__pyx_v_r->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":210
- *         r = TabProxies.BedProxy(self.encoding)
- *         r.copy(buffer, len)
- *         return r             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_r));
-  __pyx_r = ((PyObject *)__pyx_v_r);
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":206
- * 
- *     '''
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef TabProxies.BedProxy r
- *         r = TabProxies.BedProxy(self.encoding)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.asBed.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":247
- * 
- *     '''
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef TabProxies.VCFProxy r
- *         r = TabProxies.VCFProxy(self.encoding)
- */
-
-static PyObject *__pyx_f_5pysam_6ctabix_5asVCF_parse(struct __pyx_obj_5pysam_6ctabix_asVCF *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) {
-  struct __pyx_obj_5pysam_10TabProxies_VCFProxy *__pyx_v_r = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse", 0);
-
-  /* "pysam/ctabix.pyx":249
- *     cdef parse(self, char * buffer, int len):
- *         cdef TabProxies.VCFProxy r
- *         r = TabProxies.VCFProxy(self.encoding)             # <<<<<<<<<<<<<<
- *         r.copy(buffer, len)
- *         return r
- */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_self->__pyx_base.encoding);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->__pyx_base.encoding);
-  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.encoding);
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_10TabProxies_VCFProxy)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_r = ((struct __pyx_obj_5pysam_10TabProxies_VCFProxy *)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":250
- *         cdef TabProxies.VCFProxy r
- *         r = TabProxies.VCFProxy(self.encoding)
- *         r.copy(buffer, len)             # <<<<<<<<<<<<<<
- *         return r
- * 
- */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy *)__pyx_v_r->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":251
- *         r = TabProxies.VCFProxy(self.encoding)
- *         r.copy(buffer, len)
- *         return r             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_r));
-  __pyx_r = ((PyObject *)__pyx_v_r);
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":247
- * 
- *     '''
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef TabProxies.VCFProxy r
- *         r = TabProxies.VCFProxy(self.encoding)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.asVCF.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":268
- * 
- *     '''
- *     def __cinit__(self,             # <<<<<<<<<<<<<<
- *                   filename,
- *                   mode = 'r',
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6ctabix_9TabixFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6ctabix_9TabixFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_filename = 0;
-  PyObject *__pyx_v_mode = 0;
-  PyObject *__pyx_v_parser = 0;
-  PyObject *__pyx_v_index = 0;
-  PyObject *__pyx_v_encoding = 0;
-  PyObject *__pyx_v_args = 0;
-  PyObject *__pyx_v_kwargs = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
-  __Pyx_GOTREF(__pyx_v_kwargs);
-  if (PyTuple_GET_SIZE(__pyx_args) > 5) {
-    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 5, PyTuple_GET_SIZE(__pyx_args));
-    if (unlikely(!__pyx_v_args)) {
-      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
-      __Pyx_RefNannyFinishContext();
-      return -1;
-    }
-    __Pyx_GOTREF(__pyx_v_args);
-  } else {
-    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
-  }
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_mode,&__pyx_n_s_parser,&__pyx_n_s_index,&__pyx_n_s_encoding,0};
-    PyObject* values[5] = {0,0,0,0,0};
-    values[1] = ((PyObject *)__pyx_n_s_r);
-
-    /* "pysam/ctabix.pyx":271
- *                   filename,
- *                   mode = 'r',
- *                   parser=None,             # <<<<<<<<<<<<<<
- *                   index=None,
- *                   encoding="ascii",
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":272
- *                   mode = 'r',
- *                   parser=None,
- *                   index=None,             # <<<<<<<<<<<<<<
- *                   encoding="ascii",
- *                   *args,
- */
-    values[3] = ((PyObject *)Py_None);
-    values[4] = ((PyObject *)__pyx_n_s_ascii);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        default:
-        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;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
-          if (value) { values[4] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        const Py_ssize_t used_pos_args = (pos_args < 5) ? pos_args : 5;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        default:
-        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);
-        break;
-        case  0:
-        goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_filename = values[0];
-    __pyx_v_mode = values[1];
-    __pyx_v_parser = values[2];
-    __pyx_v_index = values[3];
-    __pyx_v_encoding = values[4];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
-  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile___cinit__(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_mode, __pyx_v_parser, __pyx_v_index, __pyx_v_encoding, __pyx_v_args, __pyx_v_kwargs);
-
-  /* "pysam/ctabix.pyx":268
- * 
- *     '''
- *     def __cinit__(self,             # <<<<<<<<<<<<<<
- *                   filename,
- *                   mode = 'r',
- */
-
-  /* function exit code */
-  __Pyx_XDECREF(__pyx_v_args);
-  __Pyx_XDECREF(__pyx_v_kwargs);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6ctabix_9TabixFile___cinit__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_parser, PyObject *__pyx_v_index, PyObject *__pyx_v_encoding, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-
-  /* "pysam/ctabix.pyx":277
- *                   **kwargs ):
- * 
- *         self.tabixfile = NULL             # <<<<<<<<<<<<<<
- *         self.parser = parser
- *         self._open(filename, mode, index, *args, **kwargs)
- */
-  __pyx_v_self->tabixfile = NULL;
-
-  /* "pysam/ctabix.pyx":278
- * 
- *         self.tabixfile = NULL
- *         self.parser = parser             # <<<<<<<<<<<<<<
- *         self._open(filename, mode, index, *args, **kwargs)
- *         self.encoding = encoding
- */
-  if (!(likely(((__pyx_v_parser) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_5pysam_6ctabix_Parser))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_1 = __pyx_v_parser;
-  __Pyx_INCREF(__pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_GOTREF(__pyx_v_self->parser);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->parser));
-  __pyx_v_self->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":279
- *         self.tabixfile = NULL
- *         self.parser = parser
- *         self._open(filename, mode, index, *args, **kwargs)             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_open); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  __Pyx_INCREF(__pyx_v_mode);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_mode);
-  __Pyx_GIVEREF(__pyx_v_mode);
-  __Pyx_INCREF(__pyx_v_index);
-  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_index);
-  __Pyx_GIVEREF(__pyx_v_index);
-  __pyx_t_3 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __pyx_v_kwargs;
-  __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":280
- *         self.parser = parser
- *         self._open(filename, mode, index, *args, **kwargs)
- *         self.encoding = encoding             # <<<<<<<<<<<<<<
- * 
- *     def _open( self,
- */
-  __Pyx_INCREF(__pyx_v_encoding);
-  __Pyx_GIVEREF(__pyx_v_encoding);
-  __Pyx_GOTREF(__pyx_v_self->encoding);
-  __Pyx_DECREF(__pyx_v_self->encoding);
-  __pyx_v_self->encoding = __pyx_v_encoding;
-
-  /* "pysam/ctabix.pyx":268
- * 
- *     '''
- *     def __cinit__(self,             # <<<<<<<<<<<<<<
- *                   filename,
- *                   mode = 'r',
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":282
- *         self.encoding = encoding
- * 
- *     def _open( self,             # <<<<<<<<<<<<<<
- *                filename,
- *                mode='r',
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_9TabixFile_2_open[] = "TabixFile._open(self, filename, mode='r', index=None)\nopen a :term:`tabix file` for reading.\n        ";
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_3_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_filename = 0;
-  PyObject *__pyx_v_mode = 0;
-  PyObject *__pyx_v_index = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_mode,&__pyx_n_s_index,0};
-    PyObject* values[3] = {0,0,0};
-    values[1] = ((PyObject *)__pyx_n_s_r);
-
-    /* "pysam/ctabix.pyx":285
- *                filename,
- *                mode='r',
- *                index=None,             # <<<<<<<<<<<<<<
- *               ):
- *         '''open a :term:`tabix file` for reading.
- */
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __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_filename = values[0];
-    __pyx_v_mode = values[1];
-    __pyx_v_index = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_open", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile_2_open(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self), __pyx_v_filename, __pyx_v_mode, __pyx_v_index);
-
-  /* "pysam/ctabix.pyx":282
- *         self.encoding = encoding
- * 
- *     def _open( self,             # <<<<<<<<<<<<<<
- *                filename,
- *                mode='r',
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_2_open(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_mode, PyObject *__pyx_v_index) {
-  PyObject *__pyx_v_filename_index = NULL;
-  PyObject *__pyx_v__encoded_filename = NULL;
-  PyObject *__pyx_v__encoded_index = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  char const *__pyx_t_7;
-  char *__pyx_t_8;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_open", 0);
-
-  /* "pysam/ctabix.pyx":290
- *         '''
- * 
- *         assert mode in ("r",), "invalid file opening mode `%s`" % mode             # <<<<<<<<<<<<<<
- * 
- *         if self.tabixfile != NULL:
- */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    __Pyx_INCREF(__pyx_v_mode);
-    __pyx_t_1 = __pyx_v_mode;
-    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (unlikely(!(__pyx_t_2 != 0))) {
-      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_invalid_file_opening_mode_s, __pyx_v_mode); 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);
-      PyErr_SetObject(PyExc_AssertionError, __pyx_t_1);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-
-  /* "pysam/ctabix.pyx":292
- *         assert mode in ("r",), "invalid file opening mode `%s`" % mode
- * 
- *         if self.tabixfile != NULL:             # <<<<<<<<<<<<<<
- *             self.close()
- *         self.tabixfile = NULL
- */
-  __pyx_t_2 = ((__pyx_v_self->tabixfile != NULL) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":293
- * 
- *         if self.tabixfile != NULL:
- *             self.close()             # <<<<<<<<<<<<<<
- *         self.tabixfile = NULL
- * 
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/ctabix.pyx":294
- *         if self.tabixfile != NULL:
- *             self.close()
- *         self.tabixfile = NULL             # <<<<<<<<<<<<<<
- * 
- *         filename_index = index or (filename + ".tbi")
- */
-  __pyx_v_self->tabixfile = NULL;
-
-  /* "pysam/ctabix.pyx":296
- *         self.tabixfile = NULL
- * 
- *         filename_index = index or (filename + ".tbi")             # <<<<<<<<<<<<<<
- *         self.isremote = filename.startswith("http:") or filename.startswith("ftp:")
- * 
- */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_index); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_2) {
-    __pyx_t_3 = PyNumber_Add(__pyx_v_filename, __pyx_kp_s_tbi); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_1 = __pyx_t_3;
-    __pyx_t_3 = 0;
-  } else {
-    __Pyx_INCREF(__pyx_v_index);
-    __pyx_t_1 = __pyx_v_index;
-  }
-  __pyx_v_filename_index = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":297
- * 
- *         filename_index = index or (filename + ".tbi")
- *         self.isremote = filename.startswith("http:") or filename.startswith("ftp:")             # <<<<<<<<<<<<<<
- * 
- *         if not self.isremote:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_2) {
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __pyx_t_4;
-    __pyx_t_4 = 0;
-  } else {
-    __pyx_t_1 = __pyx_t_3;
-    __pyx_t_3 = 0;
-  }
-  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_self->isremote = __pyx_t_5;
-
-  /* "pysam/ctabix.pyx":299
- *         self.isremote = filename.startswith("http:") or filename.startswith("ftp:")
- * 
- *         if not self.isremote:             # <<<<<<<<<<<<<<
- *             if not os.path.exists(filename):
- *                 raise IOError("file `%s` not found" % filename)
- */
-  __pyx_t_2 = ((!(__pyx_v_self->isremote != 0)) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":300
- * 
- *         if not self.isremote:
- *             if not os.path.exists(filename):             # <<<<<<<<<<<<<<
- *                 raise IOError("file `%s` not found" % filename)
- * 
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_filename);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filename);
-    __Pyx_GIVEREF(__pyx_v_filename);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_6 = ((!__pyx_t_2) != 0);
-    if (__pyx_t_6) {
-
-      /* "pysam/ctabix.pyx":301
- *         if not self.isremote:
- *             if not os.path.exists(filename):
- *                 raise IOError("file `%s` not found" % filename)             # <<<<<<<<<<<<<<
- * 
- *             if not os.path.exists(filename_index):
- */
-      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_file_s_not_found, __pyx_v_filename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
-      __Pyx_GIVEREF(__pyx_t_4);
-      __pyx_t_4 = 0;
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/ctabix.pyx":303
- *                 raise IOError("file `%s` not found" % filename)
- * 
- *             if not os.path.exists(filename_index):             # <<<<<<<<<<<<<<
- *                 raise IOError("index `%s` not found" % filename_index)
- * 
- */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __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 = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_filename_index);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filename_index);
-    __Pyx_GIVEREF(__pyx_v_filename_index);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_2 = ((!__pyx_t_6) != 0);
-    if (__pyx_t_2) {
-
-      /* "pysam/ctabix.pyx":304
- * 
- *             if not os.path.exists(filename_index):
- *                 raise IOError("index `%s` not found" % filename_index)             # <<<<<<<<<<<<<<
- * 
- *         self._filename = filename
- */
-      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_index_s_not_found, __pyx_v_filename_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __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 = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    goto __pyx_L4;
-  }
-  __pyx_L4:;
-
-  /* "pysam/ctabix.pyx":306
- *                 raise IOError("index `%s` not found" % filename_index)
- * 
- *         self._filename = filename             # <<<<<<<<<<<<<<
- *         self._filename_index = filename_index
- * 
- */
-  __Pyx_INCREF(__pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  __Pyx_GOTREF(__pyx_v_self->_filename);
-  __Pyx_DECREF(__pyx_v_self->_filename);
-  __pyx_v_self->_filename = __pyx_v_filename;
-
-  /* "pysam/ctabix.pyx":307
- * 
- *         self._filename = filename
- *         self._filename_index = filename_index             # <<<<<<<<<<<<<<
- * 
- *         # encode all the strings to pass to tabix
- */
-  __Pyx_INCREF(__pyx_v_filename_index);
-  __Pyx_GIVEREF(__pyx_v_filename_index);
-  __Pyx_GOTREF(__pyx_v_self->_filename_index);
-  __Pyx_DECREF(__pyx_v_self->_filename_index);
-  __pyx_v_self->_filename_index = __pyx_v_filename_index;
-
-  /* "pysam/ctabix.pyx":310
- * 
- *         # encode all the strings to pass to tabix
- *         _encoded_filename = _encodeFilename(filename)             # <<<<<<<<<<<<<<
- *         _encoded_index = _encodeFilename(filename_index)
- * 
- */
-  __pyx_t_1 = __pyx_f_5pysam_6ctabix__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v__encoded_filename = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":311
- *         # encode all the strings to pass to tabix
- *         _encoded_filename = _encodeFilename(filename)
- *         _encoded_index = _encodeFilename(filename_index)             # <<<<<<<<<<<<<<
- * 
- *         # open file
- */
-  __pyx_t_1 = __pyx_f_5pysam_6ctabix__encodeFilename(__pyx_v_filename_index); 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_v__encoded_index = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":314
- * 
- *         # open file
- *         self.tabixfile = hts_open(_encoded_filename, 'r')             # <<<<<<<<<<<<<<
- *         if self.tabixfile == NULL:
- *             raise IOError("could not open file `%s`" % filename)
- */
-  __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v__encoded_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->tabixfile = hts_open(__pyx_t_7, __pyx_k_r);
-
-  /* "pysam/ctabix.pyx":315
- *         # open file
- *         self.tabixfile = hts_open(_encoded_filename, 'r')
- *         if self.tabixfile == NULL:             # <<<<<<<<<<<<<<
- *             raise IOError("could not open file `%s`" % filename)
- * 
- */
-  __pyx_t_2 = ((__pyx_v_self->tabixfile == NULL) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":316
- *         self.tabixfile = hts_open(_encoded_filename, 'r')
- *         if self.tabixfile == NULL:
- *             raise IOError("could not open file `%s`" % filename)             # <<<<<<<<<<<<<<
- * 
- *         self.index = tbx_index_load(_encoded_index)
- */
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_could_not_open_file_s, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __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 = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":318
- *             raise IOError("could not open file `%s`" % filename)
- * 
- *         self.index = tbx_index_load(_encoded_index)             # <<<<<<<<<<<<<<
- *         if self.index == NULL:
- *             raise IOError("could not open index for `%s`" % filename)
- */
-  __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v__encoded_index); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->index = tbx_index_load(__pyx_t_8);
-
-  /* "pysam/ctabix.pyx":319
- * 
- *         self.index = tbx_index_load(_encoded_index)
- *         if self.index == NULL:             # <<<<<<<<<<<<<<
- *             raise IOError("could not open index for `%s`" % filename)
- * 
- */
-  __pyx_t_2 = ((__pyx_v_self->index == NULL) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":320
- *         self.index = tbx_index_load(_encoded_index)
- *         if self.index == NULL:
- *             raise IOError("could not open index for `%s`" % filename)             # <<<<<<<<<<<<<<
- * 
- *     def _dup(self):
- */
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_could_not_open_index_for_s, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __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 = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":282
- *         self.encoding = encoding
- * 
- *     def _open( self,             # <<<<<<<<<<<<<<
- *                filename,
- *                mode='r',
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_filename_index);
-  __Pyx_XDECREF(__pyx_v__encoded_filename);
-  __Pyx_XDECREF(__pyx_v__encoded_index);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":322
- *             raise IOError("could not open index for `%s`" % filename)
- * 
- *     def _dup(self):             # <<<<<<<<<<<<<<
- *         '''return a copy of this tabix file.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_5_dup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_9TabixFile_4_dup[] = "TabixFile._dup(self)\nreturn a copy of this tabix file.\n        \n        The file is being re-opened.\n        ";
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_5_dup(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_dup (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile_4_dup(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_4_dup(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self) {
-  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_RefNannySetupContext("_dup", 0);
-
-  /* "pysam/ctabix.pyx":327
- *         The file is being re-opened.
- *         '''
- *         return TabixFile(self._filename,             # <<<<<<<<<<<<<<
- *                          mode="r",
- *                          parser=self.parser,
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_self->_filename);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_filename);
-  __Pyx_GIVEREF(__pyx_v_self->_filename);
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mode, __pyx_n_s_r) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":329
- *         return TabixFile(self._filename,
- *                          mode="r",
- *                          parser=self.parser,             # <<<<<<<<<<<<<<
- *                          index=self._filename_index,
- *                          encoding=self.encoding)
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_parser, ((PyObject *)__pyx_v_self->parser)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":330
- *                          mode="r",
- *                          parser=self.parser,
- *                          index=self._filename_index,             # <<<<<<<<<<<<<<
- *                          encoding=self.encoding)
- * 
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_index, __pyx_v_self->_filename_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":331
- *                          parser=self.parser,
- *                          index=self._filename_index,
- *                          encoding=self.encoding)             # <<<<<<<<<<<<<<
- * 
- *     def _isOpen(self):
- */
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_v_self->encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":327
- *         The file is being re-opened.
- *         '''
- *         return TabixFile(self._filename,             # <<<<<<<<<<<<<<
- *                          mode="r",
- *                          parser=self.parser,
- */
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_6ctabix_TabixFile)), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":322
- *             raise IOError("could not open index for `%s`" % filename)
- * 
- *     def _dup(self):             # <<<<<<<<<<<<<<
- *         '''return a copy of this tabix file.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile._dup", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":333
- *                          encoding=self.encoding)
- * 
- *     def _isOpen(self):             # <<<<<<<<<<<<<<
- *         '''return true if samfile has been opened.'''
- *         return self.tabixfile != NULL
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_7_isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_9TabixFile_6_isOpen[] = "TabixFile._isOpen(self)\nreturn true if samfile has been opened.";
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_7_isOpen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_isOpen (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile_6_isOpen(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_6_isOpen(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_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_RefNannySetupContext("_isOpen", 0);
-
-  /* "pysam/ctabix.pyx":335
- *     def _isOpen(self):
- *         '''return true if samfile has been opened.'''
- *         return self.tabixfile != NULL             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->tabixfile != NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":333
- *                          encoding=self.encoding)
- * 
- *     def _isOpen(self):             # <<<<<<<<<<<<<<
- *         '''return true if samfile has been opened.'''
- *         return self.tabixfile != NULL
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile._isOpen", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":338
- * 
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_9fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_9TabixFile_8fetch[] = "TabixFile.fetch(self, reference=None, start=None, end=None, region=None, parser=None, multiple_iterators=False)\nfetch one or more rows in a :term:`region` using 0-based\n        indexing. The region is specified by :term:`reference`,\n        *start* and *end*. Alternatively, a samtools :term:`region`\n        string can be supplied.\n\n        Without *reference* or *region* all entries will be fetched. \n        \n        If  [...]
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_9fetch(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_reference = 0;
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_end = 0;
-  PyObject *__pyx_v_region = 0;
-  PyObject *__pyx_v_parser = 0;
-  PyObject *__pyx_v_multiple_iterators = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("fetch (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,&__pyx_n_s_parser,&__pyx_n_s_multiple_iterators,0};
-    PyObject* values[6] = {0,0,0,0,0,0};
-
-    /* "pysam/ctabix.pyx":339
- * 
- *     def fetch(self,
- *               reference=None,             # <<<<<<<<<<<<<<
- *               start=None,
- *               end=None,
- */
-    values[0] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":340
- *     def fetch(self,
- *               reference=None,
- *               start=None,             # <<<<<<<<<<<<<<
- *               end=None,
- *               region=None,
- */
-    values[1] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":341
- *               reference=None,
- *               start=None,
- *               end=None,             # <<<<<<<<<<<<<<
- *               region=None,
- *               parser=None,
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":342
- *               start=None,
- *               end=None,
- *               region=None,             # <<<<<<<<<<<<<<
- *               parser=None,
- *               multiple_iterators=False):
- */
-    values[3] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":343
- *               end=None,
- *               region=None,
- *               parser=None,             # <<<<<<<<<<<<<<
- *               multiple_iterators=False):
- *         '''fetch one or more rows in a :term:`region` using 0-based
- */
-    values[4] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":344
- *               region=None,
- *               parser=None,
- *               multiple_iterators=False):             # <<<<<<<<<<<<<<
- *         '''fetch one or more rows in a :term:`region` using 0-based
- *         indexing. The region is specified by :term:`reference`,
- */
-    values[5] = ((PyObject *)Py_False);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reference);
-          if (value) { values[0] = value; kw_args--; }
-        }
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser);
-          if (value) { values[4] = value; kw_args--; }
-        }
-        case  5:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_multiple_iterators);
-          if (value) { values[5] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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;
-      }
-    }
-    __pyx_v_reference = values[0];
-    __pyx_v_start = values[1];
-    __pyx_v_end = values[2];
-    __pyx_v_region = values[3];
-    __pyx_v_parser = values[4];
-    __pyx_v_multiple_iterators = values[5];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("fetch", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile_8fetch(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self), __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region, __pyx_v_parser, __pyx_v_multiple_iterators);
-
-  /* "pysam/ctabix.pyx":338
- * 
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_8fetch(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region, PyObject *__pyx_v_parser, PyObject *__pyx_v_multiple_iterators) {
-  hts_itr_t *__pyx_v_iter;
-  struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_fileobj = 0;
-  PyObject *__pyx_v_s = NULL;
-  struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_a = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  struct __pyx_opt_args_5pysam_6ctabix__force_bytes __pyx_t_5;
-  char *__pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("fetch", 0);
-  __Pyx_INCREF(__pyx_v_start);
-  __Pyx_INCREF(__pyx_v_region);
-  __Pyx_INCREF(__pyx_v_parser);
-
-  /* "pysam/ctabix.pyx":365
- * 
- *         '''
- *         if not self._isOpen():             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file")
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/ctabix.pyx":366
- *         '''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- * 
- *         # convert coordinates to region string
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":369
- * 
- *         # convert coordinates to region string
- *         if reference:             # <<<<<<<<<<<<<<
- *             if end is not None:
- *                 if start is None:
- */
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_4) {
-
-    /* "pysam/ctabix.pyx":370
- *         # convert coordinates to region string
- *         if reference:
- *             if end is not None:             # <<<<<<<<<<<<<<
- *                 if start is None:
- *                     start = 0
- */
-    __pyx_t_4 = (__pyx_v_end != Py_None);
-    __pyx_t_3 = (__pyx_t_4 != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/ctabix.pyx":371
- *         if reference:
- *             if end is not None:
- *                 if start is None:             # <<<<<<<<<<<<<<
- *                     start = 0
- *                 region = '%s:%i-%i' % (reference, start + 1, end)
- */
-      __pyx_t_3 = (__pyx_v_start == Py_None);
-      __pyx_t_4 = (__pyx_t_3 != 0);
-      if (__pyx_t_4) {
-
-        /* "pysam/ctabix.pyx":372
- *             if end is not None:
- *                 if start is None:
- *                     start = 0             # <<<<<<<<<<<<<<
- *                 region = '%s:%i-%i' % (reference, start + 1, end)
- *                 if start > end:
- */
-        __Pyx_INCREF(__pyx_int_0);
-        __Pyx_DECREF_SET(__pyx_v_start, __pyx_int_0);
-        goto __pyx_L6;
-      }
-      __pyx_L6:;
-
-      /* "pysam/ctabix.pyx":373
- *                 if start is None:
- *                     start = 0
- *                 region = '%s:%i-%i' % (reference, start + 1, end)             # <<<<<<<<<<<<<<
- *                 if start > end:
- *                     raise ValueError(
- */
-      __pyx_t_2 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_v_reference);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reference);
-      __Pyx_GIVEREF(__pyx_v_reference);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_end);
-      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
-      __Pyx_GIVEREF(__pyx_v_end);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_i_i, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF_SET(__pyx_v_region, __pyx_t_2);
-      __pyx_t_2 = 0;
-
-      /* "pysam/ctabix.pyx":374
- *                     start = 0
- *                 region = '%s:%i-%i' % (reference, start + 1, end)
- *                 if start > end:             # <<<<<<<<<<<<<<
- *                     raise ValueError(
- *                         'start (%i) > end (%i)' % (start, end))
- */
-      __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, __pyx_v_end, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (__pyx_t_4) {
-
-        /* "pysam/ctabix.pyx":376
- *                 if start > end:
- *                     raise ValueError(
- *                         'start (%i) > end (%i)' % (start, end))             # <<<<<<<<<<<<<<
- *             elif start is not None:
- *                 region = '%s:%i' % (reference, start + 1)
- */
-        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_v_start);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_start);
-        __Pyx_GIVEREF(__pyx_v_start);
-        __Pyx_INCREF(__pyx_v_end);
-        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_end);
-        __Pyx_GIVEREF(__pyx_v_end);
-        __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_start_i_end_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-        /* "pysam/ctabix.pyx":375
- *                 region = '%s:%i-%i' % (reference, start + 1, end)
- *                 if start > end:
- *                     raise ValueError(             # <<<<<<<<<<<<<<
- *                         'start (%i) > end (%i)' % (start, end))
- *             elif start is not None:
- */
-        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-        __Pyx_GIVEREF(__pyx_t_1);
-        __pyx_t_1 = 0;
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      goto __pyx_L5;
-    }
-
-    /* "pysam/ctabix.pyx":377
- *                     raise ValueError(
- *                         'start (%i) > end (%i)' % (start, end))
- *             elif start is not None:             # <<<<<<<<<<<<<<
- *                 region = '%s:%i' % (reference, start + 1)
- *             else:
- */
-    __pyx_t_4 = (__pyx_v_start != Py_None);
-    __pyx_t_3 = (__pyx_t_4 != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/ctabix.pyx":378
- *                         'start (%i) > end (%i)' % (start, end))
- *             elif start is not None:
- *                 region = '%s:%i' % (reference, start + 1)             # <<<<<<<<<<<<<<
- *             else:
- *                 region = reference
- */
-      __pyx_t_1 = PyNumber_Add(__pyx_v_start, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __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 = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_reference);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_reference);
-      __Pyx_GIVEREF(__pyx_v_reference);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF_SET(__pyx_v_region, __pyx_t_1);
-      __pyx_t_1 = 0;
-      goto __pyx_L5;
-    }
-    /*else*/ {
-
-      /* "pysam/ctabix.pyx":380
- *                 region = '%s:%i' % (reference, start + 1)
- *             else:
- *                 region = reference             # <<<<<<<<<<<<<<
- * 
- *         # get iterator
- */
-      __Pyx_INCREF(__pyx_v_reference);
-      __Pyx_DECREF_SET(__pyx_v_region, __pyx_v_reference);
-    }
-    __pyx_L5:;
-    goto __pyx_L4;
-  }
-  __pyx_L4:;
-
-  /* "pysam/ctabix.pyx":387
- * 
- *         # reopen the same file if necessary
- *         if multiple_iterators:             # <<<<<<<<<<<<<<
- *             fileobj = self._dup()
- *         else:
- */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_multiple_iterators); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
-
-    /* "pysam/ctabix.pyx":388
- *         # reopen the same file if necessary
- *         if multiple_iterators:
- *             fileobj = self._dup()             # <<<<<<<<<<<<<<
- *         else:
- *             fileobj = self
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5pysam_6ctabix_TabixFile))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_fileobj = ((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_t_2);
-    __pyx_t_2 = 0;
-    goto __pyx_L8;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":390
- *             fileobj = self._dup()
- *         else:
- *             fileobj = self             # <<<<<<<<<<<<<<
- * 
- *         if region is None:
- */
-    __Pyx_INCREF(((PyObject *)__pyx_v_self));
-    __pyx_v_fileobj = __pyx_v_self;
-  }
-  __pyx_L8:;
-
-  /* "pysam/ctabix.pyx":392
- *             fileobj = self
- * 
- *         if region is None:             # <<<<<<<<<<<<<<
- *             # without region or reference - iterate from start
- *             iter = tbx_itr_queryi(fileobj.index,
- */
-  __pyx_t_3 = (__pyx_v_region == Py_None);
-  __pyx_t_4 = (__pyx_t_3 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/ctabix.pyx":394
- *         if region is None:
- *             # without region or reference - iterate from start
- *             iter = tbx_itr_queryi(fileobj.index,             # <<<<<<<<<<<<<<
- *                                   HTS_IDX_START,
- *                                   0,
- */
-    __pyx_v_iter = tbx_itr_queryi(__pyx_v_fileobj->index, HTS_IDX_START, 0, 0);
-    goto __pyx_L9;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":399
- *                                   0)
- *         else:
- *             s = _force_bytes(region, encoding=fileobj.encoding)             # <<<<<<<<<<<<<<
- *             iter = tbx_itr_querys(fileobj.index, s)
- * 
- */
-    __pyx_t_2 = __pyx_v_fileobj->encoding;
-    __Pyx_INCREF(__pyx_t_2);
-    __pyx_t_5.__pyx_n = 1;
-    __pyx_t_5.encoding = __pyx_t_2;
-    __pyx_t_1 = __pyx_f_5pysam_6ctabix__force_bytes(__pyx_v_region, &__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_s = ((PyObject*)__pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/ctabix.pyx":400
- *         else:
- *             s = _force_bytes(region, encoding=fileobj.encoding)
- *             iter = tbx_itr_querys(fileobj.index, s)             # <<<<<<<<<<<<<<
- * 
- *         if iter == NULL:
- */
-    __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_s); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_iter = tbx_itr_querys(__pyx_v_fileobj->index, __pyx_t_6);
-  }
-  __pyx_L9:;
-
-  /* "pysam/ctabix.pyx":402
- *             iter = tbx_itr_querys(fileobj.index, s)
- * 
- *         if iter == NULL:             # <<<<<<<<<<<<<<
- *             if region is None:
- *                 # possible reason is that the file is empty -
- */
-  __pyx_t_4 = ((__pyx_v_iter == NULL) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/ctabix.pyx":403
- * 
- *         if iter == NULL:
- *             if region is None:             # <<<<<<<<<<<<<<
- *                 # possible reason is that the file is empty -
- *                 # return an empty iterator
- */
-    __pyx_t_4 = (__pyx_v_region == Py_None);
-    __pyx_t_3 = (__pyx_t_4 != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/ctabix.pyx":406
- *                 # possible reason is that the file is empty -
- *                 # return an empty iterator
- *                 return EmptyIterator()             # <<<<<<<<<<<<<<
- *             else:
- *                 raise ValueError(
- */
-      __Pyx_XDECREF(__pyx_r);
-      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EmptyIterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_r = __pyx_t_2;
-      __pyx_t_2 = 0;
-      goto __pyx_L0;
-    }
-    /*else*/ {
-
-      /* "pysam/ctabix.pyx":409
- *             else:
- *                 raise ValueError(
- *                     "could not create iterator for region '%s'" %             # <<<<<<<<<<<<<<
- *                     region)
- * 
- */
-      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_could_not_create_iterator_for_re, __pyx_v_region); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-
-      /* "pysam/ctabix.pyx":408
- *                 return EmptyIterator()
- *             else:
- *                 raise ValueError(             # <<<<<<<<<<<<<<
- *                     "could not create iterator for region '%s'" %
- *                     region)
- */
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-
-  /* "pysam/ctabix.pyx":413
- * 
- *         # use default parser if no parser is specified
- *         if parser is None:             # <<<<<<<<<<<<<<
- *             parser = fileobj.parser
- * 
- */
-  __pyx_t_3 = (__pyx_v_parser == Py_None);
-  __pyx_t_4 = (__pyx_t_3 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/ctabix.pyx":414
- *         # use default parser if no parser is specified
- *         if parser is None:
- *             parser = fileobj.parser             # <<<<<<<<<<<<<<
- * 
- *         cdef TabixIterator a
- */
-    __pyx_t_2 = ((PyObject *)__pyx_v_fileobj->parser);
-    __Pyx_INCREF(__pyx_t_2);
-    __Pyx_DECREF_SET(__pyx_v_parser, __pyx_t_2);
-    __pyx_t_2 = 0;
-    goto __pyx_L12;
-  }
-  __pyx_L12:;
-
-  /* "pysam/ctabix.pyx":417
- * 
- *         cdef TabixIterator a
- *         if parser is None:             # <<<<<<<<<<<<<<
- *             a = TabixIterator(encoding=fileobj.encoding)
- *         else:
- */
-  __pyx_t_4 = (__pyx_v_parser == Py_None);
-  __pyx_t_3 = (__pyx_t_4 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/ctabix.pyx":418
- *         cdef TabixIterator a
- *         if parser is None:
- *             a = TabixIterator(encoding=fileobj.encoding)             # <<<<<<<<<<<<<<
- *         else:
- *             parser.set_encoding(fileobj.encoding)
- */
-    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_encoding, __pyx_v_fileobj->encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_6ctabix_TabixIterator)), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_a = ((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)__pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L13;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":420
- *             a = TabixIterator(encoding=fileobj.encoding)
- *         else:
- *             parser.set_encoding(fileobj.encoding)             # <<<<<<<<<<<<<<
- *             a = TabixIteratorParsed(parser)
- * 
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_set_encoding); 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_fileobj->encoding);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fileobj->encoding);
-    __Pyx_GIVEREF(__pyx_v_fileobj->encoding);
-    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-    /* "pysam/ctabix.pyx":421
- *         else:
- *             parser.set_encoding(fileobj.encoding)
- *             a = TabixIteratorParsed(parser)             # <<<<<<<<<<<<<<
- * 
- *         a.tabixfile = fileobj
- */
-    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_parser);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_parser);
-    __Pyx_GIVEREF(__pyx_v_parser);
-    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_6ctabix_TabixIteratorParsed)), __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_v_a = ((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)__pyx_t_2);
-    __pyx_t_2 = 0;
-  }
-  __pyx_L13:;
-
-  /* "pysam/ctabix.pyx":423
- *             a = TabixIteratorParsed(parser)
- * 
- *         a.tabixfile = fileobj             # <<<<<<<<<<<<<<
- *         a.iterator = iter
- * 
- */
-  __Pyx_INCREF(((PyObject *)__pyx_v_fileobj));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_fileobj));
-  __Pyx_GOTREF(__pyx_v_a->tabixfile);
-  __Pyx_DECREF(((PyObject *)__pyx_v_a->tabixfile));
-  __pyx_v_a->tabixfile = __pyx_v_fileobj;
-
-  /* "pysam/ctabix.pyx":424
- * 
- *         a.tabixfile = fileobj
- *         a.iterator = iter             # <<<<<<<<<<<<<<
- * 
- *         return a
- */
-  __pyx_v_a->iterator = __pyx_v_iter;
-
-  /* "pysam/ctabix.pyx":426
- *         a.iterator = iter
- * 
- *         return a             # <<<<<<<<<<<<<<
- * 
- *     ###############################################################
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_a));
-  __pyx_r = ((PyObject *)__pyx_v_a);
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":338
- * 
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_fileobj);
-  __Pyx_XDECREF(__pyx_v_s);
-  __Pyx_XDECREF((PyObject *)__pyx_v_a);
-  __Pyx_XDECREF(__pyx_v_start);
-  __Pyx_XDECREF(__pyx_v_region);
-  __Pyx_XDECREF(__pyx_v_parser);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":435
- *     property filename:
- *         '''filename associated with this object.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen():
- *                 raise ValueError("I/O operation on closed file")
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_8filename_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_8filename_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile_8filename___get__(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_8filename___get__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/ctabix.pyx":436
- *         '''filename associated with this object.'''
- *         def __get__(self):
- *             if not self._isOpen():             # <<<<<<<<<<<<<<
- *                 raise ValueError("I/O operation on closed file")
- *             return self._filename
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_isOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_3) != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/ctabix.pyx":437
- *         def __get__(self):
- *             if not self._isOpen():
- *                 raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *             return self._filename
- * 
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":438
- *             if not self._isOpen():
- *                 raise ValueError("I/O operation on closed file")
- *             return self._filename             # <<<<<<<<<<<<<<
- * 
- *     property header:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self->_filename);
-  __pyx_r = __pyx_v_self->_filename;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":435
- *     property filename:
- *         '''filename associated with this object.'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             if not self._isOpen():
- *                 raise ValueError("I/O operation on closed file")
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile.filename.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":448
- *         '''
- * 
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return GZIteratorHead(self.filename)
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_6header_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_6header_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile_6header___get__(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_6header___get__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/ctabix.pyx":449
- * 
- *         def __get__(self):
- *             return GZIteratorHead(self.filename)             # <<<<<<<<<<<<<<
- * 
- *     property contigs:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __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 = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_6ctabix_GZIteratorHead)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":448
- *         '''
- * 
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return GZIteratorHead(self.filename)
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile.header.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":453
- *     property contigs:
- *         '''list of chromosome names'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef char ** sequences
- *             cdef int nsequences
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_7contigs_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_7contigs_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile_7contigs___get__(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_7contigs___get__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self) {
-  char **__pyx_v_sequences;
-  int __pyx_v_nsequences;
-  int __pyx_v_x;
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/ctabix.pyx":457
- *             cdef int nsequences
- * 
- *             sequences = tbx_seqnames(self.index, &nsequences)             # <<<<<<<<<<<<<<
- *             cdef int x
- *             result = []
- */
-  __pyx_v_sequences = tbx_seqnames(__pyx_v_self->index, (&__pyx_v_nsequences));
-
-  /* "pysam/ctabix.pyx":459
- *             sequences = tbx_seqnames(self.index, &nsequences)
- *             cdef int x
- *             result = []             # <<<<<<<<<<<<<<
- *             for x from 0 <= x < nsequences:
- *                 result.append(sequences[x])
- */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_result = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":460
- *             cdef int x
- *             result = []
- *             for x from 0 <= x < nsequences:             # <<<<<<<<<<<<<<
- *                 result.append(sequences[x])
- * 
- */
-  __pyx_t_2 = __pyx_v_nsequences;
-  for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_2; __pyx_v_x++) {
-
-    /* "pysam/ctabix.pyx":461
- *             result = []
- *             for x from 0 <= x < nsequences:
- *                 result.append(sequences[x])             # <<<<<<<<<<<<<<
- * 
- *             # htslib instructions:
- */
-    __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_sequences[__pyx_v_x])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-
-  /* "pysam/ctabix.pyx":465
- *             # htslib instructions:
- *             # only free container, not the sequences themselves
- *             free(sequences)             # <<<<<<<<<<<<<<
- * 
- *             return result
- */
-  free(__pyx_v_sequences);
-
-  /* "pysam/ctabix.pyx":467
- *             free(sequences)
- * 
- *             return result             # <<<<<<<<<<<<<<
- * 
- *     def close(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":453
- *     property contigs:
- *         '''list of chromosome names'''
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             cdef char ** sequences
- *             cdef int nsequences
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.ctabix.TabixFile.contigs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":469
- *             return result
- * 
- *     def close(self):             # <<<<<<<<<<<<<<
- *         '''
- *         closes the :class:`pysam.TabixFile`.'''
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_11close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_9TabixFile_10close[] = "TabixFile.close(self)\n\n        closes the :class:`pysam.TabixFile`.";
-static PyObject *__pyx_pw_5pysam_6ctabix_9TabixFile_11close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("close (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_9TabixFile_10close(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_9TabixFile_10close(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("close", 0);
-
-  /* "pysam/ctabix.pyx":472
- *         '''
- *         closes the :class:`pysam.TabixFile`.'''
- *         if self.tabixfile != NULL:             # <<<<<<<<<<<<<<
- *             hts_close(self.tabixfile)
- *             self.tabixfile = NULL
- */
-  __pyx_t_1 = ((__pyx_v_self->tabixfile != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":473
- *         closes the :class:`pysam.TabixFile`.'''
- *         if self.tabixfile != NULL:
- *             hts_close(self.tabixfile)             # <<<<<<<<<<<<<<
- *             self.tabixfile = NULL
- *         if self.index != NULL:
- */
-    hts_close(__pyx_v_self->tabixfile);
-
-    /* "pysam/ctabix.pyx":474
- *         if self.tabixfile != NULL:
- *             hts_close(self.tabixfile)
- *             self.tabixfile = NULL             # <<<<<<<<<<<<<<
- *         if self.index != NULL:
- *             tbx_destroy(self.index)
- */
-    __pyx_v_self->tabixfile = NULL;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/ctabix.pyx":475
- *             hts_close(self.tabixfile)
- *             self.tabixfile = NULL
- *         if self.index != NULL:             # <<<<<<<<<<<<<<
- *             tbx_destroy(self.index)
- *             self.index = NULL
- */
-  __pyx_t_1 = ((__pyx_v_self->index != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":476
- *             self.tabixfile = NULL
- *         if self.index != NULL:
- *             tbx_destroy(self.index)             # <<<<<<<<<<<<<<
- *             self.index = NULL
- * 
- */
-    tbx_destroy(__pyx_v_self->index);
-
-    /* "pysam/ctabix.pyx":477
- *         if self.index != NULL:
- *             tbx_destroy(self.index)
- *             self.index = NULL             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__( self ):
- */
-    __pyx_v_self->index = NULL;
-    goto __pyx_L4;
-  }
-  __pyx_L4:;
-
-  /* "pysam/ctabix.pyx":469
- *             return result
- * 
- *     def close(self):             # <<<<<<<<<<<<<<
- *         '''
- *         closes the :class:`pysam.TabixFile`.'''
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":479
- *             self.index = NULL
- * 
- *     def __dealloc__( self ):             # <<<<<<<<<<<<<<
- *         # remember: dealloc cannot call other python methods
- *         # note: no doc string
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_6ctabix_9TabixFile_13__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_6ctabix_9TabixFile_13__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_6ctabix_9TabixFile_12__dealloc__(((struct __pyx_obj_5pysam_6ctabix_TabixFile *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_6ctabix_9TabixFile_12__dealloc__(struct __pyx_obj_5pysam_6ctabix_TabixFile *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-
-  /* "pysam/ctabix.pyx":483
- *         # note: no doc string
- *         # note: __del__ is not called.
- *         if self.tabixfile != NULL:             # <<<<<<<<<<<<<<
- *             hts_close(self.tabixfile)
- *             self.tabixfile = NULL
- */
-  __pyx_t_1 = ((__pyx_v_self->tabixfile != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":484
- *         # note: __del__ is not called.
- *         if self.tabixfile != NULL:
- *             hts_close(self.tabixfile)             # <<<<<<<<<<<<<<
- *             self.tabixfile = NULL
- *         if self.index != NULL:
- */
-    hts_close(__pyx_v_self->tabixfile);
-
-    /* "pysam/ctabix.pyx":485
- *         if self.tabixfile != NULL:
- *             hts_close(self.tabixfile)
- *             self.tabixfile = NULL             # <<<<<<<<<<<<<<
- *         if self.index != NULL:
- *             tbx_destroy(self.index)
- */
-    __pyx_v_self->tabixfile = NULL;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/ctabix.pyx":486
- *             hts_close(self.tabixfile)
- *             self.tabixfile = NULL
- *         if self.index != NULL:             # <<<<<<<<<<<<<<
- *             tbx_destroy(self.index)
- * 
- */
-  __pyx_t_1 = ((__pyx_v_self->index != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":487
- *             self.tabixfile = NULL
- *         if self.index != NULL:
- *             tbx_destroy(self.index)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    tbx_destroy(__pyx_v_self->index);
-    goto __pyx_L4;
-  }
-  __pyx_L4:;
-
-  /* "pysam/ctabix.pyx":479
- *             self.index = NULL
- * 
- *     def __dealloc__( self ):             # <<<<<<<<<<<<<<
- *         # remember: dealloc cannot call other python methods
- *         # note: no doc string
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/ctabix.pyx":495
- *     """
- * 
- *     def __init__(self, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6ctabix_13TabixIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6ctabix_13TabixIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_encoding = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_encoding,0};
-    PyObject* values[1] = {0};
-    values[0] = ((PyObject *)__pyx_n_s_ascii);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
-          if (value) { values[0] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_encoding = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.TabixIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_13TabixIterator___init__(((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)__pyx_v_self), __pyx_v_encoding);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6ctabix_13TabixIterator___init__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self, PyObject *__pyx_v_encoding) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-
-  /* "pysam/ctabix.pyx":496
- * 
- *     def __init__(self, encoding="ascii"):
- *         self.encoding = encoding             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __Pyx_INCREF(__pyx_v_encoding);
-  __Pyx_GIVEREF(__pyx_v_encoding);
-  __Pyx_GOTREF(__pyx_v_self->encoding);
-  __Pyx_DECREF(__pyx_v_self->encoding);
-  __pyx_v_self->encoding = __pyx_v_encoding;
-
-  /* "pysam/ctabix.pyx":495
- *     """
- * 
- *     def __init__(self, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":498
- *         self.encoding = encoding
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         self.buffer.s = NULL
- *         self.buffer.l = 0
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_13TabixIterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6ctabix_13TabixIterator_3__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_13TabixIterator_2__iter__(((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_13TabixIterator_2__iter__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-
-  /* "pysam/ctabix.pyx":499
- * 
- *     def __iter__(self):
- *         self.buffer.s = NULL             # <<<<<<<<<<<<<<
- *         self.buffer.l = 0
- *         self.buffer.m = 0
- */
-  __pyx_v_self->buffer.s = NULL;
-
-  /* "pysam/ctabix.pyx":500
- *     def __iter__(self):
- *         self.buffer.s = NULL
- *         self.buffer.l = 0             # <<<<<<<<<<<<<<
- *         self.buffer.m = 0
- * 
- */
-  __pyx_v_self->buffer.l = 0;
-
-  /* "pysam/ctabix.pyx":501
- *         self.buffer.s = NULL
- *         self.buffer.l = 0
- *         self.buffer.m = 0             # <<<<<<<<<<<<<<
- * 
- *         return self
- */
-  __pyx_v_self->buffer.m = 0;
-
-  /* "pysam/ctabix.pyx":503
- *         self.buffer.m = 0
- * 
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef int __cnext__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":498
- *         self.encoding = encoding
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         self.buffer.s = NULL
- *         self.buffer.l = 0
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":505
- *         return self
- * 
- *     cdef int __cnext__(self):             # <<<<<<<<<<<<<<
- *         '''iterate to next element.
- * 
- */
-
-static int __pyx_f_5pysam_6ctabix_13TabixIterator___cnext__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self) {
-  int __pyx_v_retval;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("__cnext__", 0);
-
-  /* "pysam/ctabix.pyx":511
- *         was called.
- *         '''
- *         if self.tabixfile.tabixfile == NULL:             # <<<<<<<<<<<<<<
- *             return -5
- * 
- */
-  __pyx_t_1 = ((__pyx_v_self->tabixfile->tabixfile == NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":512
- *         '''
- *         if self.tabixfile.tabixfile == NULL:
- *             return -5             # <<<<<<<<<<<<<<
- * 
- *         cdef int retval
- */
-    __pyx_r = -5;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":516
- *         cdef int retval
- * 
- *         while 1:             # <<<<<<<<<<<<<<
- * 
- *             retval = tbx_itr_next(
- */
-  while (1) {
-
-    /* "pysam/ctabix.pyx":518
- *         while 1:
- * 
- *             retval = tbx_itr_next(             # <<<<<<<<<<<<<<
- *                 self.tabixfile.tabixfile,
- *                 self.tabixfile.index,
- */
-    __pyx_v_retval = tbx_itr_next(__pyx_v_self->tabixfile->tabixfile, __pyx_v_self->tabixfile->index, __pyx_v_self->iterator, (&__pyx_v_self->buffer));
-
-    /* "pysam/ctabix.pyx":523
- *                 self.iterator,
- *                 &self.buffer)
- *             if retval < 0:             # <<<<<<<<<<<<<<
- *                 break
- * 
- */
-    __pyx_t_1 = ((__pyx_v_retval < 0) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/ctabix.pyx":524
- *                 &self.buffer)
- *             if retval < 0:
- *                 break             # <<<<<<<<<<<<<<
- * 
- *             if self.buffer.s[0] != '#':
- */
-      goto __pyx_L5_break;
-    }
-
-    /* "pysam/ctabix.pyx":526
- *                 break
- * 
- *             if self.buffer.s[0] != '#':             # <<<<<<<<<<<<<<
- *                 break
- * 
- */
-    __pyx_t_1 = (((__pyx_v_self->buffer.s[0]) != '#') != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/ctabix.pyx":527
- * 
- *             if self.buffer.s[0] != '#':
- *                 break             # <<<<<<<<<<<<<<
- * 
- *         return retval
- */
-      goto __pyx_L5_break;
-    }
-  }
-  __pyx_L5_break:;
-
-  /* "pysam/ctabix.pyx":529
- *                 break
- * 
- *         return retval             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __pyx_r = __pyx_v_retval;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":505
- *         return self
- * 
- *     cdef int __cnext__(self):             # <<<<<<<<<<<<<<
- *         '''iterate to next element.
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":531
- *         return retval
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_13TabixIterator_5__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_13TabixIterator_4__next__[] = "python version of next().\n\n        pyrex uses this non-standard name instead of next()\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_6ctabix_13TabixIterator_4__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_6ctabix_13TabixIterator_5__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_13TabixIterator_4__next__(((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_13TabixIterator_4__next__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self) {
-  int __pyx_v_retval;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  struct __pyx_opt_args_5pysam_6ctabix__charptr_to_str __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/ctabix.pyx":537
- *         """
- * 
- *         cdef int retval = self.__cnext__()             # <<<<<<<<<<<<<<
- *         if retval == -5:
- *             raise IOError("iteration on closed file")
- */
-  __pyx_v_retval = ((struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator *)__pyx_v_self->__pyx_vtab)->__pyx___cnext__(__pyx_v_self);
-
-  /* "pysam/ctabix.pyx":538
- * 
- *         cdef int retval = self.__cnext__()
- *         if retval == -5:             # <<<<<<<<<<<<<<
- *             raise IOError("iteration on closed file")
- *         elif retval < 0:
- */
-  __pyx_t_1 = ((__pyx_v_retval == -5) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":539
- *         cdef int retval = self.__cnext__()
- *         if retval == -5:
- *             raise IOError("iteration on closed file")             # <<<<<<<<<<<<<<
- *         elif retval < 0:
- *             raise StopIteration
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":540
- *         if retval == -5:
- *             raise IOError("iteration on closed file")
- *         elif retval < 0:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- * 
- */
-  __pyx_t_1 = ((__pyx_v_retval < 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":541
- *             raise IOError("iteration on closed file")
- *         elif retval < 0:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *         return _charptr_to_str(self.buffer.s, self.encoding)
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":543
- *             raise StopIteration
- * 
- *         return _charptr_to_str(self.buffer.s, self.encoding)             # <<<<<<<<<<<<<<
- * 
- *     def next(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_v_self->encoding;
-  __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_4.__pyx_n = 1;
-  __pyx_t_4.encoding = __pyx_t_2;
-  __pyx_t_3 = __pyx_f_5pysam_6ctabix__charptr_to_str(__pyx_v_self->buffer.s, &__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":531
- *         return retval
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.ctabix.TabixIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":545
- *         return _charptr_to_str(self.buffer.s, self.encoding)
- * 
- *     def next(self):             # <<<<<<<<<<<<<<
- *         return self.__next__()
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_13TabixIterator_7next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_13TabixIterator_6next[] = "TabixIterator.next(self)";
-static PyObject *__pyx_pw_5pysam_6ctabix_13TabixIterator_7next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("next (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_13TabixIterator_6next(((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_13TabixIterator_6next(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("next", 0);
-
-  /* "pysam/ctabix.pyx":546
- * 
- *     def next(self):
- *         return self.__next__()             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":545
- *         return _charptr_to_str(self.buffer.s, self.encoding)
- * 
- *     def next(self):             # <<<<<<<<<<<<<<
- *         return self.__next__()
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.TabixIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":548
- *         return self.__next__()
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         if <void*>self.iterator != NULL:
- *             tbx_itr_destroy(self.iterator)
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_6ctabix_13TabixIterator_9__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_6ctabix_13TabixIterator_9__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_6ctabix_13TabixIterator_8__dealloc__(((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_6ctabix_13TabixIterator_8__dealloc__(struct __pyx_obj_5pysam_6ctabix_TabixIterator *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-
-  /* "pysam/ctabix.pyx":549
- * 
- *     def __dealloc__(self):
- *         if <void*>self.iterator != NULL:             # <<<<<<<<<<<<<<
- *             tbx_itr_destroy(self.iterator)
- *         if self.buffer.s != NULL:
- */
-  __pyx_t_1 = ((((void *)__pyx_v_self->iterator) != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":550
- *     def __dealloc__(self):
- *         if <void*>self.iterator != NULL:
- *             tbx_itr_destroy(self.iterator)             # <<<<<<<<<<<<<<
- *         if self.buffer.s != NULL:
- *             free(self.buffer.s)
- */
-    tbx_itr_destroy(__pyx_v_self->iterator);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/ctabix.pyx":551
- *         if <void*>self.iterator != NULL:
- *             tbx_itr_destroy(self.iterator)
- *         if self.buffer.s != NULL:             # <<<<<<<<<<<<<<
- *             free(self.buffer.s)
- * 
- */
-  __pyx_t_1 = ((__pyx_v_self->buffer.s != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":552
- *             tbx_itr_destroy(self.iterator)
- *         if self.buffer.s != NULL:
- *             free(self.buffer.s)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    free(__pyx_v_self->buffer.s);
-    goto __pyx_L4;
-  }
-  __pyx_L4:;
-
-  /* "pysam/ctabix.pyx":548
- *         return self.__next__()
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         if <void*>self.iterator != NULL:
- *             tbx_itr_destroy(self.iterator)
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/ctabix.pyx":558
- *     '''empty iterator'''
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_13EmptyIterator_1__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_13EmptyIterator___iter__[] = "EmptyIterator.__iter__(self)";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_13EmptyIterator_1__iter__ = {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_13EmptyIterator_1__iter__, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_13EmptyIterator___iter__)};
-static PyObject *__pyx_pw_5pysam_6ctabix_13EmptyIterator_1__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_13EmptyIterator___iter__(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_13EmptyIterator___iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-
-  /* "pysam/ctabix.pyx":559
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     def next(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self);
-  __pyx_r = __pyx_v_self;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":558
- *     '''empty iterator'''
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":561
- *         return self
- * 
- *     def next(self):             # <<<<<<<<<<<<<<
- *         raise StopIteration()
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_13EmptyIterator_3next(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_13EmptyIterator_2next[] = "EmptyIterator.next(self)";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_13EmptyIterator_3next = {__Pyx_NAMESTR("next"), (PyCFunction)__pyx_pw_5pysam_6ctabix_13EmptyIterator_3next, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_13EmptyIterator_2next)};
-static PyObject *__pyx_pw_5pysam_6ctabix_13EmptyIterator_3next(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("next (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_13EmptyIterator_2next(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_13EmptyIterator_2next(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_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_RefNannySetupContext("next", 0);
-
-  /* "pysam/ctabix.pyx":562
- * 
- *     def next(self):
- *         raise StopIteration()             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_StopIteration, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":561
- *         return self
- * 
- *     def next(self):             # <<<<<<<<<<<<<<
- *         raise StopIteration()
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.ctabix.EmptyIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":564
- *         raise StopIteration()
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         raise StopIteration()
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_13EmptyIterator_5__next__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_13EmptyIterator_4__next__[] = "EmptyIterator.__next__(self)";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_13EmptyIterator_5__next__ = {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_13EmptyIterator_5__next__, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_13EmptyIterator_4__next__)};
-static PyObject *__pyx_pw_5pysam_6ctabix_13EmptyIterator_5__next__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_13EmptyIterator_4__next__(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_13EmptyIterator_4__next__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_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_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/ctabix.pyx":565
- * 
- *     def __next__(self):
- *         raise StopIteration()             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_StopIteration, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":564
- *         raise StopIteration()
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         raise StopIteration()
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.ctabix.EmptyIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":576
- *     """
- * 
- *     def __init__(self,             # <<<<<<<<<<<<<<
- *                  Parser parser):
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6ctabix_19TabixIteratorParsed_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6ctabix_19TabixIteratorParsed_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_parser = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parser,0};
-    PyObject* values[1] = {0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-    }
-    __pyx_v_parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)values[0]);
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.TabixIteratorParsed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5pysam_6ctabix_Parser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_6ctabix_19TabixIteratorParsed___init__(((struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *)__pyx_v_self), __pyx_v_parser);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6ctabix_19TabixIteratorParsed___init__(struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *__pyx_v_self, struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_parser) {
-  int __pyx_r;
-  __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_RefNannySetupContext("__init__", 0);
-
-  /* "pysam/ctabix.pyx":579
- *                  Parser parser):
- * 
- *         TabixIterator.__init__(self)             # <<<<<<<<<<<<<<
- *         self.parser = parser
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_5pysam_6ctabix_TabixIterator)), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __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 = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/ctabix.pyx":580
- * 
- *         TabixIterator.__init__(self)
- *         self.parser = parser             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __Pyx_INCREF(((PyObject *)__pyx_v_parser));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_parser));
-  __Pyx_GOTREF(__pyx_v_self->parser);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->parser));
-  __pyx_v_self->parser = __pyx_v_parser;
-
-  /* "pysam/ctabix.pyx":576
- *     """
- * 
- *     def __init__(self,             # <<<<<<<<<<<<<<
- *                  Parser parser):
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.ctabix.TabixIteratorParsed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":582
- *         self.parser = parser
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_19TabixIteratorParsed_3__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_19TabixIteratorParsed_2__next__[] = "python version of next().\n\n        pyrex uses this non-standard name instead of next()\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_6ctabix_19TabixIteratorParsed_2__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_6ctabix_19TabixIteratorParsed_3__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_19TabixIteratorParsed_2__next__(((struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_19TabixIteratorParsed_2__next__(struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *__pyx_v_self) {
-  int __pyx_v_retval;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/ctabix.pyx":588
- *         """
- * 
- *         cdef int retval = self.__cnext__()             # <<<<<<<<<<<<<<
- *         if retval == -5:
- *             raise IOError("iteration on closed file")
- */
-  __pyx_v_retval = ((struct __pyx_vtabstruct_5pysam_6ctabix_TabixIteratorParsed *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___cnext__(((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)__pyx_v_self));
-
-  /* "pysam/ctabix.pyx":589
- * 
- *         cdef int retval = self.__cnext__()
- *         if retval == -5:             # <<<<<<<<<<<<<<
- *             raise IOError("iteration on closed file")
- *         elif retval < 0:
- */
-  __pyx_t_1 = ((__pyx_v_retval == -5) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":590
- *         cdef int retval = self.__cnext__()
- *         if retval == -5:
- *             raise IOError("iteration on closed file")             # <<<<<<<<<<<<<<
- *         elif retval < 0:
- *             raise StopIteration
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":591
- *         if retval == -5:
- *             raise IOError("iteration on closed file")
- *         elif retval < 0:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- * 
- */
-  __pyx_t_1 = ((__pyx_v_retval < 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":592
- *             raise IOError("iteration on closed file")
- *         elif retval < 0:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *         return self.parser.parse(self.buffer.s,
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":594
- *             raise StopIteration
- * 
- *         return self.parser.parse(self.buffer.s,             # <<<<<<<<<<<<<<
- *                                  self.buffer.l)
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-
-  /* "pysam/ctabix.pyx":595
- * 
- *         return self.parser.parse(self.buffer.s,
- *                                  self.buffer.l)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysam_6ctabix_Parser *)__pyx_v_self->parser->__pyx_vtab)->parse(__pyx_v_self->parser, __pyx_v_self->__pyx_base.buffer.s, __pyx_v_self->__pyx_base.buffer.l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":582
- *         self.parser = parser
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.TabixIteratorParsed.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":599
- * 
- * cdef class GZIterator:
- *     def __init__(self, filename, int buffer_size=65536, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         '''iterate line-by-line through gzip (or bgzip)
- *         compressed file.
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6ctabix_10GZIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_10GZIterator___init__[] = "iterate line-by-line through gzip (or bgzip)\n        compressed file.\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_6ctabix_10GZIterator___init__;
-#endif
-static int __pyx_pw_5pysam_6ctabix_10GZIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_filename = 0;
-  int __pyx_v_buffer_size;
-  PyObject *__pyx_v_encoding = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_buffer_size,&__pyx_n_s_encoding,0};
-    PyObject* values[3] = {0,0,0};
-    values[2] = ((PyObject *)__pyx_n_s_ascii);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer_size);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __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_filename = values[0];
-    if (values[1]) {
-      __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_buffer_size = ((int)65536);
-    }
-    __pyx_v_encoding = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.GZIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_10GZIterator___init__(((struct __pyx_obj_5pysam_6ctabix_GZIterator *)__pyx_v_self), __pyx_v_filename, __pyx_v_buffer_size, __pyx_v_encoding);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6ctabix_10GZIterator___init__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self, PyObject *__pyx_v_filename, int __pyx_v_buffer_size, PyObject *__pyx_v_encoding) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  char *__pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__init__", 0);
-  __Pyx_INCREF(__pyx_v_filename);
-
-  /* "pysam/ctabix.pyx":603
- *         compressed file.
- *         '''
- *         if not os.path.exists(filename):             # <<<<<<<<<<<<<<
- *             raise IOError("No such file or directory: %s" % filename)
- * 
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = ((!__pyx_t_4) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/ctabix.pyx":604
- *         '''
- *         if not os.path.exists(filename):
- *             raise IOError("No such file or directory: %s" % filename)             # <<<<<<<<<<<<<<
- * 
- *         filename = _encodeFilename(filename)
- */
-    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_No_such_file_or_directory_s, __pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __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 = 604; __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 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":606
- *             raise IOError("No such file or directory: %s" % filename)
- * 
- *         filename = _encodeFilename(filename)             # <<<<<<<<<<<<<<
- *         self.gzipfile = gzopen(filename, "r")
- *         self._filename = filename
- */
-  __pyx_t_3 = __pyx_f_5pysam_6ctabix__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_3);
-  __pyx_t_3 = 0;
-
-  /* "pysam/ctabix.pyx":607
- * 
- *         filename = _encodeFilename(filename)
- *         self.gzipfile = gzopen(filename, "r")             # <<<<<<<<<<<<<<
- *         self._filename = filename
- *         self.kstream = ks_init(self.gzipfile)
- */
-  __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_self->gzipfile = gzopen(__pyx_t_6, __pyx_k_r);
-
-  /* "pysam/ctabix.pyx":608
- *         filename = _encodeFilename(filename)
- *         self.gzipfile = gzopen(filename, "r")
- *         self._filename = filename             # <<<<<<<<<<<<<<
- *         self.kstream = ks_init(self.gzipfile)
- *         self.encoding = encoding
- */
-  __Pyx_INCREF(__pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  __Pyx_GOTREF(__pyx_v_self->_filename);
-  __Pyx_DECREF(__pyx_v_self->_filename);
-  __pyx_v_self->_filename = __pyx_v_filename;
-
-  /* "pysam/ctabix.pyx":609
- *         self.gzipfile = gzopen(filename, "r")
- *         self._filename = filename
- *         self.kstream = ks_init(self.gzipfile)             # <<<<<<<<<<<<<<
- *         self.encoding = encoding
- * 
- */
-  __pyx_v_self->kstream = ks_init(__pyx_v_self->gzipfile);
-
-  /* "pysam/ctabix.pyx":610
- *         self._filename = filename
- *         self.kstream = ks_init(self.gzipfile)
- *         self.encoding = encoding             # <<<<<<<<<<<<<<
- * 
- *         self.buffer.l = 0
- */
-  __Pyx_INCREF(__pyx_v_encoding);
-  __Pyx_GIVEREF(__pyx_v_encoding);
-  __Pyx_GOTREF(__pyx_v_self->encoding);
-  __Pyx_DECREF(__pyx_v_self->encoding);
-  __pyx_v_self->encoding = __pyx_v_encoding;
-
-  /* "pysam/ctabix.pyx":612
- *         self.encoding = encoding
- * 
- *         self.buffer.l = 0             # <<<<<<<<<<<<<<
- *         self.buffer.m = 0
- *         self.buffer.s = <char*>malloc(buffer_size)
- */
-  __pyx_v_self->buffer.l = 0;
-
-  /* "pysam/ctabix.pyx":613
- * 
- *         self.buffer.l = 0
- *         self.buffer.m = 0             # <<<<<<<<<<<<<<
- *         self.buffer.s = <char*>malloc(buffer_size)
- * 
- */
-  __pyx_v_self->buffer.m = 0;
-
-  /* "pysam/ctabix.pyx":614
- *         self.buffer.l = 0
- *         self.buffer.m = 0
- *         self.buffer.s = <char*>malloc(buffer_size)             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-  __pyx_v_self->buffer.s = ((char *)malloc(__pyx_v_buffer_size));
-
-  /* "pysam/ctabix.pyx":599
- * 
- * cdef class GZIterator:
- *     def __init__(self, filename, int buffer_size=65536, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         '''iterate line-by-line through gzip (or bgzip)
- *         compressed file.
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.ctabix.GZIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_filename);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":616
- *         self.buffer.s = <char*>malloc(buffer_size)
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         '''close file.'''
- *         if self.gzipfile != NULL:
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_6ctabix_10GZIterator_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_6ctabix_10GZIterator_3__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_6ctabix_10GZIterator_2__dealloc__(((struct __pyx_obj_5pysam_6ctabix_GZIterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_6ctabix_10GZIterator_2__dealloc__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-
-  /* "pysam/ctabix.pyx":618
- *     def __dealloc__(self):
- *         '''close file.'''
- *         if self.gzipfile != NULL:             # <<<<<<<<<<<<<<
- *             gzclose(self.gzipfile)
- *             self.gzipfile = NULL
- */
-  __pyx_t_1 = ((__pyx_v_self->gzipfile != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":619
- *         '''close file.'''
- *         if self.gzipfile != NULL:
- *             gzclose(self.gzipfile)             # <<<<<<<<<<<<<<
- *             self.gzipfile = NULL
- *         if self.buffer.s != NULL:
- */
-    gzclose(__pyx_v_self->gzipfile);
-
-    /* "pysam/ctabix.pyx":620
- *         if self.gzipfile != NULL:
- *             gzclose(self.gzipfile)
- *             self.gzipfile = NULL             # <<<<<<<<<<<<<<
- *         if self.buffer.s != NULL:
- *             free(self.buffer.s)
- */
-    __pyx_v_self->gzipfile = NULL;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/ctabix.pyx":621
- *             gzclose(self.gzipfile)
- *             self.gzipfile = NULL
- *         if self.buffer.s != NULL:             # <<<<<<<<<<<<<<
- *             free(self.buffer.s)
- *         ks_destroy(self.kstream)
- */
-  __pyx_t_1 = ((__pyx_v_self->buffer.s != NULL) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":622
- *             self.gzipfile = NULL
- *         if self.buffer.s != NULL:
- *             free(self.buffer.s)             # <<<<<<<<<<<<<<
- *         ks_destroy(self.kstream)
- * 
- */
-    free(__pyx_v_self->buffer.s);
-    goto __pyx_L4;
-  }
-  __pyx_L4:;
-
-  /* "pysam/ctabix.pyx":623
- *         if self.buffer.s != NULL:
- *             free(self.buffer.s)
- *         ks_destroy(self.kstream)             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  ks_destroy(__pyx_v_self->kstream);
-
-  /* "pysam/ctabix.pyx":616
- *         self.buffer.s = <char*>malloc(buffer_size)
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         '''close file.'''
- *         if self.gzipfile != NULL:
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/ctabix.pyx":625
- *         ks_destroy(self.kstream)
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_10GZIterator_5__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6ctabix_10GZIterator_5__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_10GZIterator_4__iter__(((struct __pyx_obj_5pysam_6ctabix_GZIterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_10GZIterator_4__iter__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-
-  /* "pysam/ctabix.pyx":626
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef int __cnext__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":625
- *         ks_destroy(self.kstream)
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":628
- *         return self
- * 
- *     cdef int __cnext__(self):             # <<<<<<<<<<<<<<
- *         cdef int dret = 0
- *         cdef int retval = 0
- */
-
-static int __pyx_f_5pysam_6ctabix_10GZIterator___cnext__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self) {
-  int __pyx_v_dret;
-  int __pyx_v_retval;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  __Pyx_RefNannySetupContext("__cnext__", 0);
-
-  /* "pysam/ctabix.pyx":629
- * 
- *     cdef int __cnext__(self):
- *         cdef int dret = 0             # <<<<<<<<<<<<<<
- *         cdef int retval = 0
- *         while 1:
- */
-  __pyx_v_dret = 0;
-
-  /* "pysam/ctabix.pyx":630
- *     cdef int __cnext__(self):
- *         cdef int dret = 0
- *         cdef int retval = 0             # <<<<<<<<<<<<<<
- *         while 1:
- *             retval = ks_getuntil(self.kstream, '\n', &self.buffer, &dret)
- */
-  __pyx_v_retval = 0;
-
-  /* "pysam/ctabix.pyx":631
- *         cdef int dret = 0
- *         cdef int retval = 0
- *         while 1:             # <<<<<<<<<<<<<<
- *             retval = ks_getuntil(self.kstream, '\n', &self.buffer, &dret)
- * 
- */
-  while (1) {
-
-    /* "pysam/ctabix.pyx":632
- *         cdef int retval = 0
- *         while 1:
- *             retval = ks_getuntil(self.kstream, '\n', &self.buffer, &dret)             # <<<<<<<<<<<<<<
- * 
- *             if retval < 0:
- */
-    __pyx_v_retval = ks_getuntil(__pyx_v_self->kstream, '\n', (&__pyx_v_self->buffer), (&__pyx_v_dret));
-
-    /* "pysam/ctabix.pyx":634
- *             retval = ks_getuntil(self.kstream, '\n', &self.buffer, &dret)
- * 
- *             if retval < 0:             # <<<<<<<<<<<<<<
- *                 break
- * 
- */
-    __pyx_t_1 = ((__pyx_v_retval < 0) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/ctabix.pyx":635
- * 
- *             if retval < 0:
- *                 break             # <<<<<<<<<<<<<<
- * 
- *             return dret
- */
-      goto __pyx_L4_break;
-    }
-
-    /* "pysam/ctabix.pyx":637
- *                 break
- * 
- *             return dret             # <<<<<<<<<<<<<<
- *         return -1
- * 
- */
-    __pyx_r = __pyx_v_dret;
-    goto __pyx_L0;
-  }
-  __pyx_L4_break:;
-
-  /* "pysam/ctabix.pyx":638
- * 
- *             return dret
- *         return -1             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  __pyx_r = -1;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":628
- *         return self
- * 
- *     cdef int __cnext__(self):             # <<<<<<<<<<<<<<
- *         cdef int dret = 0
- *         cdef int retval = 0
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":640
- *         return -1
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_10GZIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_10GZIterator_6__next__[] = "python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_6ctabix_10GZIterator_6__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_6ctabix_10GZIterator_7__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_10GZIterator_6__next__(((struct __pyx_obj_5pysam_6ctabix_GZIterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_10GZIterator_6__next__(struct __pyx_obj_5pysam_6ctabix_GZIterator *__pyx_v_self) {
-  int __pyx_v_retval;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  struct __pyx_opt_args_5pysam_6ctabix__force_str __pyx_t_5;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/ctabix.pyx":643
- *         """python version of next().
- *         """
- *         cdef int retval = self.__cnext__()             # <<<<<<<<<<<<<<
- *         if retval < 0:
- *             raise StopIteration
- */
-  __pyx_v_retval = ((struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator *)__pyx_v_self->__pyx_vtab)->__pyx___cnext__(__pyx_v_self);
-
-  /* "pysam/ctabix.pyx":644
- *         """
- *         cdef int retval = self.__cnext__()
- *         if retval < 0:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- *         return _force_str(self.buffer.s, self.encoding)
- */
-  __pyx_t_1 = ((__pyx_v_retval < 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":645
- *         cdef int retval = self.__cnext__()
- *         if retval < 0:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- *         return _force_str(self.buffer.s, self.encoding)
- * 
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":646
- *         if retval < 0:
- *             raise StopIteration
- *         return _force_str(self.buffer.s, self.encoding)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->buffer.s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __pyx_v_self->encoding;
-  __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_5.__pyx_n = 1;
-  __pyx_t_5.encoding = __pyx_t_3;
-  __pyx_t_4 = __pyx_f_5pysam_6ctabix__force_str(__pyx_t_2, &__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":640
- *         return -1
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.ctabix.GZIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":654
- *     '''
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_14GZIteratorHead_1__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_14GZIteratorHead___next__[] = "python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_6ctabix_14GZIteratorHead___next__;
-#endif
-static PyObject *__pyx_pw_5pysam_6ctabix_14GZIteratorHead_1__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_14GZIteratorHead___next__(((struct __pyx_obj_5pysam_6ctabix_GZIteratorHead *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_14GZIteratorHead___next__(struct __pyx_obj_5pysam_6ctabix_GZIteratorHead *__pyx_v_self) {
-  int __pyx_v_retval;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/ctabix.pyx":657
- *         """python version of next().
- *         """
- *         cdef int retval = self.__cnext__()             # <<<<<<<<<<<<<<
- *         if retval < 0:
- *             raise StopIteration
- */
-  __pyx_v_retval = ((struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorHead *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___cnext__(((struct __pyx_obj_5pysam_6ctabix_GZIterator *)__pyx_v_self));
-
-  /* "pysam/ctabix.pyx":658
- *         """
- *         cdef int retval = self.__cnext__()
- *         if retval < 0:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- *         if self.buffer.s[0] == '#':
- */
-  __pyx_t_1 = ((__pyx_v_retval < 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":659
- *         cdef int retval = self.__cnext__()
- *         if retval < 0:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- *         if self.buffer.s[0] == '#':
- *             return self.buffer.s
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":660
- *         if retval < 0:
- *             raise StopIteration
- *         if self.buffer.s[0] == '#':             # <<<<<<<<<<<<<<
- *             return self.buffer.s
- *         else:
- */
-  __pyx_t_1 = (((__pyx_v_self->__pyx_base.buffer.s[0]) == '#') != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":661
- *             raise StopIteration
- *         if self.buffer.s[0] == '#':
- *             return self.buffer.s             # <<<<<<<<<<<<<<
- *         else:
- *             raise StopIteration
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.buffer.s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":663
- *             return self.buffer.s
- *         else:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":654
- *     '''
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.GZIteratorHead.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":671
- *     '''
- * 
- *     def __init__(self, parser):             # <<<<<<<<<<<<<<
- *         self.parser = parser
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6ctabix_16GZIteratorParsed_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6ctabix_16GZIteratorParsed_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_parser = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_parser,0};
-    PyObject* values[1] = {0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-    }
-    __pyx_v_parser = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.GZIteratorParsed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_16GZIteratorParsed___init__(((struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *)__pyx_v_self), __pyx_v_parser);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6ctabix_16GZIteratorParsed___init__(struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *__pyx_v_self, PyObject *__pyx_v_parser) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__init__", 0);
-
-  /* "pysam/ctabix.pyx":672
- * 
- *     def __init__(self, parser):
- *         self.parser = parser             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  if (!(likely(((__pyx_v_parser) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_5pysam_6ctabix_Parser))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_1 = __pyx_v_parser;
-  __Pyx_INCREF(__pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_GOTREF(__pyx_v_self->parser);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->parser));
-  __pyx_v_self->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":671
- *     '''
- * 
- *     def __init__(self, parser):             # <<<<<<<<<<<<<<
- *         self.parser = parser
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.ctabix.GZIteratorParsed.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":674
- *         self.parser = parser
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_16GZIteratorParsed_3__next__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_16GZIteratorParsed_2__next__[] = "python version of next().\n        ";
-#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_5pysam_6ctabix_16GZIteratorParsed_2__next__;
-#endif
-static PyObject *__pyx_pw_5pysam_6ctabix_16GZIteratorParsed_3__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_16GZIteratorParsed_2__next__(((struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_16GZIteratorParsed_2__next__(struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *__pyx_v_self) {
-  int __pyx_v_retval;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/ctabix.pyx":677
- *         """python version of next().
- *         """
- *         cdef int retval = self.__cnext__()             # <<<<<<<<<<<<<<
- *         if retval < 0:
- *             raise StopIteration
- */
-  __pyx_v_retval = ((struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorParsed *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.__pyx___cnext__(((struct __pyx_obj_5pysam_6ctabix_GZIterator *)__pyx_v_self));
-
-  /* "pysam/ctabix.pyx":678
- *         """
- *         cdef int retval = self.__cnext__()
- *         if retval < 0:             # <<<<<<<<<<<<<<
- *             raise StopIteration
- * 
- */
-  __pyx_t_1 = ((__pyx_v_retval < 0) != 0);
-  if (__pyx_t_1) {
-
-    /* "pysam/ctabix.pyx":679
- *         cdef int retval = self.__cnext__()
- *         if retval < 0:
- *             raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *         return self.parser.parse(self.buffer.s,
- */
-    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":681
- *             raise StopIteration
- * 
- *         return self.parser.parse(self.buffer.s,             # <<<<<<<<<<<<<<
- *                                  self.buffer.l)
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-
-  /* "pysam/ctabix.pyx":682
- * 
- *         return self.parser.parse(self.buffer.s,
- *                                  self.buffer.l)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysam_6ctabix_Parser *)__pyx_v_self->parser->__pyx_vtab)->parse(__pyx_v_self->parser, __pyx_v_self->__pyx_base.buffer.s, __pyx_v_self->__pyx_base.buffer.l); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":674
- *         self.parser = parser
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         """python version of next().
- *         """
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.GZIteratorParsed.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":685
- * 
- * 
- * def tabix_compress(filename_in,             # <<<<<<<<<<<<<<
- *                    filename_out,
- *                    force=False):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_1tabix_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_tabix_compress[] = "tabix_compress(filename_in, filename_out, force=False)\ncompress *filename_in* writing the output to *filename_out*.\n    \n    Raise an IOError if *filename_out* already exists, unless *force*\n    is set.\n    ";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_1tabix_compress = {__Pyx_NAMESTR("tabix_compress"), (PyCFunction)__pyx_pw_5pysam_6ctabix_1tabix_compress, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_tabix_compress)};
-static PyObject *__pyx_pw_5pysam_6ctabix_1tabix_compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_filename_in = 0;
-  PyObject *__pyx_v_filename_out = 0;
-  PyObject *__pyx_v_force = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("tabix_compress (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename_in,&__pyx_n_s_filename_out,&__pyx_n_s_force,0};
-    PyObject* values[3] = {0,0,0};
-
-    /* "pysam/ctabix.pyx":687
- * def tabix_compress(filename_in,
- *                    filename_out,
- *                    force=False):             # <<<<<<<<<<<<<<
- *     '''compress *filename_in* writing the output to *filename_out*.
- * 
- */
-    values[2] = ((PyObject *)Py_False);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename_in)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename_out)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("tabix_compress", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tabix_compress") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_filename_in = values[0];
-    __pyx_v_filename_out = values[1];
-    __pyx_v_force = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("tabix_compress", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.tabix_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_tabix_compress(__pyx_self, __pyx_v_filename_in, __pyx_v_filename_out, __pyx_v_force);
-
-  /* "pysam/ctabix.pyx":685
- * 
- * 
- * def tabix_compress(filename_in,             # <<<<<<<<<<<<<<
- *                    filename_out,
- *                    force=False):
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_tabix_compress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename_in, PyObject *__pyx_v_filename_out, PyObject *__pyx_v_force) {
-  int __pyx_v_WINDOW_SIZE;
-  int __pyx_v_c;
-  int __pyx_v_r;
-  void *__pyx_v_buffer;
-  BGZF *__pyx_v_fp;
-  int __pyx_v_fd_src;
-  int __pyx_v_O_RDONLY;
-  PyObject *__pyx_v_fn = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  char const *__pyx_t_8;
-  char *__pyx_t_9;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("tabix_compress", 0);
-
-  /* "pysam/ctabix.pyx":694
- *     '''
- * 
- *     if not force and os.path.exists(filename_out ):             # <<<<<<<<<<<<<<
- *         raise IOError(
- *             "Filename '%s' already exists, use *force* to overwrite" % filename_out)
- */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = (!__pyx_t_1);
-  if (__pyx_t_2) {
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __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 = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_filename_out);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filename_out);
-    __Pyx_GIVEREF(__pyx_v_filename_out);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_6 = __pyx_t_1;
-  } else {
-    __pyx_t_6 = __pyx_t_2;
-  }
-  if (__pyx_t_6) {
-
-    /* "pysam/ctabix.pyx":696
- *     if not force and os.path.exists(filename_out ):
- *         raise IOError(
- *             "Filename '%s' already exists, use *force* to overwrite" % filename_out)             # <<<<<<<<<<<<<<
- * 
- *     cdef int WINDOW_SIZE
- */
-    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Filename_s_already_exists_use_fo, __pyx_v_filename_out); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-
-    /* "pysam/ctabix.pyx":695
- * 
- *     if not force and os.path.exists(filename_out ):
- *         raise IOError(             # <<<<<<<<<<<<<<
- *             "Filename '%s' already exists, use *force* to overwrite" % filename_out)
- * 
- */
-    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":705
- * 
- *     cdef int O_RDONLY
- *     O_RDONLY = os.O_RDONLY             # <<<<<<<<<<<<<<
- * 
- *     WINDOW_SIZE = 64 * 1024
- */
-  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_O_RDONLY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_v_O_RDONLY = __pyx_t_7;
-
-  /* "pysam/ctabix.pyx":707
- *     O_RDONLY = os.O_RDONLY
- * 
- *     WINDOW_SIZE = 64 * 1024             # <<<<<<<<<<<<<<
- * 
- *     fn = _encodeFilename(filename_out)
- */
-  __pyx_v_WINDOW_SIZE = 65536;
-
-  /* "pysam/ctabix.pyx":709
- *     WINDOW_SIZE = 64 * 1024
- * 
- *     fn = _encodeFilename(filename_out)             # <<<<<<<<<<<<<<
- *     fp = bgzf_open( fn, "w")
- *     if fp == NULL:
- */
-  __pyx_t_4 = __pyx_f_5pysam_6ctabix__encodeFilename(__pyx_v_filename_out); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_v_fn = ((PyObject*)__pyx_t_4);
-  __pyx_t_4 = 0;
-
-  /* "pysam/ctabix.pyx":710
- * 
- *     fn = _encodeFilename(filename_out)
- *     fp = bgzf_open( fn, "w")             # <<<<<<<<<<<<<<
- *     if fp == NULL:
- *         raise IOError("could not open '%s' for writing")
- */
-  __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_fn); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_fp = bgzf_open(__pyx_t_8, __pyx_k_w);
-
-  /* "pysam/ctabix.pyx":711
- *     fn = _encodeFilename(filename_out)
- *     fp = bgzf_open( fn, "w")
- *     if fp == NULL:             # <<<<<<<<<<<<<<
- *         raise IOError("could not open '%s' for writing")
- * 
- */
-  __pyx_t_6 = ((__pyx_v_fp == NULL) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/ctabix.pyx":712
- *     fp = bgzf_open( fn, "w")
- *     if fp == NULL:
- *         raise IOError("could not open '%s' for writing")             # <<<<<<<<<<<<<<
- * 
- *     fn = _encodeFilename(filename_in)
- */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":714
- *         raise IOError("could not open '%s' for writing")
- * 
- *     fn = _encodeFilename(filename_in)             # <<<<<<<<<<<<<<
- *     fd_src = open(fn, O_RDONLY)
- *     if fd_src == 0:
- */
-  __pyx_t_4 = __pyx_f_5pysam_6ctabix__encodeFilename(__pyx_v_filename_in); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF_SET(__pyx_v_fn, ((PyObject*)__pyx_t_4));
-  __pyx_t_4 = 0;
-
-  /* "pysam/ctabix.pyx":715
- * 
- *     fn = _encodeFilename(filename_in)
- *     fd_src = open(fn, O_RDONLY)             # <<<<<<<<<<<<<<
- *     if fd_src == 0:
- *         raise IOError("could not open '%s' for reading")
- */
-  __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_fn); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_fd_src = open(__pyx_t_9, __pyx_v_O_RDONLY);
-
-  /* "pysam/ctabix.pyx":716
- *     fn = _encodeFilename(filename_in)
- *     fd_src = open(fn, O_RDONLY)
- *     if fd_src == 0:             # <<<<<<<<<<<<<<
- *         raise IOError("could not open '%s' for reading")
- * 
- */
-  __pyx_t_6 = ((__pyx_v_fd_src == 0) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/ctabix.pyx":717
- *     fd_src = open(fn, O_RDONLY)
- *     if fd_src == 0:
- *         raise IOError("could not open '%s' for reading")             # <<<<<<<<<<<<<<
- * 
- *     buffer = malloc(WINDOW_SIZE)
- */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":719
- *         raise IOError("could not open '%s' for reading")
- * 
- *     buffer = malloc(WINDOW_SIZE)             # <<<<<<<<<<<<<<
- *     c = 1
- * 
- */
-  __pyx_v_buffer = malloc(__pyx_v_WINDOW_SIZE);
-
-  /* "pysam/ctabix.pyx":720
- * 
- *     buffer = malloc(WINDOW_SIZE)
- *     c = 1             # <<<<<<<<<<<<<<
- * 
- *     while c > 0:
- */
-  __pyx_v_c = 1;
-
-  /* "pysam/ctabix.pyx":722
- *     c = 1
- * 
- *     while c > 0:             # <<<<<<<<<<<<<<
- *         c = read(fd_src, buffer, WINDOW_SIZE)
- *         r = bgzf_write(fp, buffer, c)
- */
-  while (1) {
-    __pyx_t_6 = ((__pyx_v_c > 0) != 0);
-    if (!__pyx_t_6) break;
-
-    /* "pysam/ctabix.pyx":723
- * 
- *     while c > 0:
- *         c = read(fd_src, buffer, WINDOW_SIZE)             # <<<<<<<<<<<<<<
- *         r = bgzf_write(fp, buffer, c)
- *         if r < 0:
- */
-    __pyx_v_c = read(__pyx_v_fd_src, __pyx_v_buffer, __pyx_v_WINDOW_SIZE);
-
-    /* "pysam/ctabix.pyx":724
- *     while c > 0:
- *         c = read(fd_src, buffer, WINDOW_SIZE)
- *         r = bgzf_write(fp, buffer, c)             # <<<<<<<<<<<<<<
- *         if r < 0:
- *             free(buffer)
- */
-    __pyx_v_r = bgzf_write(__pyx_v_fp, __pyx_v_buffer, __pyx_v_c);
-
-    /* "pysam/ctabix.pyx":725
- *         c = read(fd_src, buffer, WINDOW_SIZE)
- *         r = bgzf_write(fp, buffer, c)
- *         if r < 0:             # <<<<<<<<<<<<<<
- *             free(buffer)
- *             raise OSError("writing failed")
- */
-    __pyx_t_6 = ((__pyx_v_r < 0) != 0);
-    if (__pyx_t_6) {
-
-      /* "pysam/ctabix.pyx":726
- *         r = bgzf_write(fp, buffer, c)
- *         if r < 0:
- *             free(buffer)             # <<<<<<<<<<<<<<
- *             raise OSError("writing failed")
- * 
- */
-      free(__pyx_v_buffer);
-
-      /* "pysam/ctabix.pyx":727
- *         if r < 0:
- *             free(buffer)
- *             raise OSError("writing failed")             # <<<<<<<<<<<<<<
- * 
- *     free(buffer)
- */
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-
-  /* "pysam/ctabix.pyx":729
- *             raise OSError("writing failed")
- * 
- *     free(buffer)             # <<<<<<<<<<<<<<
- *     r = bgzf_close(fp)
- *     if r < 0:
- */
-  free(__pyx_v_buffer);
-
-  /* "pysam/ctabix.pyx":730
- * 
- *     free(buffer)
- *     r = bgzf_close(fp)             # <<<<<<<<<<<<<<
- *     if r < 0:
- *         raise OSError("writing to file %s failed" % filename_out)
- */
-  __pyx_v_r = bgzf_close(__pyx_v_fp);
-
-  /* "pysam/ctabix.pyx":731
- *     free(buffer)
- *     r = bgzf_close(fp)
- *     if r < 0:             # <<<<<<<<<<<<<<
- *         raise OSError("writing to file %s failed" % filename_out)
- * 
- */
-  __pyx_t_6 = ((__pyx_v_r < 0) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/ctabix.pyx":732
- *     r = bgzf_close(fp)
- *     if r < 0:
- *         raise OSError("writing to file %s failed" % filename_out)             # <<<<<<<<<<<<<<
- * 
- *     r = close(fd_src)
- */
-    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_writing_to_file_s_failed, __pyx_v_filename_out); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":734
- *         raise OSError("writing to file %s failed" % filename_out)
- * 
- *     r = close(fd_src)             # <<<<<<<<<<<<<<
- *     if r < 0:
- *         raise OSError("error when closing file %s" % filename_in)
- */
-  __pyx_v_r = close(__pyx_v_fd_src);
-
-  /* "pysam/ctabix.pyx":735
- * 
- *     r = close(fd_src)
- *     if r < 0:             # <<<<<<<<<<<<<<
- *         raise OSError("error when closing file %s" % filename_in)
- * 
- */
-  __pyx_t_6 = ((__pyx_v_r < 0) != 0);
-  if (__pyx_t_6) {
-
-    /* "pysam/ctabix.pyx":736
- *     r = close(fd_src)
- *     if r < 0:
- *         raise OSError("error when closing file %s" % filename_in)             # <<<<<<<<<<<<<<
- * 
- * def tabix_index( filename,
- */
-    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_error_when_closing_file_s, __pyx_v_filename_in); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_OSError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":685
- * 
- * 
- * def tabix_compress(filename_in,             # <<<<<<<<<<<<<<
- *                    filename_out,
- *                    force=False):
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_fn);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":738
- *         raise OSError("error when closing file %s" % filename_in)
- * 
- * def tabix_index( filename,             # <<<<<<<<<<<<<<
- *                  force = False,
- *                  seq_col = None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_3tabix_index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_2tabix_index[] = "tabix_index(filename, force=False, seq_col=None, start_col=None, end_col=None, preset=None, meta_char='#', zerobased=False, min_shift=-1)\nindex tab-separated *filename* using tabix.\n\n    An existing index will not be overwritten unless\n    *force* is set.\n\n    The index will be built from coordinates\n    in columns *seq_col*, *start_col* and *end_col*.\n\n    The contents of *filename* have to be sorted by \n    contig and pos [...]
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_3tabix_index = {__Pyx_NAMESTR("tabix_index"), (PyCFunction)__pyx_pw_5pysam_6ctabix_3tabix_index, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_2tabix_index)};
-static PyObject *__pyx_pw_5pysam_6ctabix_3tabix_index(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_filename = 0;
-  PyObject *__pyx_v_force = 0;
-  PyObject *__pyx_v_seq_col = 0;
-  PyObject *__pyx_v_start_col = 0;
-  PyObject *__pyx_v_end_col = 0;
-  PyObject *__pyx_v_preset = 0;
-  PyObject *__pyx_v_meta_char = 0;
-  PyObject *__pyx_v_zerobased = 0;
-  PyObject *__pyx_v_min_shift = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("tabix_index (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_force,&__pyx_n_s_seq_col,&__pyx_n_s_start_col,&__pyx_n_s_end_col,&__pyx_n_s_preset,&__pyx_n_s_meta_char,&__pyx_n_s_zerobased,&__pyx_n_s_min_shift,0};
-    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
-
-    /* "pysam/ctabix.pyx":739
- * 
- * def tabix_index( filename,
- *                  force = False,             # <<<<<<<<<<<<<<
- *                  seq_col = None,
- *                  start_col = None,
- */
-    values[1] = ((PyObject *)Py_False);
-
-    /* "pysam/ctabix.pyx":740
- * def tabix_index( filename,
- *                  force = False,
- *                  seq_col = None,             # <<<<<<<<<<<<<<
- *                  start_col = None,
- *                  end_col = None,
- */
-    values[2] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":741
- *                  force = False,
- *                  seq_col = None,
- *                  start_col = None,             # <<<<<<<<<<<<<<
- *                  end_col = None,
- *                  preset = None,
- */
-    values[3] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":742
- *                  seq_col = None,
- *                  start_col = None,
- *                  end_col = None,             # <<<<<<<<<<<<<<
- *                  preset = None,
- *                  meta_char = "#",
- */
-    values[4] = ((PyObject *)Py_None);
-
-    /* "pysam/ctabix.pyx":743
- *                  start_col = None,
- *                  end_col = None,
- *                  preset = None,             # <<<<<<<<<<<<<<
- *                  meta_char = "#",
- *                  zerobased = False,
- */
-    values[5] = ((PyObject *)Py_None);
-    values[6] = ((PyObject *)__pyx_kp_s__10);
-
-    /* "pysam/ctabix.pyx":745
- *                  preset = None,
- *                  meta_char = "#",
- *                  zerobased = False,             # <<<<<<<<<<<<<<
- *                  min_shift = -1,
- *                 ):
- */
-    values[7] = ((PyObject *)Py_False);
-    values[8] = ((PyObject *)__pyx_int_neg_1);
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
-        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
-        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq_col);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_col);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_col);
-          if (value) { values[4] = value; kw_args--; }
-        }
-        case  5:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_preset);
-          if (value) { values[5] = value; kw_args--; }
-        }
-        case  6:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_meta_char);
-          if (value) { values[6] = value; kw_args--; }
-        }
-        case  7:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zerobased);
-          if (value) { values[7] = value; kw_args--; }
-        }
-        case  8:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_shift);
-          if (value) { values[8] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tabix_index") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
-        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
-        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_filename = values[0];
-    __pyx_v_force = values[1];
-    __pyx_v_seq_col = values[2];
-    __pyx_v_start_col = values[3];
-    __pyx_v_end_col = values[4];
-    __pyx_v_preset = values[5];
-    __pyx_v_meta_char = values[6];
-    __pyx_v_zerobased = values[7];
-    __pyx_v_min_shift = values[8];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("tabix_index", 0, 1, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.tabix_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_2tabix_index(__pyx_self, __pyx_v_filename, __pyx_v_force, __pyx_v_seq_col, __pyx_v_start_col, __pyx_v_end_col, __pyx_v_preset, __pyx_v_meta_char, __pyx_v_zerobased, __pyx_v_min_shift);
-
-  /* "pysam/ctabix.pyx":738
- *         raise OSError("error when closing file %s" % filename_in)
- * 
- * def tabix_index( filename,             # <<<<<<<<<<<<<<
- *                  force = False,
- *                  seq_col = None,
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_2tabix_index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_force, PyObject *__pyx_v_seq_col, PyObject *__pyx_v_start_col, PyObject *__pyx_v_end_col, PyObject *__pyx_v_preset, PyObject *__pyx_v_meta_char, PyObject *__pyx_v_zerobased, PyObject *__pyx_v_min_shift) {
-  PyObject *__pyx_v_preset2conf = NULL;
-  PyObject *__pyx_v_conf_data = NULL;
-  tbx_conf_t __pyx_v_conf;
-  PyObject *__pyx_v_fn = 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;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  int __pyx_t_7;
-  int __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  int __pyx_t_13;
-  PyObject *__pyx_t_14 = NULL;
-  PyObject *__pyx_t_15 = NULL;
-  PyObject *__pyx_t_16 = NULL;
-  PyObject *(*__pyx_t_17)(PyObject *);
-  int32_t __pyx_t_18;
-  int32_t __pyx_t_19;
-  int32_t __pyx_t_20;
-  int32_t __pyx_t_21;
-  int32_t __pyx_t_22;
-  int32_t __pyx_t_23;
-  char *__pyx_t_24;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("tabix_index", 0);
-  __Pyx_INCREF(__pyx_v_filename);
-  __Pyx_INCREF(__pyx_v_end_col);
-  __Pyx_INCREF(__pyx_v_preset);
-
-  /* "pysam/ctabix.pyx":785
- *     '''
- * 
- *     if not os.path.exists(filename):             # <<<<<<<<<<<<<<
- *         raise IOError("No such file '%s'" % filename)
- * 
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = ((!__pyx_t_4) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/ctabix.pyx":786
- * 
- *     if not os.path.exists(filename):
- *         raise IOError("No such file '%s'" % filename)             # <<<<<<<<<<<<<<
- * 
- *     if preset is None and \
- */
-    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_No_such_file_s, __pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __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 = 786; __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 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":788
- *         raise IOError("No such file '%s'" % filename)
- * 
- *     if preset is None and \             # <<<<<<<<<<<<<<
- *        (seq_col is None or start_col is None or end_col is None):
- *         raise ValueError(
- */
-  __pyx_t_5 = (__pyx_v_preset == Py_None);
-  if ((__pyx_t_5 != 0)) {
-
-    /* "pysam/ctabix.pyx":789
- * 
- *     if preset is None and \
- *        (seq_col is None or start_col is None or end_col is None):             # <<<<<<<<<<<<<<
- *         raise ValueError(
- *             "neither preset nor seq_col,start_col and end_col given")
- */
-    __pyx_t_4 = (__pyx_v_seq_col == Py_None);
-    if (!(__pyx_t_4 != 0)) {
-      __pyx_t_6 = (__pyx_v_start_col == Py_None);
-      if (!(__pyx_t_6 != 0)) {
-        __pyx_t_7 = (__pyx_v_end_col == Py_None);
-        __pyx_t_8 = (__pyx_t_7 != 0);
-      } else {
-        __pyx_t_8 = (__pyx_t_6 != 0);
-      }
-      __pyx_t_6 = __pyx_t_8;
-    } else {
-      __pyx_t_6 = (__pyx_t_4 != 0);
-    }
-    __pyx_t_4 = __pyx_t_6;
-  } else {
-    __pyx_t_4 = (__pyx_t_5 != 0);
-  }
-  if (__pyx_t_4) {
-
-    /* "pysam/ctabix.pyx":790
- *     if preset is None and \
- *        (seq_col is None or start_col is None or end_col is None):
- *         raise ValueError(             # <<<<<<<<<<<<<<
- *             "neither preset nor seq_col,start_col and end_col given")
- * 
- */
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":793
- *             "neither preset nor seq_col,start_col and end_col given")
- * 
- *     if not filename.endswith(".gz"):             # <<<<<<<<<<<<<<
- *         tabix_compress(filename, filename + ".gz", force=force)
- *         os.unlink( filename )
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = ((!__pyx_t_4) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/ctabix.pyx":794
- * 
- *     if not filename.endswith(".gz"):
- *         tabix_compress(filename, filename + ".gz", force=force)             # <<<<<<<<<<<<<<
- *         os.unlink( filename )
- *         filename += ".gz"
- */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_tabix_compress); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyNumber_Add(__pyx_v_filename, __pyx_kp_s_gz); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_v_filename);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
-    __Pyx_GIVEREF(__pyx_v_filename);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_force, __pyx_v_force) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-    /* "pysam/ctabix.pyx":795
- *     if not filename.endswith(".gz"):
- *         tabix_compress(filename, filename + ".gz", force=force)
- *         os.unlink( filename )             # <<<<<<<<<<<<<<
- *         filename += ".gz"
- * 
- */
-    __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_unlink); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_INCREF(__pyx_v_filename);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_filename);
-    __Pyx_GIVEREF(__pyx_v_filename);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/ctabix.pyx":796
- *         tabix_compress(filename, filename + ".gz", force=force)
- *         os.unlink( filename )
- *         filename += ".gz"             # <<<<<<<<<<<<<<
- * 
- *     if not force and os.path.exists(filename + ".tbi"):
- */
-    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_filename, __pyx_kp_s_gz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L5;
-  }
-  __pyx_L5:;
-
-  /* "pysam/ctabix.pyx":798
- *         filename += ".gz"
- * 
- *     if not force and os.path.exists(filename + ".tbi"):             # <<<<<<<<<<<<<<
- *         raise IOError(
- *             "Filename '%s.tbi' already exists, use *force* to overwrite")
- */
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_4 = (!__pyx_t_5);
-  if (__pyx_t_4) {
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exists); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = PyNumber_Add(__pyx_v_filename, __pyx_kp_s_tbi); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_6 = __pyx_t_5;
-  } else {
-    __pyx_t_6 = __pyx_t_4;
-  }
-  if (__pyx_t_6) {
-
-    /* "pysam/ctabix.pyx":799
- * 
- *     if not force and os.path.exists(filename + ".tbi"):
- *         raise IOError(             # <<<<<<<<<<<<<<
- *             "Filename '%s.tbi' already exists, use *force* to overwrite")
- * 
- */
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":806
- *     #     comments, lines to ignore at beginning
- *     # 0 is a missing column
- *     preset2conf = {             # <<<<<<<<<<<<<<
- *         'gff' : (0, 1, 4, 5, ord('#'), 0),
- *         'bed' : (0x10000, 1, 2, 3, ord('#'), 0),
- */
-  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-
-  /* "pysam/ctabix.pyx":807
- *     # 0 is a missing column
- *     preset2conf = {
- *         'gff' : (0, 1, 4, 5, ord('#'), 0),             # <<<<<<<<<<<<<<
- *         'bed' : (0x10000, 1, 2, 3, ord('#'), 0),
- *         'psltbl' : (0x10000, 15, 17, 18, ord('#'), 0),
- */
-  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_int_4);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_4);
-  __Pyx_GIVEREF(__pyx_int_4);
-  __Pyx_INCREF(__pyx_int_5);
-  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_5);
-  __Pyx_GIVEREF(__pyx_int_5);
-  __Pyx_INCREF(__pyx_int_35);
-  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_int_35);
-  __Pyx_GIVEREF(__pyx_int_35);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_gff, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/ctabix.pyx":808
- *     preset2conf = {
- *         'gff' : (0, 1, 4, 5, ord('#'), 0),
- *         'bed' : (0x10000, 1, 2, 3, ord('#'), 0),             # <<<<<<<<<<<<<<
- *         'psltbl' : (0x10000, 15, 17, 18, ord('#'), 0),
- *         'sam' : (1, 3, 4, 0, ord('@'), 0),
- */
-  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_65536);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_65536);
-  __Pyx_GIVEREF(__pyx_int_65536);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_int_2);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_2);
-  __Pyx_GIVEREF(__pyx_int_2);
-  __Pyx_INCREF(__pyx_int_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_3);
-  __Pyx_GIVEREF(__pyx_int_3);
-  __Pyx_INCREF(__pyx_int_35);
-  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_int_35);
-  __Pyx_GIVEREF(__pyx_int_35);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_bed, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/ctabix.pyx":809
- *         'gff' : (0, 1, 4, 5, ord('#'), 0),
- *         'bed' : (0x10000, 1, 2, 3, ord('#'), 0),
- *         'psltbl' : (0x10000, 15, 17, 18, ord('#'), 0),             # <<<<<<<<<<<<<<
- *         'sam' : (1, 3, 4, 0, ord('@'), 0),
- *         'vcf' : (2, 1, 2, 0, ord('#'), 0),
- */
-  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_65536);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_65536);
-  __Pyx_GIVEREF(__pyx_int_65536);
-  __Pyx_INCREF(__pyx_int_15);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_15);
-  __Pyx_GIVEREF(__pyx_int_15);
-  __Pyx_INCREF(__pyx_int_17);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_17);
-  __Pyx_GIVEREF(__pyx_int_17);
-  __Pyx_INCREF(__pyx_int_18);
-  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_18);
-  __Pyx_GIVEREF(__pyx_int_18);
-  __Pyx_INCREF(__pyx_int_35);
-  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_int_35);
-  __Pyx_GIVEREF(__pyx_int_35);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_psltbl, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/ctabix.pyx":810
- *         'bed' : (0x10000, 1, 2, 3, ord('#'), 0),
- *         'psltbl' : (0x10000, 15, 17, 18, ord('#'), 0),
- *         'sam' : (1, 3, 4, 0, ord('@'), 0),             # <<<<<<<<<<<<<<
- *         'vcf' : (2, 1, 2, 0, ord('#'), 0),
- *         'pileup': (3, 1, 2, 0, ord('#'), 0),
- */
-  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_int_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_3);
-  __Pyx_GIVEREF(__pyx_int_3);
-  __Pyx_INCREF(__pyx_int_4);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_4);
-  __Pyx_GIVEREF(__pyx_int_4);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __Pyx_INCREF(__pyx_int_64);
-  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_int_64);
-  __Pyx_GIVEREF(__pyx_int_64);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_sam, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/ctabix.pyx":811
- *         'psltbl' : (0x10000, 15, 17, 18, ord('#'), 0),
- *         'sam' : (1, 3, 4, 0, ord('@'), 0),
- *         'vcf' : (2, 1, 2, 0, ord('#'), 0),             # <<<<<<<<<<<<<<
- *         'pileup': (3, 1, 2, 0, ord('#'), 0),
- *         }
- */
-  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_2);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_2);
-  __Pyx_GIVEREF(__pyx_int_2);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_int_2);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_2);
-  __Pyx_GIVEREF(__pyx_int_2);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __Pyx_INCREF(__pyx_int_35);
-  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_int_35);
-  __Pyx_GIVEREF(__pyx_int_35);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_vcf, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/ctabix.pyx":812
- *         'sam' : (1, 3, 4, 0, ord('@'), 0),
- *         'vcf' : (2, 1, 2, 0, ord('#'), 0),
- *         'pileup': (3, 1, 2, 0, ord('#'), 0),             # <<<<<<<<<<<<<<
- *         }
- * 
- */
-  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_3);
-  __Pyx_GIVEREF(__pyx_int_3);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_int_2);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_2);
-  __Pyx_GIVEREF(__pyx_int_2);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  __Pyx_INCREF(__pyx_int_35);
-  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_int_35);
-  __Pyx_GIVEREF(__pyx_int_35);
-  __Pyx_INCREF(__pyx_int_0);
-  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_int_0);
-  __Pyx_GIVEREF(__pyx_int_0);
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_pileup, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_v_preset2conf = ((PyObject*)__pyx_t_9);
-  __pyx_t_9 = 0;
-
-  /* "pysam/ctabix.pyx":815
- *         }
- * 
- *     if preset:             # <<<<<<<<<<<<<<
- *         try:
- *             conf_data = preset2conf[preset]
- */
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_preset); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_6) {
-
-    /* "pysam/ctabix.pyx":816
- * 
- *     if preset:
- *         try:             # <<<<<<<<<<<<<<
- *             conf_data = preset2conf[preset]
- *         except KeyError:
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
-      __Pyx_XGOTREF(__pyx_t_10);
-      __Pyx_XGOTREF(__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_12);
-      /*try:*/ {
-
-        /* "pysam/ctabix.pyx":817
- *     if preset:
- *         try:
- *             conf_data = preset2conf[preset]             # <<<<<<<<<<<<<<
- *         except KeyError:
- *             raise KeyError(
- */
-        __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_preset2conf, __pyx_v_preset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L8_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_v_conf_data = __pyx_t_9;
-        __pyx_t_9 = 0;
-      }
-      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L15_try_end;
-      __pyx_L8_error:;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-      /* "pysam/ctabix.pyx":818
- *         try:
- *             conf_data = preset2conf[preset]
- *         except KeyError:             # <<<<<<<<<<<<<<
- *             raise KeyError(
- *                 "unknown preset '%s', valid presets are '%s'" %
- */
-      __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
-      if (__pyx_t_13) {
-        __Pyx_AddTraceback("pysam.ctabix.tabix_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_GOTREF(__pyx_t_1);
-
-        /* "pysam/ctabix.pyx":821
- *             raise KeyError(
- *                 "unknown preset '%s', valid presets are '%s'" %
- *                 (preset, ",".join(preset2conf.keys())))             # <<<<<<<<<<<<<<
- *     else:
- *         if end_col == None:
- */
-        __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_preset2conf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_14 = __Pyx_PyString_Join(__pyx_kp_s__14, __pyx_t_2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-        __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_v_preset);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_preset);
-        __Pyx_GIVEREF(__pyx_v_preset);
-        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_14);
-        __Pyx_GIVEREF(__pyx_t_14);
-        __pyx_t_14 = 0;
-
-        /* "pysam/ctabix.pyx":820
- *         except KeyError:
- *             raise KeyError(
- *                 "unknown preset '%s', valid presets are '%s'" %             # <<<<<<<<<<<<<<
- *                 (preset, ",".join(preset2conf.keys())))
- *     else:
- */
-        __pyx_t_14 = __Pyx_PyString_Format(__pyx_kp_s_unknown_preset_s_valid_presets_a, __pyx_t_2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-        __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-        /* "pysam/ctabix.pyx":819
- *             conf_data = preset2conf[preset]
- *         except KeyError:
- *             raise KeyError(             # <<<<<<<<<<<<<<
- *                 "unknown preset '%s', valid presets are '%s'" %
- *                 (preset, ",".join(preset2conf.keys())))
- */
-        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_14);
-        __Pyx_GIVEREF(__pyx_t_14);
-        __pyx_t_14 = 0;
-        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-        __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_Raise(__pyx_t_14, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L9_exception_handled;
-      }
-      goto __pyx_L10_except_error;
-      __pyx_L10_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
-      goto __pyx_L1_error;
-      __pyx_L9_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_10);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
-      __pyx_L15_try_end:;
-    }
-    goto __pyx_L7;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":823
- *                 (preset, ",".join(preset2conf.keys())))
- *     else:
- *         if end_col == None:             # <<<<<<<<<<<<<<
- *             end_col = -1
- *         preset = 0
- */
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_end_col, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_6) {
-
-      /* "pysam/ctabix.pyx":824
- *     else:
- *         if end_col == None:
- *             end_col = -1             # <<<<<<<<<<<<<<
- *         preset = 0
- * 
- */
-      __Pyx_INCREF(__pyx_int_neg_1);
-      __Pyx_DECREF_SET(__pyx_v_end_col, __pyx_int_neg_1);
-      goto __pyx_L18;
-    }
-    __pyx_L18:;
-
-    /* "pysam/ctabix.pyx":825
- *         if end_col == None:
- *             end_col = -1
- *         preset = 0             # <<<<<<<<<<<<<<
- * 
- *         # note that tabix internally works with 0-based coordinates
- */
-    __Pyx_INCREF(__pyx_int_0);
-    __Pyx_DECREF_SET(__pyx_v_preset, __pyx_int_0);
-
-    /* "pysam/ctabix.pyx":833
- *         # subtracted from the start coordinate. To avoid doing this,
- *         # set the TI_FLAG_UCSC=0x10000 flag:
- *         if zerobased:             # <<<<<<<<<<<<<<
- *             preset = preset | 0x10000
- * 
- */
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_zerobased); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_6) {
-
-      /* "pysam/ctabix.pyx":834
- *         # set the TI_FLAG_UCSC=0x10000 flag:
- *         if zerobased:
- *             preset = preset | 0x10000             # <<<<<<<<<<<<<<
- * 
- *         conf_data = (preset, seq_col+1, start_col+1, end_col+1, ord(meta_char), 0)
- */
-      __pyx_t_1 = PyNumber_Or(__pyx_v_preset, __pyx_int_65536); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF_SET(__pyx_v_preset, __pyx_t_1);
-      __pyx_t_1 = 0;
-      goto __pyx_L19;
-    }
-    __pyx_L19:;
-
-    /* "pysam/ctabix.pyx":836
- *             preset = preset | 0x10000
- * 
- *         conf_data = (preset, seq_col+1, start_col+1, end_col+1, ord(meta_char), 0)             # <<<<<<<<<<<<<<
- * 
- *     cdef tbx_conf_t conf
- */
-    __pyx_t_1 = PyNumber_Add(__pyx_v_seq_col, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyNumber_Add(__pyx_v_start_col, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_9 = PyNumber_Add(__pyx_v_end_col, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_14);
-    __Pyx_INCREF(__pyx_v_meta_char);
-    PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_meta_char);
-    __Pyx_GIVEREF(__pyx_v_meta_char);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __pyx_t_14 = PyTuple_New(6); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_14);
-    __Pyx_INCREF(__pyx_v_preset);
-    PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_preset);
-    __Pyx_GIVEREF(__pyx_v_preset);
-    PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_int_0);
-    PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_int_0);
-    __Pyx_GIVEREF(__pyx_int_0);
-    __pyx_t_1 = 0;
-    __pyx_t_3 = 0;
-    __pyx_t_9 = 0;
-    __pyx_t_2 = 0;
-    __pyx_v_conf_data = __pyx_t_14;
-    __pyx_t_14 = 0;
-  }
-  __pyx_L7:;
-
-  /* "pysam/ctabix.pyx":839
- * 
- *     cdef tbx_conf_t conf
- *     conf.preset, conf.sc, conf.bc, conf.ec, conf.meta_char, conf.line_skip = conf_data             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  if ((likely(PyTuple_CheckExact(__pyx_v_conf_data))) || (PyList_CheckExact(__pyx_v_conf_data))) {
-    PyObject* sequence = __pyx_v_conf_data;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 6)) {
-      if (size > 6) __Pyx_RaiseTooManyValuesError(6);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
-      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
-      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); 
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 4); 
-      __pyx_t_15 = PyTuple_GET_ITEM(sequence, 5); 
-    } else {
-      __pyx_t_14 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
-      __pyx_t_9 = PyList_GET_ITEM(sequence, 2); 
-      __pyx_t_3 = PyList_GET_ITEM(sequence, 3); 
-      __pyx_t_1 = PyList_GET_ITEM(sequence, 4); 
-      __pyx_t_15 = PyList_GET_ITEM(sequence, 5); 
-    }
-    __Pyx_INCREF(__pyx_t_14);
-    __Pyx_INCREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_t_9);
-    __Pyx_INCREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_t_15);
-    #else
-    {
-      Py_ssize_t i;
-      PyObject** temps[6] = {&__pyx_t_14,&__pyx_t_2,&__pyx_t_9,&__pyx_t_3,&__pyx_t_1,&__pyx_t_15};
-      for (i=0; i < 6; i++) {
-        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(item);
-        *(temps[i]) = item;
-      }
-    }
-    #endif
-  } else {
-    Py_ssize_t index = -1;
-    PyObject** temps[6] = {&__pyx_t_14,&__pyx_t_2,&__pyx_t_9,&__pyx_t_3,&__pyx_t_1,&__pyx_t_15};
-    __pyx_t_16 = PyObject_GetIter(__pyx_v_conf_data); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_16);
-    __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext;
-    for (index=0; index < 6; index++) {
-      PyObject* item = __pyx_t_17(__pyx_t_16); if (unlikely(!item)) goto __pyx_L20_unpacking_failed;
-      __Pyx_GOTREF(item);
-      *(temps[index]) = item;
-    }
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_17 = NULL;
-    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-    goto __pyx_L21_unpacking_done;
-    __pyx_L20_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-    __pyx_t_17 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L21_unpacking_done:;
-  }
-  __pyx_t_18 = __Pyx_PyInt_As_int32_t(__pyx_t_14); if (unlikely((__pyx_t_18 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-  __pyx_t_19 = __Pyx_PyInt_As_int32_t(__pyx_t_2); if (unlikely((__pyx_t_19 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_20 = __Pyx_PyInt_As_int32_t(__pyx_t_9); if (unlikely((__pyx_t_20 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_21 = __Pyx_PyInt_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_21 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_22 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_22 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_23 = __Pyx_PyInt_As_int32_t(__pyx_t_15); if (unlikely((__pyx_t_23 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-  __pyx_v_conf.preset = __pyx_t_18;
-  __pyx_v_conf.sc = __pyx_t_19;
-  __pyx_v_conf.bc = __pyx_t_20;
-  __pyx_v_conf.ec = __pyx_t_21;
-  __pyx_v_conf.meta_char = __pyx_t_22;
-  __pyx_v_conf.line_skip = __pyx_t_23;
-
-  /* "pysam/ctabix.pyx":842
- * 
- * 
- *     fn = _encodeFilename(filename)             # <<<<<<<<<<<<<<
- *     tbx_index_build(fn, min_shift, &conf)
- * 
- */
-  __pyx_t_15 = __pyx_f_5pysam_6ctabix__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_15);
-  __pyx_v_fn = ((PyObject*)__pyx_t_15);
-  __pyx_t_15 = 0;
-
-  /* "pysam/ctabix.pyx":843
- * 
- *     fn = _encodeFilename(filename)
- *     tbx_index_build(fn, min_shift, &conf)             # <<<<<<<<<<<<<<
- * 
- *     return filename
- */
-  __pyx_t_24 = __Pyx_PyObject_AsString(__pyx_v_fn); if (unlikely((!__pyx_t_24) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_min_shift); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  tbx_index_build(__pyx_t_24, __pyx_t_13, (&__pyx_v_conf));
-
-  /* "pysam/ctabix.pyx":845
- *     tbx_index_build(fn, min_shift, &conf)
- * 
- *     return filename             # <<<<<<<<<<<<<<
- * 
- * # #########################################################
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_filename);
-  __pyx_r = __pyx_v_filename;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":738
- *         raise OSError("error when closing file %s" % filename_in)
- * 
- * def tabix_index( filename,             # <<<<<<<<<<<<<<
- *                  force = False,
- *                  seq_col = None,
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_14);
-  __Pyx_XDECREF(__pyx_t_15);
-  __Pyx_XDECREF(__pyx_t_16);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_preset2conf);
-  __Pyx_XDECREF(__pyx_v_conf_data);
-  __Pyx_XDECREF(__pyx_v_fn);
-  __Pyx_XDECREF(__pyx_v_filename);
-  __Pyx_XDECREF(__pyx_v_end_col);
-  __Pyx_XDECREF(__pyx_v_preset);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":917
- * ## Iterators for parsing through unindexed files.
- * #########################################################
- * cdef buildGzipError(void *gzfp):             # <<<<<<<<<<<<<<
- *     cdef int errnum = 0
- *     cdef char *s = gzerror(gzfp, &errnum)
- */
-
-static PyObject *__pyx_f_5pysam_6ctabix_buildGzipError(void *__pyx_v_gzfp) {
-  int __pyx_v_errnum;
-  char *__pyx_v_s;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("buildGzipError", 0);
-
-  /* "pysam/ctabix.pyx":918
- * #########################################################
- * cdef buildGzipError(void *gzfp):
- *     cdef int errnum = 0             # <<<<<<<<<<<<<<
- *     cdef char *s = gzerror(gzfp, &errnum)
- *     return "error (%d): %s (%d: %s)" % (errno, strerror(errno), errnum, s)
- */
-  __pyx_v_errnum = 0;
-
-  /* "pysam/ctabix.pyx":919
- * cdef buildGzipError(void *gzfp):
- *     cdef int errnum = 0
- *     cdef char *s = gzerror(gzfp, &errnum)             # <<<<<<<<<<<<<<
- *     return "error (%d): %s (%d: %s)" % (errno, strerror(errno), errnum, s)
- * 
- */
-  __pyx_v_s = gzerror(__pyx_v_gzfp, (&__pyx_v_errnum));
-
-  /* "pysam/ctabix.pyx":920
- *     cdef int errnum = 0
- *     cdef char *s = gzerror(gzfp, &errnum)
- *     return "error (%d): %s (%d: %s)" % (errno, strerror(errno), errnum, s)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_errnum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_s); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_1 = 0;
-  __pyx_t_2 = 0;
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_error_d_s_d_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_r = __pyx_t_4;
-  __pyx_t_4 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":917
- * ## Iterators for parsing through unindexed files.
- * #########################################################
- * cdef buildGzipError(void *gzfp):             # <<<<<<<<<<<<<<
- *     cdef int errnum = 0
- *     cdef char *s = gzerror(gzfp, &errnum)
- */
-
-  /* function exit code */
-  __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);
-  __Pyx_AddTraceback("pysam.ctabix.buildGzipError", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":927
- *     '''
- * 
- *     def __cinit__(self,             # <<<<<<<<<<<<<<
- *                   infile,
- *                   Parser parser,
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_6ctabix_19tabix_file_iterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_6ctabix_19tabix_file_iterator_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_infile = 0;
-  struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_parser = 0;
-  int __pyx_v_buffer_size;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_infile,&__pyx_n_s_parser,&__pyx_n_s_buffer_size,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer_size);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_infile = values[0];
-    __pyx_v_parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)values[1]);
-    if (values[2]) {
-      __pyx_v_buffer_size = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_buffer_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-    } else {
-      __pyx_v_buffer_size = ((int)65536);
-    }
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.tabix_file_iterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5pysam_6ctabix_Parser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_pf_5pysam_6ctabix_19tabix_file_iterator___cinit__(((struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)__pyx_v_self), __pyx_v_infile, __pyx_v_parser, __pyx_v_buffer_size);
-
-  /* function exit code */
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_6ctabix_19tabix_file_iterator___cinit__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self, PyObject *__pyx_v_infile, struct __pyx_obj_5pysam_6ctabix_Parser *__pyx_v_parser, int __pyx_v_buffer_size) {
-  int __pyx_v_fd;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-
-  /* "pysam/ctabix.pyx":932
- *                   int buffer_size=65536):
- * 
- *         if infile.closed:             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file.")
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_infile, __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":933
- * 
- *         if infile.closed:
- *             raise ValueError("I/O operation on closed file.")             # <<<<<<<<<<<<<<
- * 
- *         self.infile = infile
- */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":935
- *             raise ValueError("I/O operation on closed file.")
- * 
- *         self.infile = infile             # <<<<<<<<<<<<<<
- * 
- *         cdef int fd = PyObject_AsFileDescriptor(infile)
- */
-  __Pyx_INCREF(__pyx_v_infile);
-  __Pyx_GIVEREF(__pyx_v_infile);
-  __Pyx_GOTREF(__pyx_v_self->infile);
-  __Pyx_DECREF(__pyx_v_self->infile);
-  __pyx_v_self->infile = __pyx_v_infile;
-
-  /* "pysam/ctabix.pyx":937
- *         self.infile = infile
- * 
- *         cdef int fd = PyObject_AsFileDescriptor(infile)             # <<<<<<<<<<<<<<
- *         if fd == -1:
- *             raise ValueError("I/O operation on closed file.")
- */
-  __pyx_t_3 = PyObject_AsFileDescriptor(__pyx_v_infile); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_fd = __pyx_t_3;
-
-  /* "pysam/ctabix.pyx":938
- * 
- *         cdef int fd = PyObject_AsFileDescriptor(infile)
- *         if fd == -1:             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file.")
- * 
- */
-  __pyx_t_2 = ((__pyx_v_fd == -1) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":939
- *         cdef int fd = PyObject_AsFileDescriptor(infile)
- *         if fd == -1:
- *             raise ValueError("I/O operation on closed file.")             # <<<<<<<<<<<<<<
- * 
- *         self.duplicated_fd = dup(fd)
- */
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":941
- *             raise ValueError("I/O operation on closed file.")
- * 
- *         self.duplicated_fd = dup(fd)             # <<<<<<<<<<<<<<
- * 
- *         # From the manual:
- */
-  __pyx_v_self->duplicated_fd = dup(__pyx_v_fd);
-
-  /* "pysam/ctabix.pyx":948
- *         # When reading, this will be detected automatically by looking
- *         # for the magic two-byte gzip header.
- *         self.fh = gzdopen(self.duplicated_fd, 'r')             # <<<<<<<<<<<<<<
- * 
- *         if self.fh == NULL:
- */
-  __pyx_v_self->fh = gzdopen(__pyx_v_self->duplicated_fd, __pyx_k_r);
-
-  /* "pysam/ctabix.pyx":950
- *         self.fh = gzdopen(self.duplicated_fd, 'r')
- * 
- *         if self.fh == NULL:             # <<<<<<<<<<<<<<
- *             raise IOError('%s' % strerror(errno))
- * 
- */
-  __pyx_t_2 = ((__pyx_v_self->fh == NULL) != 0);
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":951
- * 
- *         if self.fh == NULL:
- *             raise IOError('%s' % strerror(errno))             # <<<<<<<<<<<<<<
- * 
- *         self.kstream = ks_init(self.fh)
- */
-    __pyx_t_1 = __Pyx_PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __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 = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
-    __Pyx_GIVEREF(__pyx_t_4);
-    __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":953
- *             raise IOError('%s' % strerror(errno))
- * 
- *         self.kstream = ks_init(self.fh)             # <<<<<<<<<<<<<<
- * 
- *         self.buffer.s = <char*>malloc(buffer_size)
- */
-  __pyx_v_self->kstream = ks_init(__pyx_v_self->fh);
-
-  /* "pysam/ctabix.pyx":955
- *         self.kstream = ks_init(self.fh)
- * 
- *         self.buffer.s = <char*>malloc(buffer_size)             # <<<<<<<<<<<<<<
- *         #if self.buffer == NULL:
- *         #    raise MemoryError( "tabix_file_iterator: could not allocate %i bytes" % buffer_size)
- */
-  __pyx_v_self->buffer.s = ((char *)malloc(__pyx_v_buffer_size));
-
-  /* "pysam/ctabix.pyx":959
- *         #    raise MemoryError( "tabix_file_iterator: could not allocate %i bytes" % buffer_size)
- *         #self.size = buffer_size
- *         self.parser = parser             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  __Pyx_INCREF(((PyObject *)__pyx_v_parser));
-  __Pyx_GIVEREF(((PyObject *)__pyx_v_parser));
-  __Pyx_GOTREF(__pyx_v_self->parser);
-  __Pyx_DECREF(((PyObject *)__pyx_v_self->parser));
-  __pyx_v_self->parser = __pyx_v_parser;
-
-  /* "pysam/ctabix.pyx":927
- *     '''
- * 
- *     def __cinit__(self,             # <<<<<<<<<<<<<<
- *                   infile,
- *                   Parser parser,
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_file_iterator.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = -1;
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":961
- *         self.parser = parser
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_3__iter__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_3__iter__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_19tabix_file_iterator_2__iter__(((struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_19tabix_file_iterator_2__iter__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-
-  /* "pysam/ctabix.pyx":962
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     cdef __cnext__(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_self));
-  __pyx_r = ((PyObject *)__pyx_v_self);
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":961
- *         self.parser = parser
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":964
- *         return self
- * 
- *     cdef __cnext__(self):             # <<<<<<<<<<<<<<
- * 
- *         cdef char * b
- */
-
-static PyObject *__pyx_f_5pysam_6ctabix_19tabix_file_iterator___cnext__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self) {
-  char *__pyx_v_b;
-  int __pyx_v_dret;
-  int __pyx_v_retval;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  char *__pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__cnext__", 0);
-
-  /* "pysam/ctabix.pyx":967
- * 
- *         cdef char * b
- *         cdef int dret = 0             # <<<<<<<<<<<<<<
- *         cdef int retval = 0
- *         while 1:
- */
-  __pyx_v_dret = 0;
-
-  /* "pysam/ctabix.pyx":968
- *         cdef char * b
- *         cdef int dret = 0
- *         cdef int retval = 0             # <<<<<<<<<<<<<<
- *         while 1:
- * 
- */
-  __pyx_v_retval = 0;
-
-  /* "pysam/ctabix.pyx":969
- *         cdef int dret = 0
- *         cdef int retval = 0
- *         while 1:             # <<<<<<<<<<<<<<
- * 
- *             retval = ks_getuntil(self.kstream, '\n', &self.buffer, &dret)
- */
-  while (1) {
-
-    /* "pysam/ctabix.pyx":971
- *         while 1:
- * 
- *             retval = ks_getuntil(self.kstream, '\n', &self.buffer, &dret)             # <<<<<<<<<<<<<<
- * 
- *             if retval < 0:
- */
-    __pyx_v_retval = ks_getuntil(__pyx_v_self->kstream, '\n', (&__pyx_v_self->buffer), (&__pyx_v_dret));
-
-    /* "pysam/ctabix.pyx":973
- *             retval = ks_getuntil(self.kstream, '\n', &self.buffer, &dret)
- * 
- *             if retval < 0:             # <<<<<<<<<<<<<<
- *                 break
- *                 #raise IOError('gzip error: %s' % buildGzipError( self.fh ))
- */
-    __pyx_t_1 = ((__pyx_v_retval < 0) != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/ctabix.pyx":974
- * 
- *             if retval < 0:
- *                 break             # <<<<<<<<<<<<<<
- *                 #raise IOError('gzip error: %s' % buildGzipError( self.fh ))
- * 
- */
-      goto __pyx_L4_break;
-    }
-
-    /* "pysam/ctabix.pyx":977
- *                 #raise IOError('gzip error: %s' % buildGzipError( self.fh ))
- * 
- *             b = self.buffer.s             # <<<<<<<<<<<<<<
- * 
- *             # skip comments
- */
-    __pyx_t_2 = __pyx_v_self->buffer.s;
-    __pyx_v_b = __pyx_t_2;
-
-    /* "pysam/ctabix.pyx":980
- * 
- *             # skip comments
- *             if (b[0] == '#'):             # <<<<<<<<<<<<<<
- *                 continue
- * 
- */
-    __pyx_t_1 = (((__pyx_v_b[0]) == '#') != 0);
-    if (__pyx_t_1) {
-
-      /* "pysam/ctabix.pyx":981
- *             # skip comments
- *             if (b[0] == '#'):
- *                 continue             # <<<<<<<<<<<<<<
- * 
- *             # skip empty lines
- */
-      goto __pyx_L3_continue;
-    }
-
-    /* "pysam/ctabix.pyx":984
- * 
- *             # skip empty lines
- *             if b[0] == '\0' or b[0] == '\n' or b[0] == '\r':             # <<<<<<<<<<<<<<
- *                 continue
- * 
- */
-    __pyx_t_1 = (((__pyx_v_b[0]) == '\x00') != 0);
-    if (!__pyx_t_1) {
-      __pyx_t_3 = (((__pyx_v_b[0]) == '\n') != 0);
-      if (!__pyx_t_3) {
-        __pyx_t_4 = (((__pyx_v_b[0]) == '\r') != 0);
-        __pyx_t_5 = __pyx_t_4;
-      } else {
-        __pyx_t_5 = __pyx_t_3;
-      }
-      __pyx_t_3 = __pyx_t_5;
-    } else {
-      __pyx_t_3 = __pyx_t_1;
-    }
-    if (__pyx_t_3) {
-
-      /* "pysam/ctabix.pyx":985
- *             # skip empty lines
- *             if b[0] == '\0' or b[0] == '\n' or b[0] == '\r':
- *                 continue             # <<<<<<<<<<<<<<
- * 
- *             # gzgets terminates at \n, no need to test
- */
-      goto __pyx_L3_continue;
-    }
-
-    /* "pysam/ctabix.pyx":990
- * 
- *             # parser creates a copy
- *             return self.parser.parse( b, self.buffer.l)             # <<<<<<<<<<<<<<
- * 
- *         raise StopIteration
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_6 = ((struct __pyx_vtabstruct_5pysam_6ctabix_Parser *)__pyx_v_self->parser->__pyx_vtab)->parse(__pyx_v_self->parser, __pyx_v_b, __pyx_v_self->buffer.l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_r = __pyx_t_6;
-    __pyx_t_6 = 0;
-    goto __pyx_L0;
-    __pyx_L3_continue:;
-  }
-  __pyx_L4_break:;
-
-  /* "pysam/ctabix.pyx":992
- *             return self.parser.parse( b, self.buffer.l)
- * 
- *         raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *     def __dealloc__(self):
- */
-  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":964
- *         return self
- * 
- *     cdef __cnext__(self):             # <<<<<<<<<<<<<<
- * 
- *         cdef char * b
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_file_iterator.__cnext__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":994
- *         raise StopIteration
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         free(self.buffer.s)
- *         ks_destroy(self.kstream)
- */
-
-/* Python wrapper */
-static void __pyx_pw_5pysam_6ctabix_19tabix_file_iterator_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_5pysam_6ctabix_19tabix_file_iterator_5__dealloc__(PyObject *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
-  __pyx_pf_5pysam_6ctabix_19tabix_file_iterator_4__dealloc__(((struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-static void __pyx_pf_5pysam_6ctabix_19tabix_file_iterator_4__dealloc__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_self) {
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__dealloc__", 0);
-
-  /* "pysam/ctabix.pyx":995
- * 
- *     def __dealloc__(self):
- *         free(self.buffer.s)             # <<<<<<<<<<<<<<
- *         ks_destroy(self.kstream)
- *         gzclose(self.fh)
- */
-  free(__pyx_v_self->buffer.s);
-
-  /* "pysam/ctabix.pyx":996
- *     def __dealloc__(self):
- *         free(self.buffer.s)
- *         ks_destroy(self.kstream)             # <<<<<<<<<<<<<<
- *         gzclose(self.fh)
- * 
- */
-  ks_destroy(__pyx_v_self->kstream);
-
-  /* "pysam/ctabix.pyx":997
- *         free(self.buffer.s)
- *         ks_destroy(self.kstream)
- *         gzclose(self.fh)             # <<<<<<<<<<<<<<
- * 
- *     def __next__(self):
- */
-  gzclose(__pyx_v_self->fh);
-
-  /* "pysam/ctabix.pyx":994
- *         raise StopIteration
- * 
- *     def __dealloc__(self):             # <<<<<<<<<<<<<<
- *         free(self.buffer.s)
- *         ks_destroy(self.kstream)
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-}
-
-/* "pysam/ctabix.pyx":999
- *         gzclose(self.fh)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         return self.__cnext__()
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_7__next__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_7__next__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_19tabix_file_iterator_6__next__(((struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_19tabix_file_iterator_6__next__(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_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_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/ctabix.pyx":1000
- * 
- *     def __next__(self):
- *         return self.__cnext__()             # <<<<<<<<<<<<<<
- * 
- *     def next(self):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator *)__pyx_v_self->__pyx_vtab)->__pyx___cnext__(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":999
- *         gzclose(self.fh)
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         return self.__cnext__()
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_file_iterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":1002
- *         return self.__cnext__()
- * 
- *     def next(self):             # <<<<<<<<<<<<<<
- *         return self.__cnext__()
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_9next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_19tabix_file_iterator_8next[] = "tabix_file_iterator.next(self)";
-static PyObject *__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_9next(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("next (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_19tabix_file_iterator_8next(((struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_19tabix_file_iterator_8next(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *__pyx_v_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_RefNannySetupContext("next", 0);
-
-  /* "pysam/ctabix.pyx":1003
- * 
- *     def next(self):
- *         return self.__cnext__()             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator *)__pyx_v_self->__pyx_vtab)->__pyx___cnext__(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":1002
- *         return self.__cnext__()
- * 
- *     def next(self):             # <<<<<<<<<<<<<<
- *         return self.__cnext__()
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_file_iterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":1011
- *     Permits the use of file-like objects for example from the gzip module.
- *     '''
- *     def __init__(self, infile, parser):             # <<<<<<<<<<<<<<
- * 
- *         self.infile = infile
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_22tabix_generic_iterator___init__[] = "tabix_generic_iterator.__init__(self, infile, parser)";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_22tabix_generic_iterator_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_22tabix_generic_iterator___init__)};
-static PyObject *__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_infile = 0;
-  PyObject *__pyx_v_parser = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_infile,&__pyx_n_s_parser,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infile)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __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_self = values[0];
-    __pyx_v_infile = values[1];
-    __pyx_v_parser = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.tabix_generic_iterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_22tabix_generic_iterator___init__(__pyx_self, __pyx_v_self, __pyx_v_infile, __pyx_v_parser);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_22tabix_generic_iterator___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_parser) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__init__", 0);
-
-  /* "pysam/ctabix.pyx":1013
- *     def __init__(self, infile, parser):
- * 
- *         self.infile = infile             # <<<<<<<<<<<<<<
- *         if self.infile.closed:
- *             raise ValueError("I/O operation on closed file.")
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_infile, __pyx_v_infile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":1014
- * 
- *         self.infile = infile
- *         if self.infile.closed:             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file.")
- *         self.parser = parser
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_infile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_closed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
-
-    /* "pysam/ctabix.pyx":1015
- *         self.infile = infile
- *         if self.infile.closed:
- *             raise ValueError("I/O operation on closed file.")             # <<<<<<<<<<<<<<
- *         self.parser = parser
- * 
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":1016
- *         if self.infile.closed:
- *             raise ValueError("I/O operation on closed file.")
- *         self.parser = parser             # <<<<<<<<<<<<<<
- * 
- *     def __iter__(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parser, __pyx_v_parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":1011
- *     Permits the use of file-like objects for example from the gzip module.
- *     '''
- *     def __init__(self, infile, parser):             # <<<<<<<<<<<<<<
- * 
- *         self.infile = infile
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_generic_iterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":1018
- *         self.parser = parser
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_22tabix_generic_iterator_2__iter__[] = "tabix_generic_iterator.__iter__(self)";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_22tabix_generic_iterator_3__iter__ = {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_3__iter__, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_22tabix_generic_iterator_2__iter__)};
-static PyObject *__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_2__iter__(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__iter__", 0);
-
-  /* "pysam/ctabix.pyx":1019
- * 
- *     def __iter__(self):
- *         return self             # <<<<<<<<<<<<<<
- * 
- *     # cython version - required for python 3
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_self);
-  __pyx_r = __pyx_v_self;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":1018
- *         self.parser = parser
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":1022
- * 
- *     # cython version - required for python 3
- *     def __next__(self):             # <<<<<<<<<<<<<<
- * 
- *         cdef char * b
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_5__next__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_22tabix_generic_iterator_4__next__[] = "tabix_generic_iterator.__next__(self)";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_22tabix_generic_iterator_5__next__ = {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_5__next__, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_22tabix_generic_iterator_4__next__)};
-static PyObject *__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_5__next__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_4__next__(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_4__next__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  char *__pyx_v_b;
-  char *__pyx_v_cpy;
-  size_t __pyx_v_nbytes;
-  PyObject *__pyx_v_encoding = NULL;
-  PyObject *__pyx_v_line = NULL;
-  PyObject *__pyx_v_s = NULL;
-  PyObject *__pyx_v_bytes_cpy = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  struct __pyx_opt_args_5pysam_6ctabix__force_bytes __pyx_t_5;
-  char *__pyx_t_6;
-  Py_ssize_t __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__next__", 0);
-
-  /* "pysam/ctabix.pyx":1028
- *         cdef size_t nbytes
- * 
- *         encoding = self.parser.get_encoding()             # <<<<<<<<<<<<<<
- * 
- *         # note that GzipFile.close() does not close the file
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_encoding = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":1032
- *         # note that GzipFile.close() does not close the file
- *         # reading is still possible.
- *         if self.infile.closed:             # <<<<<<<<<<<<<<
- *             raise ValueError("I/O operation on closed file.")
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_infile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_closed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
-
-    /* "pysam/ctabix.pyx":1033
- *         # reading is still possible.
- *         if self.infile.closed:
- *             raise ValueError("I/O operation on closed file.")             # <<<<<<<<<<<<<<
- * 
- *         while 1:
- */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/ctabix.pyx":1035
- *             raise ValueError("I/O operation on closed file.")
- * 
- *         while 1:             # <<<<<<<<<<<<<<
- * 
- *             line = self.infile.readline()
- */
-  while (1) {
-
-    /* "pysam/ctabix.pyx":1037
- *         while 1:
- * 
- *             line = self.infile.readline()             # <<<<<<<<<<<<<<
- *             if not line:
- *                 break
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_infile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_readline); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/ctabix.pyx":1038
- * 
- *             line = self.infile.readline()
- *             if not line:             # <<<<<<<<<<<<<<
- *                 break
- * 
- */
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_line); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = ((!__pyx_t_3) != 0);
-    if (__pyx_t_4) {
-
-      /* "pysam/ctabix.pyx":1039
- *             line = self.infile.readline()
- *             if not line:
- *                 break             # <<<<<<<<<<<<<<
- * 
- *             s = _force_bytes(line, encoding)
- */
-      goto __pyx_L5_break;
-    }
-
-    /* "pysam/ctabix.pyx":1041
- *                 break
- * 
- *             s = _force_bytes(line, encoding)             # <<<<<<<<<<<<<<
- *             b = s
- *             nbytes = len(line)
- */
-    __pyx_t_5.__pyx_n = 1;
-    __pyx_t_5.encoding = __pyx_v_encoding;
-    __pyx_t_2 = __pyx_f_5pysam_6ctabix__force_bytes(__pyx_v_line, &__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_XDECREF_SET(__pyx_v_s, ((PyObject*)__pyx_t_2));
-    __pyx_t_2 = 0;
-
-    /* "pysam/ctabix.pyx":1042
- * 
- *             s = _force_bytes(line, encoding)
- *             b = s             # <<<<<<<<<<<<<<
- *             nbytes = len(line)
- *             assert b[nbytes] == '\0'
- */
-    __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_s); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_b = __pyx_t_6;
-
-    /* "pysam/ctabix.pyx":1043
- *             s = _force_bytes(line, encoding)
- *             b = s
- *             nbytes = len(line)             # <<<<<<<<<<<<<<
- *             assert b[nbytes] == '\0'
- * 
- */
-    __pyx_t_7 = PyObject_Length(__pyx_v_line); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_nbytes = __pyx_t_7;
-
-    /* "pysam/ctabix.pyx":1044
- *             b = s
- *             nbytes = len(line)
- *             assert b[nbytes] == '\0'             # <<<<<<<<<<<<<<
- * 
- *             # skip comments
- */
-    #ifndef CYTHON_WITHOUT_ASSERTIONS
-    if (unlikely(!Py_OptimizeFlag)) {
-      if (unlikely(!(((__pyx_v_b[__pyx_v_nbytes]) == '\x00') != 0))) {
-        PyErr_SetNone(PyExc_AssertionError);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-    }
-    #endif
-
-    /* "pysam/ctabix.pyx":1047
- * 
- *             # skip comments
- *             if b[0] == '#':             # <<<<<<<<<<<<<<
- *                 continue
- * 
- */
-    __pyx_t_4 = (((__pyx_v_b[0]) == '#') != 0);
-    if (__pyx_t_4) {
-
-      /* "pysam/ctabix.pyx":1048
- *             # skip comments
- *             if b[0] == '#':
- *                 continue             # <<<<<<<<<<<<<<
- * 
- *             # skip empty lines
- */
-      goto __pyx_L4_continue;
-    }
-
-    /* "pysam/ctabix.pyx":1051
- * 
- *             # skip empty lines
- *             if b[0] == '\0' or b[0] == '\n' or b[0] == '\r':             # <<<<<<<<<<<<<<
- *                 continue
- * 
- */
-    __pyx_t_4 = (((__pyx_v_b[0]) == '\x00') != 0);
-    if (!__pyx_t_4) {
-      __pyx_t_3 = (((__pyx_v_b[0]) == '\n') != 0);
-      if (!__pyx_t_3) {
-        __pyx_t_8 = (((__pyx_v_b[0]) == '\r') != 0);
-        __pyx_t_9 = __pyx_t_8;
-      } else {
-        __pyx_t_9 = __pyx_t_3;
-      }
-      __pyx_t_3 = __pyx_t_9;
-    } else {
-      __pyx_t_3 = __pyx_t_4;
-    }
-    if (__pyx_t_3) {
-
-      /* "pysam/ctabix.pyx":1052
- *             # skip empty lines
- *             if b[0] == '\0' or b[0] == '\n' or b[0] == '\r':
- *                 continue             # <<<<<<<<<<<<<<
- * 
- *             # make sure that entry is complete
- */
-      goto __pyx_L4_continue;
-    }
-
-    /* "pysam/ctabix.pyx":1055
- * 
- *             # make sure that entry is complete
- *             if b[nbytes-1] != '\n' and b[nbytes-1] != '\r':             # <<<<<<<<<<<<<<
- *                 raise ValueError("incomplete line at %s" % line)
- * 
- */
-    __pyx_t_3 = (((__pyx_v_b[(__pyx_v_nbytes - 1)]) != '\n') != 0);
-    if (__pyx_t_3) {
-      __pyx_t_4 = (((__pyx_v_b[(__pyx_v_nbytes - 1)]) != '\r') != 0);
-      __pyx_t_9 = __pyx_t_4;
-    } else {
-      __pyx_t_9 = __pyx_t_3;
-    }
-    if (__pyx_t_9) {
-
-      /* "pysam/ctabix.pyx":1056
- *             # make sure that entry is complete
- *             if b[nbytes-1] != '\n' and b[nbytes-1] != '\r':
- *                 raise ValueError("incomplete line at %s" % line)             # <<<<<<<<<<<<<<
- * 
- *             bytes_cpy = <bytes> b
- */
-      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_incomplete_line_at_s, __pyx_v_line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/ctabix.pyx":1058
- *                 raise ValueError("incomplete line at %s" % line)
- * 
- *             bytes_cpy = <bytes> b             # <<<<<<<<<<<<<<
- *             cpy = <char *> bytes_cpy
- * 
- */
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __pyx_t_2;
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_bytes_cpy = ((PyObject*)__pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/ctabix.pyx":1059
- * 
- *             bytes_cpy = <bytes> b
- *             cpy = <char *> bytes_cpy             # <<<<<<<<<<<<<<
- * 
- *             return self.parser(cpy, nbytes)
- */
-    __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_bytes_cpy); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_v_cpy = ((char *)__pyx_t_6);
-
-    /* "pysam/ctabix.pyx":1061
- *             cpy = <char *> bytes_cpy
- * 
- *             return self.parser(cpy, nbytes)             # <<<<<<<<<<<<<<
- * 
- *         raise StopIteration
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_cpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_10 = __Pyx_PyInt_FromSize_t(__pyx_v_nbytes); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __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 = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
-    __Pyx_GIVEREF(__pyx_t_10);
-    __pyx_t_2 = 0;
-    __pyx_t_10 = 0;
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_r = __pyx_t_10;
-    __pyx_t_10 = 0;
-    goto __pyx_L0;
-    __pyx_L4_continue:;
-  }
-  __pyx_L5_break:;
-
-  /* "pysam/ctabix.pyx":1063
- *             return self.parser(cpy, nbytes)
- * 
- *         raise StopIteration             # <<<<<<<<<<<<<<
- * 
- *     # python version - required for python 2.7
- */
-  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":1022
- * 
- *     # cython version - required for python 3
- *     def __next__(self):             # <<<<<<<<<<<<<<
- * 
- *         cdef char * b
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_generic_iterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_encoding);
-  __Pyx_XDECREF(__pyx_v_line);
-  __Pyx_XDECREF(__pyx_v_s);
-  __Pyx_XDECREF(__pyx_v_bytes_cpy);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":1066
- * 
- *     # python version - required for python 2.7
- *     def next(self):             # <<<<<<<<<<<<<<
- *         return self.__next__()
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_7next(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_22tabix_generic_iterator_6next[] = "tabix_generic_iterator.next(self)";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_22tabix_generic_iterator_7next = {__Pyx_NAMESTR("next"), (PyCFunction)__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_7next, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_22tabix_generic_iterator_6next)};
-static PyObject *__pyx_pw_5pysam_6ctabix_22tabix_generic_iterator_7next(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("next (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_6next(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_22tabix_generic_iterator_6next(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("next", 0);
-
-  /* "pysam/ctabix.pyx":1067
- *     # python version - required for python 2.7
- *     def next(self):
- *         return self.__next__()             # <<<<<<<<<<<<<<
- * 
- * def tabix_iterator(infile, parser):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/ctabix.pyx":1066
- * 
- *     # python version - required for python 2.7
- *     def next(self):             # <<<<<<<<<<<<<<
- *         return self.__next__()
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_generic_iterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/ctabix.pyx":1069
- *         return self.__next__()
- * 
- * def tabix_iterator(infile, parser):             # <<<<<<<<<<<<<<
- *     """return an iterator over all entries in a file.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_6ctabix_5tabix_iterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_6ctabix_4tabix_iterator[] = "tabix_iterator(infile, parser)\nreturn an iterator over all entries in a file.\n    \n    Results are returned parsed as specified by the *parser*. If\n    *parser* is None, the results are returned as an unparsed string.\n    Otherwise, *parser* is assumed to be a functor that will return\n    parsed data (see for example :class:`~pysam.asTuple` and\n    :class:`~pysam.asGTF`).\n\n    ";
-static PyMethodDef __pyx_mdef_5pysam_6ctabix_5tabix_iterator = {__Pyx_NAMESTR("tabix_iterator"), (PyCFunction)__pyx_pw_5pysam_6ctabix_5tabix_iterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_4tabix_iterator)};
-static PyObject *__pyx_pw_5pysam_6ctabix_5tabix_iterator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_infile = 0;
-  PyObject *__pyx_v_parser = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("tabix_iterator (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_infile,&__pyx_n_s_parser,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_infile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parser)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("tabix_iterator", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tabix_iterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __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_infile = values[0];
-    __pyx_v_parser = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("tabix_iterator", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.ctabix.tabix_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_6ctabix_4tabix_iterator(__pyx_self, __pyx_v_infile, __pyx_v_parser);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_6ctabix_4tabix_iterator(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_infile, PyObject *__pyx_v_parser) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("tabix_iterator", 0);
-
-  /* "pysam/ctabix.pyx":1079
- * 
- *     """
- *     if PYTHON3:             # <<<<<<<<<<<<<<
- *         return tabix_generic_iterator(infile, parser)
- *     else:
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PYTHON3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/ctabix.pyx":1080
- *     """
- *     if PYTHON3:
- *         return tabix_generic_iterator(infile, parser)             # <<<<<<<<<<<<<<
- *     else:
- *         return tabix_file_iterator(infile, parser)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_tabix_generic_iterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_infile);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_infile);
-    __Pyx_GIVEREF(__pyx_v_infile);
-    __Pyx_INCREF(__pyx_v_parser);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
-    __Pyx_GIVEREF(__pyx_v_parser);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/ctabix.pyx":1082
- *         return tabix_generic_iterator(infile, parser)
- *     else:
- *         return tabix_file_iterator(infile, parser)             # <<<<<<<<<<<<<<
- * 
- *     # file objects can use C stdio
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_infile);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_infile);
-    __Pyx_GIVEREF(__pyx_v_infile);
-    __Pyx_INCREF(__pyx_v_parser);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_parser);
-    __Pyx_GIVEREF(__pyx_v_parser);
-    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_6ctabix_tabix_file_iterator)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/ctabix.pyx":1069
- *         return self.__next__()
- * 
- * def tabix_iterator(infile, parser):             # <<<<<<<<<<<<<<
- *     """return an iterator over all entries in a file.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_AddTraceback("pysam.ctabix.tabix_iterator", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-static struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator __pyx_vtable_5pysam_6ctabix_tabix_file_iterator;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_tabix_file_iterator(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_6ctabix_tabix_file_iterator;
-  p->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
-  p->infile = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6ctabix_tabix_file_iterator(PyObject *o) {
-  struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *p = (struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_6ctabix_19tabix_file_iterator_5__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->parser);
-  Py_CLEAR(p->infile);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6ctabix_tabix_file_iterator(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *p = (struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)o;
-  if (p->parser) {
-    e = (*v)(((PyObject*)p->parser), a); if (e) return e;
-  }
-  if (p->infile) {
-    e = (*v)(p->infile, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6ctabix_tabix_file_iterator(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *p = (struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *)o;
-  tmp = ((PyObject*)p->parser);
-  p->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->infile);
-  p->infile = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_6ctabix_tabix_file_iterator[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_7__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
-  {__Pyx_NAMESTR("next"), (PyCFunction)__pyx_pw_5pysam_6ctabix_19tabix_file_iterator_9next, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_19tabix_file_iterator_8next)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_tabix_file_iterator = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.tabix_file_iterator"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_tabix_file_iterator, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("iterate over a compressed or uncompressed ``infile``.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_tabix_file_iterator, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_tabix_file_iterator, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_6ctabix_19tabix_file_iterator_3__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_6ctabix_19tabix_file_iterator_7__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_6ctabix_tabix_file_iterator, /*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_5pysam_6ctabix_tabix_file_iterator, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_TabixFile(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_TabixFile *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_TabixFile *)o);
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  p->_filename_index = Py_None; Py_INCREF(Py_None);
-  p->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_5pysam_6ctabix_9TabixFile_1__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6ctabix_TabixFile(PyObject *o) {
-  struct __pyx_obj_5pysam_6ctabix_TabixFile *p = (struct __pyx_obj_5pysam_6ctabix_TabixFile *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_6ctabix_9TabixFile_13__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->_filename);
-  Py_CLEAR(p->_filename_index);
-  Py_CLEAR(p->parser);
-  Py_CLEAR(p->encoding);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6ctabix_TabixFile(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6ctabix_TabixFile *p = (struct __pyx_obj_5pysam_6ctabix_TabixFile *)o;
-  if (p->_filename) {
-    e = (*v)(p->_filename, a); if (e) return e;
-  }
-  if (p->_filename_index) {
-    e = (*v)(p->_filename_index, a); if (e) return e;
-  }
-  if (p->parser) {
-    e = (*v)(((PyObject*)p->parser), a); if (e) return e;
-  }
-  if (p->encoding) {
-    e = (*v)(p->encoding, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6ctabix_TabixFile(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6ctabix_TabixFile *p = (struct __pyx_obj_5pysam_6ctabix_TabixFile *)o;
-  tmp = ((PyObject*)p->_filename);
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->_filename_index);
-  p->_filename_index = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->parser);
-  p->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->encoding);
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyObject *__pyx_getprop_5pysam_6ctabix_9TabixFile_filename(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6ctabix_9TabixFile_8filename_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6ctabix_9TabixFile_header(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6ctabix_9TabixFile_6header_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_6ctabix_9TabixFile_contigs(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_6ctabix_9TabixFile_7contigs_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_6ctabix_TabixFile[] = {
-  {__Pyx_NAMESTR("_open"), (PyCFunction)__pyx_pw_5pysam_6ctabix_9TabixFile_3_open, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_9TabixFile_2_open)},
-  {__Pyx_NAMESTR("_dup"), (PyCFunction)__pyx_pw_5pysam_6ctabix_9TabixFile_5_dup, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_9TabixFile_4_dup)},
-  {__Pyx_NAMESTR("_isOpen"), (PyCFunction)__pyx_pw_5pysam_6ctabix_9TabixFile_7_isOpen, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_9TabixFile_6_isOpen)},
-  {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pw_5pysam_6ctabix_9TabixFile_9fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_9TabixFile_8fetch)},
-  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pw_5pysam_6ctabix_9TabixFile_11close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_9TabixFile_10close)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_6ctabix_TabixFile[] = {
-  {(char *)"filename", __pyx_getprop_5pysam_6ctabix_9TabixFile_filename, 0, __Pyx_DOCSTR(__pyx_k_filename_associated_with_this_ob), 0},
-  {(char *)"header", __pyx_getprop_5pysam_6ctabix_9TabixFile_header, 0, __Pyx_DOCSTR(__pyx_k_the_file_header_note_The_header), 0},
-  {(char *)"contigs", __pyx_getprop_5pysam_6ctabix_9TabixFile_contigs, 0, __Pyx_DOCSTR(__pyx_k_list_of_chromosome_names), 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_TabixFile = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.TabixFile"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_TabixFile), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_TabixFile, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("*(filename, mode='r', parser = None)*\n\n    opens a :term:`tabix file` for reading. A missing\n    index (*filename* + \".tbi\") will raise an exception. *index*\n    specifies an alternative name of the index.\n\n    *parser* sets the default parser for this tabix file. If *parser*\n    is None, the results are returned as an unparsed string.\n    Otherwise, *parser* is assumed to be a functor that will return\n    parsed data (see for example :class:`~pysam.asTuple` an [...]
-  __pyx_tp_traverse_5pysam_6ctabix_TabixFile, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_TabixFile, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_6ctabix_TabixFile, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_6ctabix_TabixFile, /*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_5pysam_6ctabix_TabixFile, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_vtable_5pysam_6ctabix_Parser;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_Parser(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_Parser *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_Parser *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_6ctabix_Parser;
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6ctabix_Parser(PyObject *o) {
-  struct __pyx_obj_5pysam_6ctabix_Parser *p = (struct __pyx_obj_5pysam_6ctabix_Parser *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->encoding);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6ctabix_Parser(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6ctabix_Parser *p = (struct __pyx_obj_5pysam_6ctabix_Parser *)o;
-  if (p->encoding) {
-    e = (*v)(p->encoding, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6ctabix_Parser(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6ctabix_Parser *p = (struct __pyx_obj_5pysam_6ctabix_Parser *)o;
-  tmp = ((PyObject*)p->encoding);
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_6ctabix_Parser[] = {
-  {__Pyx_NAMESTR("set_encoding"), (PyCFunction)__pyx_pw_5pysam_6ctabix_6Parser_3set_encoding, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_6Parser_2set_encoding)},
-  {__Pyx_NAMESTR("get_encoding"), (PyCFunction)__pyx_pw_5pysam_6ctabix_6Parser_5get_encoding, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_6Parser_4get_encoding)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_Parser = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.Parser"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_Parser), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_Parser, /*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*/
-  __pyx_pw_5pysam_6ctabix_6Parser_7__call__, /*tp_call*/
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("Parser(encoding='ascii')"), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_Parser, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_Parser, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_6ctabix_Parser, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_6ctabix_6Parser_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_Parser, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asTuple __pyx_vtable_5pysam_6ctabix_asTuple;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_asTuple(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_asTuple *p;
-  PyObject *o = __pyx_tp_new_5pysam_6ctabix_Parser(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_asTuple *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6ctabix_Parser*)__pyx_vtabptr_5pysam_6ctabix_asTuple;
-  return o;
-}
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_asTuple = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.asTuple"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_asTuple), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_Parser, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_6Parser_7__call__, /*tp_call*/
-  #else
-  0, /*tp_call*/
-  #endif
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("converts a :term:`tabix row` into a python tuple.\n\n    A field in a row is accessed by numeric index.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_Parser, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_Parser, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_6Parser_1__init__, /*tp_init*/
-  #else
-  0, /*tp_init*/
-  #endif
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_asTuple, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asGTF __pyx_vtable_5pysam_6ctabix_asGTF;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_asGTF(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_asGTF *p;
-  PyObject *o = __pyx_tp_new_5pysam_6ctabix_Parser(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_asGTF *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6ctabix_Parser*)__pyx_vtabptr_5pysam_6ctabix_asGTF;
-  return o;
-}
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_asGTF = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.asGTF"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_asGTF), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_Parser, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_6Parser_7__call__, /*tp_call*/
-  #else
-  0, /*tp_call*/
-  #endif
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("converts a :term:`tabix row` into a GTF record with the following\n    fields:\n   \n    +----------+----------+-------------------------------+\n    |*Column*  |*Name*    |*Content*                      |\n    +----------+----------+-------------------------------+\n    |1         |contig    |the chromosome name            |\n    +----------+----------+-------------------------------+\n    |2         |feature   |The feature type               |\n    +----------+--------- [...]
-  __pyx_tp_traverse_5pysam_6ctabix_Parser, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_Parser, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_6Parser_1__init__, /*tp_init*/
-  #else
-  0, /*tp_init*/
-  #endif
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_asGTF, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asBed __pyx_vtable_5pysam_6ctabix_asBed;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_asBed(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_asBed *p;
-  PyObject *o = __pyx_tp_new_5pysam_6ctabix_Parser(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_asBed *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6ctabix_Parser*)__pyx_vtabptr_5pysam_6ctabix_asBed;
-  return o;
-}
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_asBed = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.asBed"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_asBed), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_Parser, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_6Parser_7__call__, /*tp_call*/
-  #else
-  0, /*tp_call*/
-  #endif
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("converts a :term:`tabix row` into a bed record\n    with the following fields:\n\n    +-----------+-----------+------------------------------------------+\n    |*Column*   |*Field*    |*Contents*                                |\n    |           |           |                                          |\n    +-----------+-----------+------------------------------------------+\n    |1          |contig     |contig                                    |\n    |           |        [...]
-  __pyx_tp_traverse_5pysam_6ctabix_Parser, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_Parser, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_6Parser_1__init__, /*tp_init*/
-  #else
-  0, /*tp_init*/
-  #endif
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_asBed, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asVCF __pyx_vtable_5pysam_6ctabix_asVCF;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_asVCF(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_asVCF *p;
-  PyObject *o = __pyx_tp_new_5pysam_6ctabix_Parser(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_asVCF *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6ctabix_Parser*)__pyx_vtabptr_5pysam_6ctabix_asVCF;
-  return o;
-}
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_asVCF = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.asVCF"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_asVCF), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_Parser, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_6Parser_7__call__, /*tp_call*/
-  #else
-  0, /*tp_call*/
-  #endif
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("converts a :term:`tabix row` into a VCF record with\n    the following fields:\n    \n    +----------+---------+------------------------------------+\n    |*Column*  |*Field*  |*Contents*                          |\n    |          |         |                                    |\n    +----------+---------+------------------------------------+\n    |1         |contig   |chromosome                          |\n    +----------+---------+------------------------------------+\n [...]
-  __pyx_tp_traverse_5pysam_6ctabix_Parser, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_Parser, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_6Parser_1__init__, /*tp_init*/
-  #else
-  0, /*tp_init*/
-  #endif
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_asVCF, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator __pyx_vtable_5pysam_6ctabix_TabixIterator;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_TabixIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_TabixIterator *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_TabixIterator *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_6ctabix_TabixIterator;
-  p->tabixfile = ((struct __pyx_obj_5pysam_6ctabix_TabixFile *)Py_None); Py_INCREF(Py_None);
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6ctabix_TabixIterator(PyObject *o) {
-  struct __pyx_obj_5pysam_6ctabix_TabixIterator *p = (struct __pyx_obj_5pysam_6ctabix_TabixIterator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_6ctabix_13TabixIterator_9__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->tabixfile);
-  Py_CLEAR(p->encoding);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6ctabix_TabixIterator(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6ctabix_TabixIterator *p = (struct __pyx_obj_5pysam_6ctabix_TabixIterator *)o;
-  if (p->tabixfile) {
-    e = (*v)(((PyObject*)p->tabixfile), a); if (e) return e;
-  }
-  if (p->encoding) {
-    e = (*v)(p->encoding, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6ctabix_TabixIterator(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6ctabix_TabixIterator *p = (struct __pyx_obj_5pysam_6ctabix_TabixIterator *)o;
-  tmp = ((PyObject*)p->tabixfile);
-  p->tabixfile = ((struct __pyx_obj_5pysam_6ctabix_TabixFile *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->encoding);
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_6ctabix_TabixIterator[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_13TabixIterator_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_13TabixIterator_4__next__)},
-  {__Pyx_NAMESTR("next"), (PyCFunction)__pyx_pw_5pysam_6ctabix_13TabixIterator_7next, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_13TabixIterator_6next)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_TabixIterator = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.TabixIterator"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_TabixIterator), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_TabixIterator, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("TabixIterator(encoding='ascii')\niterates over rows in *tabixfile* in region\n    given by *tid*, *start* and *end*.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_TabixIterator, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_TabixIterator, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_6ctabix_13TabixIterator_3__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_6ctabix_13TabixIterator_5__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_6ctabix_TabixIterator, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_6ctabix_13TabixIterator_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_TabixIterator, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_TabixIteratorParsed __pyx_vtable_5pysam_6ctabix_TabixIteratorParsed;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_TabixIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *p;
-  PyObject *o = __pyx_tp_new_5pysam_6ctabix_TabixIterator(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator*)__pyx_vtabptr_5pysam_6ctabix_TabixIteratorParsed;
-  p->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6ctabix_TabixIteratorParsed(PyObject *o) {
-  struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *p = (struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->parser);
-  PyObject_GC_Track(o);
-  __pyx_tp_dealloc_5pysam_6ctabix_TabixIterator(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6ctabix_TabixIteratorParsed(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *p = (struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *)o;
-  e = __pyx_tp_traverse_5pysam_6ctabix_TabixIterator(o, v, a); if (e) return e;
-  if (p->parser) {
-    e = (*v)(((PyObject*)p->parser), a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6ctabix_TabixIteratorParsed(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *p = (struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed *)o;
-  __pyx_tp_clear_5pysam_6ctabix_TabixIterator(o);
-  tmp = ((PyObject*)p->parser);
-  p->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_6ctabix_TabixIteratorParsed[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_19TabixIteratorParsed_3__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_19TabixIteratorParsed_2__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_TabixIteratorParsed = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.TabixIteratorParsed"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_TabixIteratorParsed, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("TabixIteratorParsed(Parser parser)\niterates over mapped reads in a region.\n\n    The *parser* determines the encoding.\n\n    Returns parsed data.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_TabixIteratorParsed, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_TabixIteratorParsed, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_13TabixIterator_3__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  __pyx_pw_5pysam_6ctabix_19TabixIteratorParsed_3__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_6ctabix_TabixIteratorParsed, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_6ctabix_19TabixIteratorParsed_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_TabixIteratorParsed, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator __pyx_vtable_5pysam_6ctabix_GZIterator;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_GZIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_GZIterator *p;
-  PyObject *o;
-  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
-    o = (*t->tp_alloc)(t, 0);
-  } else {
-    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
-  }
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_GZIterator *)o);
-  p->__pyx_vtab = __pyx_vtabptr_5pysam_6ctabix_GZIterator;
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6ctabix_GZIterator(PyObject *o) {
-  struct __pyx_obj_5pysam_6ctabix_GZIterator *p = (struct __pyx_obj_5pysam_6ctabix_GZIterator *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  {
-    PyObject *etype, *eval, *etb;
-    PyErr_Fetch(&etype, &eval, &etb);
-    ++Py_REFCNT(o);
-    __pyx_pw_5pysam_6ctabix_10GZIterator_3__dealloc__(o);
-    --Py_REFCNT(o);
-    PyErr_Restore(etype, eval, etb);
-  }
-  Py_CLEAR(p->_filename);
-  Py_CLEAR(p->encoding);
-  (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6ctabix_GZIterator(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6ctabix_GZIterator *p = (struct __pyx_obj_5pysam_6ctabix_GZIterator *)o;
-  if (p->_filename) {
-    e = (*v)(p->_filename, a); if (e) return e;
-  }
-  if (p->encoding) {
-    e = (*v)(p->encoding, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6ctabix_GZIterator(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6ctabix_GZIterator *p = (struct __pyx_obj_5pysam_6ctabix_GZIterator *)o;
-  tmp = ((PyObject*)p->_filename);
-  p->_filename = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->encoding);
-  p->encoding = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_6ctabix_GZIterator[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_10GZIterator_7__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_10GZIterator_6__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_GZIterator = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.GZIterator"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_GZIterator), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_GZIterator, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("GZIterator(filename, int buffer_size=65536, encoding='ascii')"), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_GZIterator, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_GZIterator, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  __pyx_pw_5pysam_6ctabix_10GZIterator_5__iter__, /*tp_iter*/
-  __pyx_pw_5pysam_6ctabix_10GZIterator_7__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_6ctabix_GZIterator, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_6ctabix_10GZIterator_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_GZIterator, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorHead __pyx_vtable_5pysam_6ctabix_GZIteratorHead;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_GZIteratorHead(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_GZIteratorHead *p;
-  PyObject *o = __pyx_tp_new_5pysam_6ctabix_GZIterator(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_GZIteratorHead *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator*)__pyx_vtabptr_5pysam_6ctabix_GZIteratorHead;
-  return o;
-}
-
-static PyMethodDef __pyx_methods_5pysam_6ctabix_GZIteratorHead[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_14GZIteratorHead_1__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_14GZIteratorHead___next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_GZIteratorHead = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.GZIteratorHead"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_GZIteratorHead), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_GZIterator, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("iterate line-by-line through gzip (or bgzip)\n    compressed file returning comments at top of file.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_GZIterator, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_GZIterator, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_10GZIterator_5__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  __pyx_pw_5pysam_6ctabix_14GZIteratorHead_1__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_6ctabix_GZIteratorHead, /*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*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_10GZIterator_1__init__, /*tp_init*/
-  #else
-  0, /*tp_init*/
-  #endif
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_GZIteratorHead, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorParsed __pyx_vtable_5pysam_6ctabix_GZIteratorParsed;
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_GZIteratorParsed(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *p;
-  PyObject *o = __pyx_tp_new_5pysam_6ctabix_GZIterator(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator*)__pyx_vtabptr_5pysam_6ctabix_GZIteratorParsed;
-  p->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_6ctabix_GZIteratorParsed(PyObject *o) {
-  struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *p = (struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->parser);
-  PyObject_GC_Track(o);
-  __pyx_tp_dealloc_5pysam_6ctabix_GZIterator(o);
-}
-
-static int __pyx_tp_traverse_5pysam_6ctabix_GZIteratorParsed(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *p = (struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *)o;
-  e = __pyx_tp_traverse_5pysam_6ctabix_GZIterator(o, v, a); if (e) return e;
-  if (p->parser) {
-    e = (*v)(((PyObject*)p->parser), a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_6ctabix_GZIteratorParsed(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *p = (struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed *)o;
-  __pyx_tp_clear_5pysam_6ctabix_GZIterator(o);
-  tmp = ((PyObject*)p->parser);
-  p->parser = ((struct __pyx_obj_5pysam_6ctabix_Parser *)Py_None); Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_6ctabix_GZIteratorParsed[] = {
-  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pw_5pysam_6ctabix_16GZIteratorParsed_3__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_5pysam_6ctabix_16GZIteratorParsed_2__next__)},
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_GZIteratorParsed = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.GZIteratorParsed"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_GZIteratorParsed, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("GZIteratorParsed(parser)\niterate line-by-line through gzip (or bgzip)\n    compressed file returning comments at top of file.\n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_GZIteratorParsed, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_GZIteratorParsed, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  #if CYTHON_COMPILING_IN_PYPY
-  __pyx_pw_5pysam_6ctabix_10GZIterator_5__iter__, /*tp_iter*/
-  #else
-  0, /*tp_iter*/
-  #endif
-  __pyx_pw_5pysam_6ctabix_16GZIteratorParsed_3__next__, /*tp_iternext*/
-  __pyx_methods_5pysam_6ctabix_GZIteratorParsed, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_6ctabix_16GZIteratorParsed_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_6ctabix_GZIteratorParsed, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyObject *__pyx_tp_new_5pysam_6ctabix_Tabixfile(PyTypeObject *t, PyObject *a, PyObject *k) {
-  PyObject *o = __pyx_tp_new_5pysam_6ctabix_TabixFile(t, a, k);
-  if (unlikely(!o)) return 0;
-  return o;
-}
-
-static PyTypeObject __pyx_type_5pysam_6ctabix_Tabixfile = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.ctabix.Tabixfile"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_6ctabix_Tabixfile), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_6ctabix_TabixFile, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_6ctabix_TabixFile, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_6ctabix_TabixFile, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_6ctabix_Tabixfile, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
-  {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
-    PyModuleDef_HEAD_INIT,
-  #endif
-    __Pyx_NAMESTR("ctabix"),
-    0, /* m_doc */
-    -1, /* m_size */
-    __pyx_methods /* m_methods */,
-    NULL, /* m_reload */
-    NULL, /* m_traverse */
-    NULL, /* m_clear */
-    NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_u_Argument_must_be_string_bytes_or, __pyx_k_Argument_must_be_string_bytes_or, sizeof(__pyx_k_Argument_must_be_string_bytes_or), 0, 1, 0, 0},
-  {&__pyx_kp_u_Argument_must_be_string_or_unico, __pyx_k_Argument_must_be_string_or_unico, sizeof(__pyx_k_Argument_must_be_string_or_unico), 0, 1, 0, 0},
-  {&__pyx_n_s_EmptyIterator, __pyx_k_EmptyIterator, sizeof(__pyx_k_EmptyIterator), 0, 0, 1, 1},
-  {&__pyx_n_s_EmptyIterator___iter, __pyx_k_EmptyIterator___iter, sizeof(__pyx_k_EmptyIterator___iter), 0, 0, 1, 1},
-  {&__pyx_n_s_EmptyIterator___next, __pyx_k_EmptyIterator___next, sizeof(__pyx_k_EmptyIterator___next), 0, 0, 1, 1},
-  {&__pyx_n_s_EmptyIterator_next, __pyx_k_EmptyIterator_next, sizeof(__pyx_k_EmptyIterator_next), 0, 0, 1, 1},
-  {&__pyx_kp_s_Filename_s_already_exists_use_fo, __pyx_k_Filename_s_already_exists_use_fo, sizeof(__pyx_k_Filename_s_already_exists_use_fo), 0, 0, 1, 0},
-  {&__pyx_kp_s_Filename_s_tbi_already_exists_us, __pyx_k_Filename_s_tbi_already_exists_us, sizeof(__pyx_k_Filename_s_tbi_already_exists_us), 0, 0, 1, 0},
-  {&__pyx_n_s_GZIterator, __pyx_k_GZIterator, sizeof(__pyx_k_GZIterator), 0, 0, 1, 1},
-  {&__pyx_n_s_GZIteratorHead, __pyx_k_GZIteratorHead, sizeof(__pyx_k_GZIteratorHead), 0, 0, 1, 1},
-  {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
-  {&__pyx_kp_s_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 0, 1, 0},
-  {&__pyx_kp_s_I_O_operation_on_closed_file_2, __pyx_k_I_O_operation_on_closed_file_2, sizeof(__pyx_k_I_O_operation_on_closed_file_2), 0, 0, 1, 0},
-  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
-  {&__pyx_kp_s_No_such_file_or_directory_s, __pyx_k_No_such_file_or_directory_s, sizeof(__pyx_k_No_such_file_or_directory_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_No_such_file_s, __pyx_k_No_such_file_s, sizeof(__pyx_k_No_such_file_s), 0, 0, 1, 0},
-  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
-  {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
-  {&__pyx_n_s_O_RDONLY, __pyx_k_O_RDONLY, sizeof(__pyx_k_O_RDONLY), 0, 0, 1, 1},
-  {&__pyx_n_s_PYTHON3, __pyx_k_PYTHON3, sizeof(__pyx_k_PYTHON3), 0, 0, 1, 1},
-  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
-  {&__pyx_n_s_TabixFile, __pyx_k_TabixFile, sizeof(__pyx_k_TabixFile), 0, 0, 1, 1},
-  {&__pyx_n_s_Tabixfile, __pyx_k_Tabixfile, sizeof(__pyx_k_Tabixfile), 0, 0, 1, 1},
-  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
-  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s_WINDOW_SIZE, __pyx_k_WINDOW_SIZE, sizeof(__pyx_k_WINDOW_SIZE), 0, 0, 1, 1},
-  {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0},
-  {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
-  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
-  {&__pyx_n_s_asBed, __pyx_k_asBed, sizeof(__pyx_k_asBed), 0, 0, 1, 1},
-  {&__pyx_n_s_asGTF, __pyx_k_asGTF, sizeof(__pyx_k_asGTF), 0, 0, 1, 1},
-  {&__pyx_n_s_asTuple, __pyx_k_asTuple, sizeof(__pyx_k_asTuple), 0, 0, 1, 1},
-  {&__pyx_n_s_asVCF, __pyx_k_asVCF, sizeof(__pyx_k_asVCF), 0, 0, 1, 1},
-  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
-  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
-  {&__pyx_n_s_bed, __pyx_k_bed, sizeof(__pyx_k_bed), 0, 0, 1, 1},
-  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
-  {&__pyx_n_s_buffer_size, __pyx_k_buffer_size, sizeof(__pyx_k_buffer_size), 0, 0, 1, 1},
-  {&__pyx_n_s_bytes_cpy, __pyx_k_bytes_cpy, sizeof(__pyx_k_bytes_cpy), 0, 0, 1, 1},
-  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
-  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
-  {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
-  {&__pyx_n_s_conf, __pyx_k_conf, sizeof(__pyx_k_conf), 0, 0, 1, 1},
-  {&__pyx_n_s_conf_data, __pyx_k_conf_data, sizeof(__pyx_k_conf_data), 0, 0, 1, 1},
-  {&__pyx_kp_s_could_not_create_iterator_for_re, __pyx_k_could_not_create_iterator_for_re, sizeof(__pyx_k_could_not_create_iterator_for_re), 0, 0, 1, 0},
-  {&__pyx_kp_s_could_not_open_file_s, __pyx_k_could_not_open_file_s, sizeof(__pyx_k_could_not_open_file_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_could_not_open_index_for_s, __pyx_k_could_not_open_index_for_s, sizeof(__pyx_k_could_not_open_index_for_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_could_not_open_s_for_reading, __pyx_k_could_not_open_s_for_reading, sizeof(__pyx_k_could_not_open_s_for_reading), 0, 0, 1, 0},
-  {&__pyx_kp_s_could_not_open_s_for_writing, __pyx_k_could_not_open_s_for_writing, sizeof(__pyx_k_could_not_open_s_for_writing), 0, 0, 1, 0},
-  {&__pyx_n_s_cpy, __pyx_k_cpy, sizeof(__pyx_k_cpy), 0, 0, 1, 1},
-  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
-  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
-  {&__pyx_n_s_dup, __pyx_k_dup, sizeof(__pyx_k_dup), 0, 0, 1, 1},
-  {&__pyx_kp_s_empty_iterator, __pyx_k_empty_iterator, sizeof(__pyx_k_empty_iterator), 0, 0, 1, 0},
-  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
-  {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1},
-  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
-  {&__pyx_n_s_end_col, __pyx_k_end_col, sizeof(__pyx_k_end_col), 0, 0, 1, 1},
-  {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
-  {&__pyx_kp_s_error_d_s_d_s, __pyx_k_error_d_s_d_s, sizeof(__pyx_k_error_d_s_d_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_error_when_closing_file_s, __pyx_k_error_when_closing_file_s, sizeof(__pyx_k_error_when_closing_file_s), 0, 0, 1, 0},
-  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
-  {&__pyx_n_s_fd_src, __pyx_k_fd_src, sizeof(__pyx_k_fd_src), 0, 0, 1, 1},
-  {&__pyx_kp_s_file_s_not_found, __pyx_k_file_s_not_found, sizeof(__pyx_k_file_s_not_found), 0, 0, 1, 0},
-  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
-  {&__pyx_n_s_filename_in, __pyx_k_filename_in, sizeof(__pyx_k_filename_in), 0, 0, 1, 1},
-  {&__pyx_n_s_filename_out, __pyx_k_filename_out, sizeof(__pyx_k_filename_out), 0, 0, 1, 1},
-  {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1},
-  {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1},
-  {&__pyx_n_s_fp, __pyx_k_fp, sizeof(__pyx_k_fp), 0, 0, 1, 1},
-  {&__pyx_kp_s_ftp, __pyx_k_ftp, sizeof(__pyx_k_ftp), 0, 0, 1, 0},
-  {&__pyx_n_s_get_encoding, __pyx_k_get_encoding, sizeof(__pyx_k_get_encoding), 0, 0, 1, 1},
-  {&__pyx_n_s_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1},
-  {&__pyx_n_s_gff, __pyx_k_gff, sizeof(__pyx_k_gff), 0, 0, 1, 1},
-  {&__pyx_kp_s_gz, __pyx_k_gz, sizeof(__pyx_k_gz), 0, 0, 1, 0},
-  {&__pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_k_home_andreas_devel_pysam_pysam, sizeof(__pyx_k_home_andreas_devel_pysam_pysam), 0, 0, 1, 0},
-  {&__pyx_kp_s_http, __pyx_k_http, sizeof(__pyx_k_http), 0, 0, 1, 0},
-  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_kp_s_incomplete_line_at_s, __pyx_k_incomplete_line_at_s, sizeof(__pyx_k_incomplete_line_at_s), 0, 0, 1, 0},
-  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
-  {&__pyx_kp_s_index_s_not_found, __pyx_k_index_s_not_found, sizeof(__pyx_k_index_s_not_found), 0, 0, 1, 0},
-  {&__pyx_n_s_infile, __pyx_k_infile, sizeof(__pyx_k_infile), 0, 0, 1, 1},
-  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
-  {&__pyx_kp_s_invalid_file_opening_mode_s, __pyx_k_invalid_file_opening_mode_s, sizeof(__pyx_k_invalid_file_opening_mode_s), 0, 0, 1, 0},
-  {&__pyx_n_s_isOpen, __pyx_k_isOpen, sizeof(__pyx_k_isOpen), 0, 0, 1, 1},
-  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
-  {&__pyx_kp_s_iterate_over_infile_Permits_the, __pyx_k_iterate_over_infile_Permits_the, sizeof(__pyx_k_iterate_over_infile_Permits_the), 0, 0, 1, 0},
-  {&__pyx_kp_s_iteration_on_closed_file, __pyx_k_iteration_on_closed_file, sizeof(__pyx_k_iteration_on_closed_file), 0, 0, 1, 0},
-  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
-  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
-  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
-  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
-  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
-  {&__pyx_n_s_meta_char, __pyx_k_meta_char, sizeof(__pyx_k_meta_char), 0, 0, 1, 1},
-  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
-  {&__pyx_n_s_min_shift, __pyx_k_min_shift, sizeof(__pyx_k_min_shift), 0, 0, 1, 1},
-  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
-  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
-  {&__pyx_n_s_multiple_iterators, __pyx_k_multiple_iterators, sizeof(__pyx_k_multiple_iterators), 0, 0, 1, 1},
-  {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1},
-  {&__pyx_kp_s_neither_preset_nor_seq_col_start, __pyx_k_neither_preset_nor_seq_col_start, sizeof(__pyx_k_neither_preset_nor_seq_col_start), 0, 0, 1, 0},
-  {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
-  {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1},
-  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
-  {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1},
-  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
-  {&__pyx_kp_s_parse_method_of_s_not_implemente, __pyx_k_parse_method_of_s_not_implemente, sizeof(__pyx_k_parse_method_of_s_not_implemente), 0, 0, 1, 0},
-  {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
-  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
-  {&__pyx_n_s_pileup, __pyx_k_pileup, sizeof(__pyx_k_pileup), 0, 0, 1, 1},
-  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
-  {&__pyx_n_s_preset, __pyx_k_preset, sizeof(__pyx_k_preset), 0, 0, 1, 1},
-  {&__pyx_n_s_preset2conf, __pyx_k_preset2conf, sizeof(__pyx_k_preset2conf), 0, 0, 1, 1},
-  {&__pyx_n_s_psltbl, __pyx_k_psltbl, sizeof(__pyx_k_psltbl), 0, 0, 1, 1},
-  {&__pyx_n_s_pysam_ctabix, __pyx_k_pysam_ctabix, sizeof(__pyx_k_pysam_ctabix), 0, 0, 1, 1},
-  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
-  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
-  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
-  {&__pyx_n_s_readline, __pyx_k_readline, sizeof(__pyx_k_readline), 0, 0, 1, 1},
-  {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1},
-  {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1},
-  {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0},
-  {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1},
-  {&__pyx_kp_s_s_i, __pyx_k_s_i, sizeof(__pyx_k_s_i), 0, 0, 1, 0},
-  {&__pyx_kp_s_s_i_i, __pyx_k_s_i_i, sizeof(__pyx_k_s_i_i), 0, 0, 1, 0},
-  {&__pyx_n_s_sam, __pyx_k_sam, sizeof(__pyx_k_sam), 0, 0, 1, 1},
-  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
-  {&__pyx_n_s_seq_col, __pyx_k_seq_col, sizeof(__pyx_k_seq_col), 0, 0, 1, 1},
-  {&__pyx_n_s_set_encoding, __pyx_k_set_encoding, sizeof(__pyx_k_set_encoding), 0, 0, 1, 1},
-  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
-  {&__pyx_n_s_start_col, __pyx_k_start_col, sizeof(__pyx_k_start_col), 0, 0, 1, 1},
-  {&__pyx_kp_s_start_i_end_i, __pyx_k_start_i_end_i, sizeof(__pyx_k_start_i_end_i), 0, 0, 1, 0},
-  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
-  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_compress, __pyx_k_tabix_compress, sizeof(__pyx_k_tabix_compress), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_file_iterator, __pyx_k_tabix_file_iterator, sizeof(__pyx_k_tabix_file_iterator), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_generic_iterator, __pyx_k_tabix_generic_iterator, sizeof(__pyx_k_tabix_generic_iterator), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_generic_iterator___init, __pyx_k_tabix_generic_iterator___init, sizeof(__pyx_k_tabix_generic_iterator___init), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_generic_iterator___iter, __pyx_k_tabix_generic_iterator___iter, sizeof(__pyx_k_tabix_generic_iterator___iter), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_generic_iterator___next, __pyx_k_tabix_generic_iterator___next, sizeof(__pyx_k_tabix_generic_iterator___next), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_generic_iterator_next, __pyx_k_tabix_generic_iterator_next, sizeof(__pyx_k_tabix_generic_iterator_next), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_index, __pyx_k_tabix_index, sizeof(__pyx_k_tabix_index), 0, 0, 1, 1},
-  {&__pyx_n_s_tabix_iterator, __pyx_k_tabix_iterator, sizeof(__pyx_k_tabix_iterator), 0, 0, 1, 1},
-  {&__pyx_kp_s_tbi, __pyx_k_tbi, sizeof(__pyx_k_tbi), 0, 0, 1, 0},
-  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
-  {&__pyx_kp_s_unknown_preset_s_valid_presets_a, __pyx_k_unknown_preset_s_valid_presets_a, sizeof(__pyx_k_unknown_preset_s_valid_presets_a), 0, 0, 1, 0},
-  {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1},
-  {&__pyx_n_s_vcf, __pyx_k_vcf, sizeof(__pyx_k_vcf), 0, 0, 1, 1},
-  {&__pyx_kp_s_writing_failed, __pyx_k_writing_failed, sizeof(__pyx_k_writing_failed), 0, 0, 1, 0},
-  {&__pyx_kp_s_writing_to_file_s_failed, __pyx_k_writing_to_file_s_failed, sizeof(__pyx_k_writing_to_file_s_failed), 0, 0, 1, 0},
-  {&__pyx_n_s_zerobased, __pyx_k_zerobased, sizeof(__pyx_k_zerobased), 0, 0, 1, 1},
-  {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ord = __Pyx_GetBuiltinName(__pyx_n_s_ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __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);
-
-  /* "pysam/ctabix.pyx":297
- * 
- *         filename_index = index or (filename + ".tbi")
- *         self.isremote = filename.startswith("http:") or filename.startswith("ftp:")             # <<<<<<<<<<<<<<
- * 
- *         if not self.isremote:
- */
-  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_http); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple_);
-  __Pyx_GIVEREF(__pyx_tuple_);
-  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_ftp); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__2);
-  __Pyx_GIVEREF(__pyx_tuple__2);
-
-  /* "pysam/ctabix.pyx":366
- *         '''
- *         if not self._isOpen():
- *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- * 
- *         # convert coordinates to region string
- */
-  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__3);
-  __Pyx_GIVEREF(__pyx_tuple__3);
-
-  /* "pysam/ctabix.pyx":437
- *         def __get__(self):
- *             if not self._isOpen():
- *                 raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
- *             return self._filename
- * 
- */
-  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__4);
-  __Pyx_GIVEREF(__pyx_tuple__4);
-
-  /* "pysam/ctabix.pyx":539
- *         cdef int retval = self.__cnext__()
- *         if retval == -5:
- *             raise IOError("iteration on closed file")             # <<<<<<<<<<<<<<
- *         elif retval < 0:
- *             raise StopIteration
- */
-  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_iteration_on_closed_file); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__5);
-  __Pyx_GIVEREF(__pyx_tuple__5);
-
-  /* "pysam/ctabix.pyx":590
- *         cdef int retval = self.__cnext__()
- *         if retval == -5:
- *             raise IOError("iteration on closed file")             # <<<<<<<<<<<<<<
- *         elif retval < 0:
- *             raise StopIteration
- */
-  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_iteration_on_closed_file); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__6);
-  __Pyx_GIVEREF(__pyx_tuple__6);
-
-  /* "pysam/ctabix.pyx":712
- *     fp = bgzf_open( fn, "w")
- *     if fp == NULL:
- *         raise IOError("could not open '%s' for writing")             # <<<<<<<<<<<<<<
- * 
- *     fn = _encodeFilename(filename_in)
- */
-  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_could_not_open_s_for_writing); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__7);
-  __Pyx_GIVEREF(__pyx_tuple__7);
-
-  /* "pysam/ctabix.pyx":717
- *     fd_src = open(fn, O_RDONLY)
- *     if fd_src == 0:
- *         raise IOError("could not open '%s' for reading")             # <<<<<<<<<<<<<<
- * 
- *     buffer = malloc(WINDOW_SIZE)
- */
-  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_could_not_open_s_for_reading); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__8);
-  __Pyx_GIVEREF(__pyx_tuple__8);
-
-  /* "pysam/ctabix.pyx":727
- *         if r < 0:
- *             free(buffer)
- *             raise OSError("writing failed")             # <<<<<<<<<<<<<<
- * 
- *     free(buffer)
- */
-  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_writing_failed); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__9);
-  __Pyx_GIVEREF(__pyx_tuple__9);
-
-  /* "pysam/ctabix.pyx":790
- *     if preset is None and \
- *        (seq_col is None or start_col is None or end_col is None):
- *         raise ValueError(             # <<<<<<<<<<<<<<
- *             "neither preset nor seq_col,start_col and end_col given")
- * 
- */
-  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_neither_preset_nor_seq_col_start); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__11);
-  __Pyx_GIVEREF(__pyx_tuple__11);
-
-  /* "pysam/ctabix.pyx":793
- *             "neither preset nor seq_col,start_col and end_col given")
- * 
- *     if not filename.endswith(".gz"):             # <<<<<<<<<<<<<<
- *         tabix_compress(filename, filename + ".gz", force=force)
- *         os.unlink( filename )
- */
-  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_gz); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__12);
-  __Pyx_GIVEREF(__pyx_tuple__12);
-
-  /* "pysam/ctabix.pyx":799
- * 
- *     if not force and os.path.exists(filename + ".tbi"):
- *         raise IOError(             # <<<<<<<<<<<<<<
- *             "Filename '%s.tbi' already exists, use *force* to overwrite")
- * 
- */
-  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Filename_s_tbi_already_exists_us); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__13);
-  __Pyx_GIVEREF(__pyx_tuple__13);
-
-  /* "pysam/ctabix.pyx":933
- * 
- *         if infile.closed:
- *             raise ValueError("I/O operation on closed file.")             # <<<<<<<<<<<<<<
- * 
- *         self.infile = infile
- */
-  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file_2); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__15);
-  __Pyx_GIVEREF(__pyx_tuple__15);
-
-  /* "pysam/ctabix.pyx":939
- *         cdef int fd = PyObject_AsFileDescriptor(infile)
- *         if fd == -1:
- *             raise ValueError("I/O operation on closed file.")             # <<<<<<<<<<<<<<
- * 
- *         self.duplicated_fd = dup(fd)
- */
-  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file_2); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__16);
-  __Pyx_GIVEREF(__pyx_tuple__16);
-
-  /* "pysam/ctabix.pyx":1015
- *         self.infile = infile
- *         if self.infile.closed:
- *             raise ValueError("I/O operation on closed file.")             # <<<<<<<<<<<<<<
- *         self.parser = parser
- * 
- */
-  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file_2); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__17);
-  __Pyx_GIVEREF(__pyx_tuple__17);
-
-  /* "pysam/ctabix.pyx":1033
- *         # reading is still possible.
- *         if self.infile.closed:
- *             raise ValueError("I/O operation on closed file.")             # <<<<<<<<<<<<<<
- * 
- *         while 1:
- */
-  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file_2); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__18);
-  __Pyx_GIVEREF(__pyx_tuple__18);
-
-  /* "pysam/ctabix.pyx":558
- *     '''empty iterator'''
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__19);
-  __Pyx_GIVEREF(__pyx_tuple__19);
-  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_iter, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":561
- *         return self
- * 
- *     def next(self):             # <<<<<<<<<<<<<<
- *         raise StopIteration()
- * 
- */
-  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__21);
-  __Pyx_GIVEREF(__pyx_tuple__21);
-  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_next_2, 561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":564
- *         raise StopIteration()
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         raise StopIteration()
- * 
- */
-  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__23);
-  __Pyx_GIVEREF(__pyx_tuple__23);
-  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_next, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":685
- * 
- * 
- * def tabix_compress(filename_in,             # <<<<<<<<<<<<<<
- *                    filename_out,
- *                    force=False):
- */
-  __pyx_tuple__25 = PyTuple_Pack(11, __pyx_n_s_filename_in, __pyx_n_s_filename_out, __pyx_n_s_force, __pyx_n_s_WINDOW_SIZE, __pyx_n_s_c, __pyx_n_s_r, __pyx_n_s_buffer, __pyx_n_s_fp, __pyx_n_s_fd_src, __pyx_n_s_O_RDONLY, __pyx_n_s_fn); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__25);
-  __Pyx_GIVEREF(__pyx_tuple__25);
-  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_tabix_compress, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":738
- *         raise OSError("error when closing file %s" % filename_in)
- * 
- * def tabix_index( filename,             # <<<<<<<<<<<<<<
- *                  force = False,
- *                  seq_col = None,
- */
-  __pyx_tuple__27 = PyTuple_Pack(13, __pyx_n_s_filename, __pyx_n_s_force, __pyx_n_s_seq_col, __pyx_n_s_start_col, __pyx_n_s_end_col, __pyx_n_s_preset, __pyx_n_s_meta_char, __pyx_n_s_zerobased, __pyx_n_s_min_shift, __pyx_n_s_preset2conf, __pyx_n_s_conf_data, __pyx_n_s_conf, __pyx_n_s_fn); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__27);
-  __Pyx_GIVEREF(__pyx_tuple__27);
-  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_tabix_index, 738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":1011
- *     Permits the use of file-like objects for example from the gzip module.
- *     '''
- *     def __init__(self, infile, parser):             # <<<<<<<<<<<<<<
- * 
- *         self.infile = infile
- */
-  __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_infile, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__29);
-  __Pyx_GIVEREF(__pyx_tuple__29);
-  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_init, 1011, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":1018
- *         self.parser = parser
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
-  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_iter, 1018, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":1022
- * 
- *     # cython version - required for python 3
- *     def __next__(self):             # <<<<<<<<<<<<<<
- * 
- *         cdef char * b
- */
-  __pyx_tuple__33 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_b, __pyx_n_s_cpy, __pyx_n_s_nbytes, __pyx_n_s_encoding, __pyx_n_s_line, __pyx_n_s_s_2, __pyx_n_s_bytes_cpy); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
-  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_next, 1022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":1066
- * 
- *     # python version - required for python 2.7
- *     def next(self):             # <<<<<<<<<<<<<<
- *         return self.__next__()
- * 
- */
-  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
-  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_next_2, 1066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/ctabix.pyx":1069
- *         return self.__next__()
- * 
- * def tabix_iterator(infile, parser):             # <<<<<<<<<<<<<<
- *     """return an iterator over all entries in a file.
- * 
- */
-  __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_infile, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__37);
-  __Pyx_GIVEREF(__pyx_tuple__37);
-  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_tabix_iterator, 1069, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __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_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_35 = PyInt_FromLong(35); if (unlikely(!__pyx_int_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  return 0;
-  __pyx_L1_error:;
-  return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC initctabix(void); /*proto*/
-PyMODINIT_FUNC initctabix(void)
-#else
-PyMODINIT_FUNC PyInit_ctabix(void); /*proto*/
-PyMODINIT_FUNC PyInit_ctabix(void)
-#endif
-{
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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_ctabix(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("ctabix"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
-  #else
-  __pyx_m = PyModule_Create(&__pyx_moduledef);
-  #endif
-  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_d);
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  if (__pyx_module_is_main_pysam__ctabix) {
-    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;};
-  }
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pysam.ctabix")) {
-      if (unlikely(PyDict_SetItemString(modules, "pysam.ctabix", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  /*--- 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_5pysam_6ctabix__FILENAME_ENCODING = ((PyObject*)Py_None); Py_INCREF(Py_None);
-  /*--- Variable export code ---*/
-  /*--- Function export code ---*/
-  if (__Pyx_ExportFunction("_force_str", (void (*)(void))__pyx_f_5pysam_6ctabix__force_str, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_6ctabix__force_str *__pyx_optional_args)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Type init code ---*/
-  __pyx_vtabptr_5pysam_6ctabix_tabix_file_iterator = &__pyx_vtable_5pysam_6ctabix_tabix_file_iterator;
-  __pyx_vtable_5pysam_6ctabix_tabix_file_iterator.__pyx___cnext__ = (PyObject *(*)(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *))__pyx_f_5pysam_6ctabix_19tabix_file_iterator___cnext__;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_tabix_file_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_tabix_file_iterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_tabix_file_iterator.tp_dict, __pyx_vtabptr_5pysam_6ctabix_tabix_file_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "tabix_file_iterator", (PyObject *)&__pyx_type_5pysam_6ctabix_tabix_file_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_tabix_file_iterator = &__pyx_type_5pysam_6ctabix_tabix_file_iterator;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_TabixFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_TabixFile.tp_print = 0;
-  if (__Pyx_SetAttrString(__pyx_m, "TabixFile", (PyObject *)&__pyx_type_5pysam_6ctabix_TabixFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_TabixFile = &__pyx_type_5pysam_6ctabix_TabixFile;
-  __pyx_vtabptr_5pysam_6ctabix_Parser = &__pyx_vtable_5pysam_6ctabix_Parser;
-  __pyx_vtable_5pysam_6ctabix_Parser.parse = (PyObject *(*)(struct __pyx_obj_5pysam_6ctabix_Parser *, char *, int))__pyx_f_5pysam_6ctabix_6Parser_parse;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_Parser.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_Parser.tp_dict, __pyx_vtabptr_5pysam_6ctabix_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "Parser", (PyObject *)&__pyx_type_5pysam_6ctabix_Parser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_Parser = &__pyx_type_5pysam_6ctabix_Parser;
-  __pyx_vtabptr_5pysam_6ctabix_asTuple = &__pyx_vtable_5pysam_6ctabix_asTuple;
-  __pyx_vtable_5pysam_6ctabix_asTuple.__pyx_base = *__pyx_vtabptr_5pysam_6ctabix_Parser;
-  __pyx_vtable_5pysam_6ctabix_asTuple.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_6ctabix_Parser *, char *, int))__pyx_f_5pysam_6ctabix_7asTuple_parse;
-  __pyx_type_5pysam_6ctabix_asTuple.tp_base = __pyx_ptype_5pysam_6ctabix_Parser;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_asTuple) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_asTuple.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_asTuple.tp_dict, __pyx_vtabptr_5pysam_6ctabix_asTuple) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "asTuple", (PyObject *)&__pyx_type_5pysam_6ctabix_asTuple) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_asTuple = &__pyx_type_5pysam_6ctabix_asTuple;
-  __pyx_vtabptr_5pysam_6ctabix_asGTF = &__pyx_vtable_5pysam_6ctabix_asGTF;
-  __pyx_vtable_5pysam_6ctabix_asGTF.__pyx_base = *__pyx_vtabptr_5pysam_6ctabix_Parser;
-  __pyx_vtable_5pysam_6ctabix_asGTF.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_6ctabix_Parser *, char *, int))__pyx_f_5pysam_6ctabix_5asGTF_parse;
-  __pyx_type_5pysam_6ctabix_asGTF.tp_base = __pyx_ptype_5pysam_6ctabix_Parser;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_asGTF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_asGTF.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_asGTF.tp_dict, __pyx_vtabptr_5pysam_6ctabix_asGTF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "asGTF", (PyObject *)&__pyx_type_5pysam_6ctabix_asGTF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_asGTF = &__pyx_type_5pysam_6ctabix_asGTF;
-  __pyx_vtabptr_5pysam_6ctabix_asBed = &__pyx_vtable_5pysam_6ctabix_asBed;
-  __pyx_vtable_5pysam_6ctabix_asBed.__pyx_base = *__pyx_vtabptr_5pysam_6ctabix_Parser;
-  __pyx_vtable_5pysam_6ctabix_asBed.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_6ctabix_Parser *, char *, int))__pyx_f_5pysam_6ctabix_5asBed_parse;
-  __pyx_type_5pysam_6ctabix_asBed.tp_base = __pyx_ptype_5pysam_6ctabix_Parser;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_asBed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_asBed.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_asBed.tp_dict, __pyx_vtabptr_5pysam_6ctabix_asBed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "asBed", (PyObject *)&__pyx_type_5pysam_6ctabix_asBed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_asBed = &__pyx_type_5pysam_6ctabix_asBed;
-  __pyx_vtabptr_5pysam_6ctabix_asVCF = &__pyx_vtable_5pysam_6ctabix_asVCF;
-  __pyx_vtable_5pysam_6ctabix_asVCF.__pyx_base = *__pyx_vtabptr_5pysam_6ctabix_Parser;
-  __pyx_vtable_5pysam_6ctabix_asVCF.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_6ctabix_Parser *, char *, int))__pyx_f_5pysam_6ctabix_5asVCF_parse;
-  __pyx_type_5pysam_6ctabix_asVCF.tp_base = __pyx_ptype_5pysam_6ctabix_Parser;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_asVCF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_asVCF.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_asVCF.tp_dict, __pyx_vtabptr_5pysam_6ctabix_asVCF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "asVCF", (PyObject *)&__pyx_type_5pysam_6ctabix_asVCF) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_asVCF = &__pyx_type_5pysam_6ctabix_asVCF;
-  __pyx_vtabptr_5pysam_6ctabix_TabixIterator = &__pyx_vtable_5pysam_6ctabix_TabixIterator;
-  __pyx_vtable_5pysam_6ctabix_TabixIterator.__pyx___cnext__ = (int (*)(struct __pyx_obj_5pysam_6ctabix_TabixIterator *))__pyx_f_5pysam_6ctabix_13TabixIterator___cnext__;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_TabixIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_TabixIterator.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_6ctabix_TabixIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_6ctabix_13TabixIterator_4__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_6ctabix_13TabixIterator_4__next__.doc = __pyx_doc_5pysam_6ctabix_13TabixIterator_4__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_6ctabix_13TabixIterator_4__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_TabixIterator.tp_dict, __pyx_vtabptr_5pysam_6ctabix_TabixIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "TabixIterator", (PyObject *)&__pyx_type_5pysam_6ctabix_TabixIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_TabixIterator = &__pyx_type_5pysam_6ctabix_TabixIterator;
-  __pyx_vtabptr_5pysam_6ctabix_TabixIteratorParsed = &__pyx_vtable_5pysam_6ctabix_TabixIteratorParsed;
-  __pyx_vtable_5pysam_6ctabix_TabixIteratorParsed.__pyx_base = *__pyx_vtabptr_5pysam_6ctabix_TabixIterator;
-  __pyx_type_5pysam_6ctabix_TabixIteratorParsed.tp_base = __pyx_ptype_5pysam_6ctabix_TabixIterator;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_TabixIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_TabixIteratorParsed.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_6ctabix_TabixIteratorParsed, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_6ctabix_19TabixIteratorParsed_2__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_6ctabix_19TabixIteratorParsed_2__next__.doc = __pyx_doc_5pysam_6ctabix_19TabixIteratorParsed_2__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_6ctabix_19TabixIteratorParsed_2__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_TabixIteratorParsed.tp_dict, __pyx_vtabptr_5pysam_6ctabix_TabixIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "TabixIteratorParsed", (PyObject *)&__pyx_type_5pysam_6ctabix_TabixIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_TabixIteratorParsed = &__pyx_type_5pysam_6ctabix_TabixIteratorParsed;
-  __pyx_vtabptr_5pysam_6ctabix_GZIterator = &__pyx_vtable_5pysam_6ctabix_GZIterator;
-  __pyx_vtable_5pysam_6ctabix_GZIterator.__pyx___cnext__ = (int (*)(struct __pyx_obj_5pysam_6ctabix_GZIterator *))__pyx_f_5pysam_6ctabix_10GZIterator___cnext__;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_GZIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_GZIterator.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_6ctabix_GZIterator, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_6ctabix_10GZIterator___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_6ctabix_10GZIterator___init__.doc = __pyx_doc_5pysam_6ctabix_10GZIterator___init__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_6ctabix_10GZIterator___init__;
-    }
-  }
-  #endif
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_6ctabix_GZIterator, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_6ctabix_10GZIterator_6__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_6ctabix_10GZIterator_6__next__.doc = __pyx_doc_5pysam_6ctabix_10GZIterator_6__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_6ctabix_10GZIterator_6__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_GZIterator.tp_dict, __pyx_vtabptr_5pysam_6ctabix_GZIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "GZIterator", (PyObject *)&__pyx_type_5pysam_6ctabix_GZIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_GZIterator = &__pyx_type_5pysam_6ctabix_GZIterator;
-  __pyx_vtabptr_5pysam_6ctabix_GZIteratorHead = &__pyx_vtable_5pysam_6ctabix_GZIteratorHead;
-  __pyx_vtable_5pysam_6ctabix_GZIteratorHead.__pyx_base = *__pyx_vtabptr_5pysam_6ctabix_GZIterator;
-  __pyx_type_5pysam_6ctabix_GZIteratorHead.tp_base = __pyx_ptype_5pysam_6ctabix_GZIterator;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_GZIteratorHead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_GZIteratorHead.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_6ctabix_GZIteratorHead, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_6ctabix_14GZIteratorHead___next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_6ctabix_14GZIteratorHead___next__.doc = __pyx_doc_5pysam_6ctabix_14GZIteratorHead___next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_6ctabix_14GZIteratorHead___next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_GZIteratorHead.tp_dict, __pyx_vtabptr_5pysam_6ctabix_GZIteratorHead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "GZIteratorHead", (PyObject *)&__pyx_type_5pysam_6ctabix_GZIteratorHead) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_GZIteratorHead = &__pyx_type_5pysam_6ctabix_GZIteratorHead;
-  __pyx_vtabptr_5pysam_6ctabix_GZIteratorParsed = &__pyx_vtable_5pysam_6ctabix_GZIteratorParsed;
-  __pyx_vtable_5pysam_6ctabix_GZIteratorParsed.__pyx_base = *__pyx_vtabptr_5pysam_6ctabix_GZIterator;
-  __pyx_type_5pysam_6ctabix_GZIteratorParsed.tp_base = __pyx_ptype_5pysam_6ctabix_GZIterator;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_GZIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_GZIteratorParsed.tp_print = 0;
-  #if CYTHON_COMPILING_IN_CPYTHON
-  {
-    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_5pysam_6ctabix_GZIteratorParsed, "__next__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
-      __pyx_wrapperbase_5pysam_6ctabix_16GZIteratorParsed_2__next__ = *((PyWrapperDescrObject *)wrapper)->d_base;
-      __pyx_wrapperbase_5pysam_6ctabix_16GZIteratorParsed_2__next__.doc = __pyx_doc_5pysam_6ctabix_16GZIteratorParsed_2__next__;
-      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5pysam_6ctabix_16GZIteratorParsed_2__next__;
-    }
-  }
-  #endif
-  if (__Pyx_SetVtable(__pyx_type_5pysam_6ctabix_GZIteratorParsed.tp_dict, __pyx_vtabptr_5pysam_6ctabix_GZIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "GZIteratorParsed", (PyObject *)&__pyx_type_5pysam_6ctabix_GZIteratorParsed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_GZIteratorParsed = &__pyx_type_5pysam_6ctabix_GZIteratorParsed;
-  __pyx_type_5pysam_6ctabix_Tabixfile.tp_base = __pyx_ptype_5pysam_6ctabix_TabixFile;
-  if (PyType_Ready(&__pyx_type_5pysam_6ctabix_Tabixfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_6ctabix_Tabixfile.tp_print = 0;
-  if (__Pyx_SetAttrString(__pyx_m, "Tabixfile", (PyObject *)&__pyx_type_5pysam_6ctabix_Tabixfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_Tabixfile = &__pyx_type_5pysam_6ctabix_Tabixfile;
-  /*--- Type import code ---*/
-  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
-  #if CYTHON_COMPILING_IN_PYPY
-  sizeof(PyTypeObject),
-  #else
-  sizeof(PyHeapTypeObject),
-  #endif
-  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_TupleProxy = __Pyx_ImportType("pysam.TabProxies", "TupleProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_TupleProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_TupleProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_TupleProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_TupleProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_GTFProxy = __Pyx_ImportType("pysam.TabProxies", "GTFProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_GTFProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_GTFProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_GTFProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_GTFProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_GTFProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_NamedTupleProxy = __Pyx_ImportType("pysam.TabProxies", "NamedTupleProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_BedProxy = __Pyx_ImportType("pysam.TabProxies", "BedProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_BedProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_BedProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_BedProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_BedProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_BedProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_VCFProxy = __Pyx_ImportType("pysam.TabProxies", "VCFProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_VCFProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_VCFProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_VCFProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_VCFProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_VCFProxy)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Variable import code ---*/
-  /*--- Function import code ---*/
-  /*--- Execution code ---*/
-
-  /* "pysam/ctabix.pyx":3
- * # cython: embedsignature=True
- * # adds doc-strings for sphinx
- * import os             # <<<<<<<<<<<<<<
- * import sys
- * 
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":4
- * # adds doc-strings for sphinx
- * import os
- * import sys             # <<<<<<<<<<<<<<
- * 
- * from libc.stdio cimport printf, fprintf, stderr
- */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":26
- *     tbx_destroy, gzopen, gzclose, gzerror, gzdopen
- * 
- * PYTHON3 = PY_MAJOR_VERSION >= 3             # <<<<<<<<<<<<<<
- * 
- * # filename encoding (copied from lxml.etree.pyx)
- */
-  __pyx_t_1 = __Pyx_PyBool_FromLong((PY_MAJOR_VERSION >= 3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYTHON3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":30
- * # filename encoding (copied from lxml.etree.pyx)
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_XGOTREF(__pyx_v_5pysam_6ctabix__FILENAME_ENCODING);
-  __Pyx_DECREF_SET(__pyx_v_5pysam_6ctabix__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":31
- * cdef str _FILENAME_ENCODING
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- */
-  __pyx_t_3 = (__pyx_v_5pysam_6ctabix__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_4 = (__pyx_t_3 != 0);
-  if (__pyx_t_4) {
-
-    /* "pysam/ctabix.pyx":32
- * _FILENAME_ENCODING = sys.getfilesystemencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()             # <<<<<<<<<<<<<<
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getdefaultencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_XGOTREF(__pyx_v_5pysam_6ctabix__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_6ctabix__FILENAME_ENCODING, ((PyObject*)__pyx_t_1));
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L2;
-  }
-  __pyx_L2:;
-
-  /* "pysam/ctabix.pyx":33
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
- *     _FILENAME_ENCODING = 'ascii'
- * 
- */
-  __pyx_t_4 = (__pyx_v_5pysam_6ctabix__FILENAME_ENCODING == ((PyObject*)Py_None));
-  __pyx_t_3 = (__pyx_t_4 != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/ctabix.pyx":34
- *     _FILENAME_ENCODING = sys.getdefaultencoding()
- * if _FILENAME_ENCODING is None:
- *     _FILENAME_ENCODING = 'ascii'             # <<<<<<<<<<<<<<
- * 
- * #cdef char* _C_FILENAME_ENCODING
- */
-    __Pyx_INCREF(__pyx_n_s_ascii);
-    __Pyx_XGOTREF(__pyx_v_5pysam_6ctabix__FILENAME_ENCODING);
-    __Pyx_DECREF_SET(__pyx_v_5pysam_6ctabix__FILENAME_ENCODING, __pyx_n_s_ascii);
-    __Pyx_GIVEREF(__pyx_n_s_ascii);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/ctabix.pyx":555
- * 
- * 
- * class EmptyIterator:             # <<<<<<<<<<<<<<
- *     '''empty iterator'''
- * 
- */
-  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_EmptyIterator, __pyx_n_s_EmptyIterator, (PyObject *) NULL, __pyx_n_s_pysam_ctabix, __pyx_kp_s_empty_iterator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/ctabix.pyx":558
- *     '''empty iterator'''
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_13EmptyIterator_1__iter__, 0, __pyx_n_s_EmptyIterator___iter, NULL, __pyx_n_s_pysam_ctabix, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_iter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":561
- *         return self
- * 
- *     def next(self):             # <<<<<<<<<<<<<<
- *         raise StopIteration()
- * 
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_13EmptyIterator_3next, 0, __pyx_n_s_EmptyIterator_next, NULL, __pyx_n_s_pysam_ctabix, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_next_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":564
- *         raise StopIteration()
- * 
- *     def __next__(self):             # <<<<<<<<<<<<<<
- *         raise StopIteration()
- * 
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_13EmptyIterator_5__next__, 0, __pyx_n_s_EmptyIterator___next, NULL, __pyx_n_s_pysam_ctabix, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_next, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":555
- * 
- * 
- * class EmptyIterator:             # <<<<<<<<<<<<<<
- *     '''empty iterator'''
- * 
- */
-  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_EmptyIterator, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EmptyIterator, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":685
- * 
- * 
- * def tabix_compress(filename_in,             # <<<<<<<<<<<<<<
- *                    filename_out,
- *                    force=False):
- */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_1tabix_compress, NULL, __pyx_n_s_pysam_ctabix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tabix_compress, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":738
- *         raise OSError("error when closing file %s" % filename_in)
- * 
- * def tabix_index( filename,             # <<<<<<<<<<<<<<
- *                  force = False,
- *                  seq_col = None,
- */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_3tabix_index, NULL, __pyx_n_s_pysam_ctabix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tabix_index, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":1006
- * 
- * 
- * class tabix_generic_iterator:             # <<<<<<<<<<<<<<
- *     '''iterate over ``infile``.
- * 
- */
-  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_tabix_generic_iterator, __pyx_n_s_tabix_generic_iterator, (PyObject *) NULL, __pyx_n_s_pysam_ctabix, __pyx_kp_s_iterate_over_infile_Permits_the); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-
-  /* "pysam/ctabix.pyx":1011
- *     Permits the use of file-like objects for example from the gzip module.
- *     '''
- *     def __init__(self, infile, parser):             # <<<<<<<<<<<<<<
- * 
- *         self.infile = infile
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_22tabix_generic_iterator_1__init__, 0, __pyx_n_s_tabix_generic_iterator___init, NULL, __pyx_n_s_pysam_ctabix, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":1018
- *         self.parser = parser
- * 
- *     def __iter__(self):             # <<<<<<<<<<<<<<
- *         return self
- * 
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_22tabix_generic_iterator_3__iter__, 0, __pyx_n_s_tabix_generic_iterator___iter, NULL, __pyx_n_s_pysam_ctabix, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_iter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":1022
- * 
- *     # cython version - required for python 3
- *     def __next__(self):             # <<<<<<<<<<<<<<
- * 
- *         cdef char * b
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_22tabix_generic_iterator_5__next__, 0, __pyx_n_s_tabix_generic_iterator___next, NULL, __pyx_n_s_pysam_ctabix, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_next, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":1066
- * 
- *     # python version - required for python 2.7
- *     def next(self):             # <<<<<<<<<<<<<<
- *         return self.__next__()
- * 
- */
-  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_22tabix_generic_iterator_7next, 0, __pyx_n_s_tabix_generic_iterator_next, NULL, __pyx_n_s_pysam_ctabix, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_next_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/ctabix.pyx":1006
- * 
- * 
- * class tabix_generic_iterator:             # <<<<<<<<<<<<<<
- *     '''iterate over ``infile``.
- * 
- */
-  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_tabix_generic_iterator, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tabix_generic_iterator, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":1069
- *         return self.__next__()
- * 
- * def tabix_iterator(infile, parser):             # <<<<<<<<<<<<<<
- *     """return an iterator over all entries in a file.
- * 
- */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5pysam_6ctabix_5tabix_iterator, NULL, __pyx_n_s_pysam_ctabix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tabix_iterator, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":1101
- * 
- * 
- * __all__ = [             # <<<<<<<<<<<<<<
- *     "tabix_index",
- *     "tabix_compress",
- */
-  __pyx_t_1 = PyList_New(13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_n_s_tabix_index);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_tabix_index);
-  __Pyx_GIVEREF(__pyx_n_s_tabix_index);
-  __Pyx_INCREF(__pyx_n_s_tabix_compress);
-  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_tabix_compress);
-  __Pyx_GIVEREF(__pyx_n_s_tabix_compress);
-  __Pyx_INCREF(__pyx_n_s_TabixFile);
-  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_TabixFile);
-  __Pyx_GIVEREF(__pyx_n_s_TabixFile);
-  __Pyx_INCREF(__pyx_n_s_Tabixfile);
-  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_Tabixfile);
-  __Pyx_GIVEREF(__pyx_n_s_Tabixfile);
-  __Pyx_INCREF(__pyx_n_s_asTuple);
-  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_asTuple);
-  __Pyx_GIVEREF(__pyx_n_s_asTuple);
-  __Pyx_INCREF(__pyx_n_s_asGTF);
-  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_asGTF);
-  __Pyx_GIVEREF(__pyx_n_s_asGTF);
-  __Pyx_INCREF(__pyx_n_s_asVCF);
-  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_asVCF);
-  __Pyx_GIVEREF(__pyx_n_s_asVCF);
-  __Pyx_INCREF(__pyx_n_s_asBed);
-  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_asBed);
-  __Pyx_GIVEREF(__pyx_n_s_asBed);
-  __Pyx_INCREF(__pyx_n_s_GZIterator);
-  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_GZIterator);
-  __Pyx_GIVEREF(__pyx_n_s_GZIterator);
-  __Pyx_INCREF(__pyx_n_s_GZIteratorHead);
-  PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_GZIteratorHead);
-  __Pyx_GIVEREF(__pyx_n_s_GZIteratorHead);
-  __Pyx_INCREF(__pyx_n_s_tabix_iterator);
-  PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_tabix_iterator);
-  __Pyx_GIVEREF(__pyx_n_s_tabix_iterator);
-  __Pyx_INCREF(__pyx_n_s_tabix_generic_iterator);
-  PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_s_tabix_generic_iterator);
-  __Pyx_GIVEREF(__pyx_n_s_tabix_generic_iterator);
-  __Pyx_INCREF(__pyx_n_s_tabix_file_iterator);
-  PyList_SET_ITEM(__pyx_t_1, 12, __pyx_n_s_tabix_file_iterator);
-  __Pyx_GIVEREF(__pyx_n_s_tabix_file_iterator);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/ctabix.pyx":1
- * # cython: embedsignature=True             # <<<<<<<<<<<<<<
- * # adds doc-strings for sphinx
- * import os
- */
-  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  if (__pyx_m) {
-    __Pyx_AddTraceback("init pysam.ctabix", __pyx_clineno, __pyx_lineno, __pyx_filename);
-    Py_DECREF(__pyx_m); __pyx_m = 0;
-  } else if (!PyErr_Occurred()) {
-    PyErr_SetString(PyExc_ImportError, "init pysam.ctabix");
-  }
-  __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_GetBuiltinName(PyObject *name) {
-    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
-    if (unlikely(!result)) {
-        PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
-            "name '%U' is not defined", name);
-#else
-            "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
-    }
-    return result;
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyObject *result;
-    ternaryfunc call = func->ob_type->tp_call;
-    if (unlikely(!call))
-        return PyObject_Call(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
-        return NULL;
-#endif
-    result = (*call)(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    Py_LeaveRecursiveCall();
-#endif
-    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
-        PyErr_SetString(
-            PyExc_SystemError,
-            "NULL result without error in PyObject_Call");
-    }
-    return result;
-}
-#endif
-
-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);
-    if (!value || value == Py_None)
-        value = NULL;
-    else
-        Py_INCREF(value);
-    if (!tb || tb == Py_None)
-        tb = NULL;
-    else {
-        Py_INCREF(tb);
-        if (!PyTraceBack_Check(tb)) {
-            PyErr_SetString(PyExc_TypeError,
-                "raise: arg 3 must be a traceback or None");
-            goto raise_error;
-        }
-    }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
-    if (PyType_Check(type)) {
-    #endif
-#if CYTHON_COMPILING_IN_PYPY
-        if (!value) {
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-#endif
-        PyErr_NormalizeException(&type, &value, &tb);
-    } else {
-        if (value) {
-            PyErr_SetString(PyExc_TypeError,
-                "instance exception may not have a separate value");
-            goto raise_error;
-        }
-        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) {
-    PyObject* owned_instance = NULL;
-    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)) {
-        PyObject *instance_class = NULL;
-        if (value && PyExceptionInstance_Check(value)) {
-            instance_class = (PyObject*) Py_TYPE(value);
-            if (instance_class != type) {
-                if (PyObject_IsSubclass(instance_class, type)) {
-                    type = instance_class;
-                } else {
-                    instance_class = NULL;
-                }
-            }
-        }
-        if (!instance_class) {
-            PyObject *args;
-            if (!value)
-                args = PyTuple_New(0);
-            else if (PyTuple_Check(value)) {
-                Py_INCREF(value);
-                args = value;
-            } else
-                args = PyTuple_Pack(1, value);
-            if (!args)
-                goto bad;
-            owned_instance = PyObject_Call(type, args, NULL);
-            Py_DECREF(args);
-            if (!owned_instance)
-                goto bad;
-            value = owned_instance;
-            if (!PyExceptionInstance_Check(value)) {
-                PyErr_Format(PyExc_TypeError,
-                             "calling %R should have returned an instance of "
-                             "BaseException, not %R",
-                             type, Py_TYPE(value));
-                goto bad;
-            }
-        }
-    } else {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: exception class must be a subclass of BaseException");
-        goto bad;
-    }
-#if PY_VERSION_HEX >= 0x03030000
-    if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
-        PyObject *fixed_cause;
-        if (cause == Py_None) {
-            fixed_cause = NULL;
-        } else 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;
-        }
-        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:
-    Py_XDECREF(owned_instance);
-    return;
-}
-#endif
-
-static void __Pyx_RaiseDoubleKeywordsError(
-    const char* func_name,
-    PyObject* kw_name)
-{
-    PyErr_Format(PyExc_TypeError,
-        #if PY_MAJOR_VERSION >= 3
-        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
-        #else
-        "%s() got multiple values for keyword argument '%s'", func_name,
-        PyString_AsString(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;
-            continue;
-        }
-        name = first_kw_arg;
-        #if PY_MAJOR_VERSION < 3
-        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
-            while (*name) {
-                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
-                        && _PyString_Eq(**name, key)) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    if ((**argname == key) || (
-                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
-                             && _PyString_Eq(**argname, key))) {
-                        goto arg_passed_twice;
-                    }
-                    argname++;
-                }
-            }
-        } else
-        #endif
-        if (likely(PyUnicode_Check(key))) {
-            while (*name) {
-                int cmp = (**name == key) ? 0 :
-                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
-                #endif
-                    PyUnicode_Compare(**name, key);
-                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                if (cmp == 0) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    int cmp = (**argname == key) ? 0 :
-                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
-                    #endif
-                        PyUnicode_Compare(**argname, key);
-                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                    if (cmp == 0) goto arg_passed_twice;
-                    argname++;
-                }
-            }
-        } else
-            goto invalid_keyword_type;
-        if (kwds2) {
-            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
-        } else {
-            goto invalid_keyword;
-        }
-    }
-    return 0;
-arg_passed_twice:
-    __Pyx_RaiseDoubleKeywordsError(function_name, key);
-    goto bad;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    goto bad;
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-bad:
-    return -1;
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
-    const char* func_name,
-    int exact,
-    Py_ssize_t num_min,
-    Py_ssize_t num_max,
-    Py_ssize_t num_found)
-{
-    Py_ssize_t num_expected;
-    const char *more_or_less;
-    if (num_found < num_min) {
-        num_expected = num_min;
-        more_or_less = "at least";
-    } else {
-        num_expected = num_max;
-        more_or_less = "at most";
-    }
-    if (exact) {
-        more_or_less = "exactly";
-    }
-    PyErr_Format(PyExc_TypeError,
-                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
-                 func_name, more_or_less, num_expected,
-                 (num_expected == 1) ? "" : "s", num_found);
-}
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
-    if (unlikely(!type)) {
-        PyErr_SetString(PyExc_SystemError, "Missing type object");
-        return 0;
-    }
-    if (likely(PyObject_TypeCheck(obj, type)))
-        return 1;
-    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
-                 Py_TYPE(obj)->tp_name, type->tp_name);
-    return 0;
-}
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-    if (s1 == s2) {
-        return (equals == Py_EQ);
-    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
-        const char *ps1, *ps2;
-        Py_ssize_t length = PyBytes_GET_SIZE(s1);
-        if (length != PyBytes_GET_SIZE(s2))
-            return (equals == Py_NE);
-        ps1 = PyBytes_AS_STRING(s1);
-        ps2 = PyBytes_AS_STRING(s2);
-        if (ps1[0] != ps2[0]) {
-            return (equals == Py_NE);
-        } else if (length == 1) {
-            return (equals == Py_EQ);
-        } else {
-            int result = memcmp(ps1, ps2, (size_t)length);
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
-        return (equals == Py_NE);
-    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
-        return (equals == Py_NE);
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-#endif
-}
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-#if PY_MAJOR_VERSION < 3
-    PyObject* owned_ref = NULL;
-#endif
-    int s1_is_unicode, s2_is_unicode;
-    if (s1 == s2) {
-        goto return_eq;
-    }
-    s1_is_unicode = PyUnicode_CheckExact(s1);
-    s2_is_unicode = PyUnicode_CheckExact(s2);
-#if PY_MAJOR_VERSION < 3
-    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
-        owned_ref = PyUnicode_FromObject(s2);
-        if (unlikely(!owned_ref))
-            return -1;
-        s2 = owned_ref;
-        s2_is_unicode = 1;
-    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
-        owned_ref = PyUnicode_FromObject(s1);
-        if (unlikely(!owned_ref))
-            return -1;
-        s1 = owned_ref;
-        s1_is_unicode = 1;
-    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
-        return __Pyx_PyBytes_Equals(s1, s2, equals);
-    }
-#endif
-    if (s1_is_unicode & s2_is_unicode) {
-        Py_ssize_t length;
-        int kind;
-        void *data1, *data2;
-        #if CYTHON_PEP393_ENABLED
-        if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
-            return -1;
-        #endif
-        length = __Pyx_PyUnicode_GET_LENGTH(s1);
-        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
-            goto return_ne;
-        }
-        kind = __Pyx_PyUnicode_KIND(s1);
-        if (kind != __Pyx_PyUnicode_KIND(s2)) {
-            goto return_ne;
-        }
-        data1 = __Pyx_PyUnicode_DATA(s1);
-        data2 = __Pyx_PyUnicode_DATA(s2);
-        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
-            goto return_ne;
-        } else if (length == 1) {
-            goto return_eq;
-        } else {
-            int result = memcmp(data1, data2, length * kind);
-            #if PY_MAJOR_VERSION < 3
-            Py_XDECREF(owned_ref);
-            #endif
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & s2_is_unicode) {
-        goto return_ne;
-    } else if ((s2 == Py_None) & s1_is_unicode) {
-        goto return_ne;
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-return_eq:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_EQ);
-return_ne:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_NE);
-#endif
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
-    PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
-    result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
-        Py_INCREF(result);
-    } else {
-#else
-    result = PyObject_GetItem(__pyx_d, name);
-    if (!result) {
-        PyErr_Clear();
-#endif
-        result = __Pyx_GetBuiltinName(name);
-    }
-    return result;
-}
-
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
-    PyErr_Format(PyExc_TypeError,
-        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
-        name, type->tp_name, Py_TYPE(obj)->tp_name);
-}
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
-    const char *name, int exact)
-{
-    if (unlikely(!type)) {
-        PyErr_SetString(PyExc_SystemError, "Missing type object");
-        return 0;
-    }
-    if (none_allowed && obj == Py_None) return 1;
-    else if (exact) {
-        if (likely(Py_TYPE(obj) == type)) return 1;
-        #if PY_MAJOR_VERSION == 2
-        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
-        #endif
-    }
-    else {
-        if (likely(PyObject_TypeCheck(obj, type))) return 1;
-    }
-    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
-    return 0;
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    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);
-#else
-    PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(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->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);
-#else
-    PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
-    PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
-    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (unlikely(tstate->curexc_type))
-#else
-    if (unlikely(PyErr_Occurred()))
-#endif
-        goto bad;
-    #if PY_MAJOR_VERSION >= 3
-    if (local_tb) {
-        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
-            goto bad;
-    }
-    #endif
-    Py_XINCREF(local_tb);
-    Py_XINCREF(local_type);
-    Py_XINCREF(local_value);
-    *type = local_type;
-    *value = local_value;
-    *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-    Py_XDECREF(tmp_type);
-    Py_XDECREF(tmp_value);
-    Py_XDECREF(tmp_tb);
-#else
-    PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
-    return 0;
-bad:
-    *type = 0;
-    *value = 0;
-    *tb = 0;
-    Py_XDECREF(local_type);
-    Py_XDECREF(local_value);
-    Py_XDECREF(local_tb);
-    return -1;
-}
-
-#if !CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
-    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL)
-}
-#endif
-
-static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
-    if (PY_MAJOR_VERSION >= 3)
-        return __Pyx_PyObject_CallMethod1((PyObject*)&PyDict_Type, __pyx_n_s_keys, d);
-    else
-        return PyDict_Keys(d);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
-    PyErr_Format(PyExc_ValueError,
-                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
-    PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
-                 index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyThreadState *tstate = PyThreadState_GET();
-    PyObject* exc_type = tstate->curexc_type;
-    if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
-            PyObject *exc_value, *exc_tb;
-            exc_value = tstate->curexc_value;
-            exc_tb = tstate->curexc_traceback;
-            tstate->curexc_type = 0;
-            tstate->curexc_value = 0;
-            tstate->curexc_traceback = 0;
-            Py_DECREF(exc_type);
-            Py_XDECREF(exc_value);
-            Py_XDECREF(exc_tb);
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#endif
-}
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
-    if (unlikely(retval)) {
-        Py_DECREF(retval);
-        __Pyx_RaiseTooManyValuesError(expected);
-        return -1;
-    } else {
-        return __Pyx_IterFinish();
-    }
-    return 0;
-}
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
-    PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
-    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
-    if (!ob)
-        goto bad;
-    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
-        goto bad;
-    Py_DECREF(ob);
-    return 0;
-bad:
-    Py_XDECREF(ob);
-    return -1;
-}
-
-static void* __Pyx_GetVtable(PyObject *dict) {
-    void* ptr;
-    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_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;
-}
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
-    PyObject* fake_module;
-    PyTypeObject* cached_type = NULL;
-    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
-    if (!fake_module) return NULL;
-    Py_INCREF(fake_module);
-    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
-    if (cached_type) {
-        if (!PyType_Check((PyObject*)cached_type)) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s is not a type object",
-                type->tp_name);
-            goto bad;
-        }
-        if (cached_type->tp_basicsize != type->tp_basicsize) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s has the wrong size, try recompiling",
-                type->tp_name);
-            goto bad;
-        }
-    } else {
-        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
-        PyErr_Clear();
-        if (PyType_Ready(type) < 0) goto bad;
-        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
-            goto bad;
-        Py_INCREF(type);
-        cached_type = type;
-    }
-done:
-    Py_DECREF(fake_module);
-    return cached_type;
-bad:
-    Py_XDECREF(cached_type);
-    cached_type = NULL;
-    goto done;
-}
-
-static PyObject *
-__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
-{
-    if (unlikely(op->func_doc == NULL)) {
-        if (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 (unlikely(op->func_doc == NULL))
-                return NULL;
-        } else {
-            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)
-        value = Py_None; /* Mark as deleted */
-    Py_INCREF(value);
-    op->func_doc = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
-{
-    if (unlikely(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
-        if (unlikely(op->func_name == NULL))
-            return NULL;
-    }
-    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 (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
-    if (unlikely(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_qualname(__pyx_CyFunctionObject *op)
-{
-    Py_INCREF(op->func_qualname);
-    return op->func_qualname;
-}
-static int
-__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
-{
-    PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
-    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
-    if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
-        PyErr_SetString(PyExc_TypeError,
-                        "__qualname__ must be set to a string object");
-        return -1;
-    }
-    tmp = op->func_qualname;
-    Py_INCREF(value);
-    op->func_qualname = 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 (unlikely(op->func_dict == NULL)) {
-        op->func_dict = PyDict_New();
-        if (unlikely(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 (unlikely(value == NULL)) {
-        PyErr_SetString(PyExc_TypeError,
-               "function's dictionary may not be deleted");
-        return -1;
-    }
-    if (unlikely(!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(__pyx_CyFunctionObject *op)
-{
-    Py_INCREF(op->func_globals);
-    return op->func_globals;
-}
-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 int
-__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
-    PyObject *res = op->defaults_getter((PyObject *) op);
-    if (unlikely(!res))
-        return -1;
-    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
-    Py_INCREF(op->defaults_tuple);
-    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
-    Py_INCREF(op->defaults_kwdict);
-    Py_DECREF(res);
-    return 0;
-}
-static int
-__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value) {
-        value = Py_None;
-    } else if (value != Py_None && !PyTuple_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__defaults__ must be set to a tuple object");
-        return -1;
-    }
-    Py_INCREF(value);
-    tmp = op->defaults_tuple;
-    op->defaults_tuple = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->defaults_tuple;
-    if (unlikely(!result)) {
-        if (op->defaults_getter) {
-            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
-            result = op->defaults_tuple;
-        } else {
-            result = Py_None;
-        }
-    }
-    Py_INCREF(result);
-    return result;
-}
-static int
-__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value) {
-        value = Py_None;
-    } else if (value != Py_None && !PyDict_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__kwdefaults__ must be set to a dict object");
-        return -1;
-    }
-    Py_INCREF(value);
-    tmp = op->defaults_kwdict;
-    op->defaults_kwdict = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->defaults_kwdict;
-    if (unlikely(!result)) {
-        if (op->defaults_getter) {
-            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
-            result = op->defaults_kwdict;
-        } else {
-            result = Py_None;
-        }
-    }
-    Py_INCREF(result);
-    return result;
-}
-static int
-__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value || value == Py_None) {
-        value = NULL;
-    } else if (!PyDict_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__annotations__ must be set to a dict object");
-        return -1;
-    }
-    Py_XINCREF(value);
-    tmp = op->func_annotations;
-    op->func_annotations = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->func_annotations;
-    if (unlikely(!result)) {
-        result = PyDict_New();
-        if (unlikely(!result)) return NULL;
-        op->func_annotations = result;
-    }
-    Py_INCREF(result);
-    return result;
-}
-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 *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 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, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
-    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
-    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
-    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 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* qualname,
-                                      PyObject *closure, PyObject *module, PyObject* globals, 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;
-    Py_INCREF(qualname);
-    op->func_qualname = qualname;
-    op->func_doc = NULL;
-    op->func_classobj = NULL;
-    op->func_globals = globals;
-    Py_INCREF(op->func_globals);
-    Py_XINCREF(code);
-    op->func_code = code;
-    op->defaults_pyobjects = 0;
-    op->defaults = NULL;
-    op->defaults_tuple = NULL;
-    op->defaults_kwdict = NULL;
-    op->defaults_getter = NULL;
-    op->func_annotations = 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_qualname);
-    Py_CLEAR(m->func_doc);
-    Py_CLEAR(m->func_globals);
-    Py_CLEAR(m->func_code);
-    Py_CLEAR(m->func_classobj);
-    Py_CLEAR(m->defaults_tuple);
-    Py_CLEAR(m->defaults_kwdict);
-    Py_CLEAR(m->func_annotations);
-    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_qualname);
-    Py_VISIT(m->func_doc);
-    Py_VISIT(m->func_globals);
-    Py_VISIT(m->func_code);
-    Py_VISIT(m->func_classobj);
-    Py_VISIT(m->defaults_tuple);
-    Py_VISIT(m->defaults_kwdict);
-    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)
-{
-#if PY_MAJOR_VERSION >= 3
-    return PyUnicode_FromFormat("<cyfunction %U at %p>",
-                                op->func_qualname, (void *)op);
-#else
-    return PyString_FromFormat("<cyfunction %s at %p>",
-                               PyString_AsString(op->func_qualname), (void *)op);
-#endif
-}
-#if CYTHON_COMPILING_IN_PYPY
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyCFunctionObject* f = (PyCFunctionObject*)func;
-    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
-    PyObject *self = PyCFunction_GET_SELF(func);
-    Py_ssize_t size;
-    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
-    case METH_VARARGS:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
-            return (*meth)(self, arg);
-        break;
-    case METH_VARARGS | METH_KEYWORDS:
-        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
-    case METH_NOARGS:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
-            size = PyTuple_GET_SIZE(arg);
-            if (size == 0)
-                return (*meth)(self, NULL);
-            PyErr_Format(PyExc_TypeError,
-                "%.200s() takes no arguments (%zd given)",
-                f->m_ml->ml_name, size);
-            return NULL;
-        }
-        break;
-    case METH_O:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
-            size = PyTuple_GET_SIZE(arg);
-            if (size == 1)
-                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
-            PyErr_Format(PyExc_TypeError,
-                "%.200s() takes exactly one argument (%zd given)",
-                f->m_ml->ml_name, size);
-            return NULL;
-        }
-        break;
-    default:
-        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
-                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
-                        "longer supported!");
-        return NULL;
-    }
-    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
-                 f->m_ml->ml_name);
-    return NULL;
-}
-#else
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-	return PyCFunction_Call(func, arg, kw);
-}
-#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_CyFunction_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
-#if PY_VERSION_HEX >= 0x030400a1
-    0,                                  /*tp_finalize*/
-#endif
-};
-static int __Pyx_CyFunction_init(void) {
-#if !CYTHON_COMPILING_IN_PYPY
-    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
-#endif
-    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
-        return -1;
-    }
-    return 0;
-}
-static CYTHON_INLINE 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, size);
-    m->defaults_pyobjects = pyobjects;
-    return m->defaults;
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->defaults_tuple = tuple;
-    Py_INCREF(tuple);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->defaults_kwdict = dict;
-    Py_INCREF(dict);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->func_annotations = dict;
-    Py_INCREF(dict);
-}
-
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
-    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
-    for (i=0; i < nbases; i++) {
-        PyTypeObject *tmptype;
-        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
-        tmptype = Py_TYPE(tmp);
-#if PY_MAJOR_VERSION < 3
-        if (tmptype == &PyClass_Type)
-            continue;
-#endif
-        if (!metaclass) {
-            metaclass = tmptype;
-            continue;
-        }
-        if (PyType_IsSubtype(metaclass, tmptype))
-            continue;
-        if (PyType_IsSubtype(tmptype, metaclass)) {
-            metaclass = tmptype;
-            continue;
-        }
-        PyErr_SetString(PyExc_TypeError,
-                        "metaclass conflict: "
-                        "the metaclass of a derived class "
-                        "must be a (non-strict) subclass "
-                        "of the metaclasses of all its bases");
-        return NULL;
-    }
-    if (!metaclass) {
-#if PY_MAJOR_VERSION < 3
-        metaclass = &PyClass_Type;
-#else
-        metaclass = &PyType_Type;
-#endif
-    }
-    Py_INCREF((PyObject*) metaclass);
-    return (PyObject*) metaclass;
-}
-
-static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
-                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
-    PyObject *ns;
-    if (metaclass) {
-        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
-        if (prep) {
-            PyObject *pargs = PyTuple_Pack(2, name, bases);
-            if (unlikely(!pargs)) {
-                Py_DECREF(prep);
-                return NULL;
-            }
-            ns = PyObject_Call(prep, pargs, mkw);
-            Py_DECREF(prep);
-            Py_DECREF(pargs);
-        } else {
-            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
-                return NULL;
-            PyErr_Clear();
-            ns = PyDict_New();
-        }
-    } else {
-        ns = PyDict_New();
-    }
-    if (unlikely(!ns))
-        return NULL;
-    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
-    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
-    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
-    return ns;
-bad:
-    Py_DECREF(ns);
-    return NULL;
-}
-static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
-                                      PyObject *dict, PyObject *mkw,
-                                      int calculate_metaclass, int allow_py2_metaclass) {
-    PyObject *result, *margs;
-    PyObject *owned_metaclass = NULL;
-    if (allow_py2_metaclass) {
-        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
-        if (owned_metaclass) {
-            metaclass = owned_metaclass;
-        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
-            PyErr_Clear();
-        } else {
-            return NULL;
-        }
-    }
-    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
-        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
-        Py_XDECREF(owned_metaclass);
-        if (unlikely(!metaclass))
-            return NULL;
-        owned_metaclass = metaclass;
-    }
-    margs = PyTuple_Pack(3, name, bases, dict);
-    if (unlikely(!margs)) {
-        result = NULL;
-    } else {
-        result = PyObject_Call(metaclass, margs, mkw);
-        Py_DECREF(margs);
-    }
-    Py_XDECREF(owned_metaclass);
-    return result;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
-    PyObject *empty_list = 0;
-    PyObject *module = 0;
-    PyObject *global_dict = 0;
-    PyObject *empty_dict = 0;
-    PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
-    PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
-    if (!py_import)
-        goto bad;
-    #endif
-    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, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                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);
-                #else
-                module = PyImport_ImportModuleLevelObject(
-                    name, global_dict, empty_dict, list, 1);
-                #endif
-                if (!module) {
-                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
-                        goto bad;
-                    PyErr_Clear();
-                }
-            }
-            level = 0; /* try absolute import on failure */
-        }
-        #endif
-        if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
-            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
-            module = PyImport_ImportModuleLevelObject(
-                name, global_dict, empty_dict, list, level);
-            #endif
-        }
-    }
-    #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:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
-}
-
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
-    {                                                                     \
-        func_type value = func(x);                                        \
-        if (sizeof(target_type) < sizeof(func_type)) {                    \
-            if (unlikely(value != (func_type) (target_type) value)) {     \
-                func_type zero = 0;                                       \
-                PyErr_SetString(PyExc_OverflowError,                      \
-                    (is_unsigned && unlikely(value < zero)) ?             \
-                    "can't convert negative value to " #target_type :     \
-                    "value too large to convert to " #target_type);       \
-                return (target_type) -1;                                  \
-            }                                                             \
-        }                                                                 \
-        return (target_type) value;                                       \
-    }
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            return (int) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            if (sizeof(int) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
-            } else if (sizeof(int) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int) -1;
-        }
-    } else {
-        int val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int) -1;
-        val = __Pyx_PyInt_As_int(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
-    const int32_t neg_one = (int32_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int32_t) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int32_t");
-                return (int32_t) -1;
-            }
-            return (int32_t) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int32_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int32_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int32_t");
-                return (int32_t) -1;
-            }
-            if (sizeof(int32_t) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int32_t) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int32_t, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int32_t)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int32_t) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int32_t) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int32_t) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int32_t, long, PyLong_AsLong)
-            } else if (sizeof(int32_t) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int32_t, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int32_t val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int32_t) -1;
-        }
-    } else {
-        int32_t val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int32_t) -1;
-        val = __Pyx_PyInt_As_int32_t(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(int) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(int) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(int) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(int) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(int),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(long) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(long) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(long),
-                                     little, !is_unsigned);
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(long) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long) -1;
-            }
-            if (sizeof(long) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(long) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(long) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
-            } else if (sizeof(long) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            long val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (long) -1;
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long) -1;
-        val = __Pyx_PyInt_As_long(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-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_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
-
-#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_ssize_t basicsize;
-#ifdef Py_LIMITED_API
-    PyObject *py_basicsize;
-#endif
-    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,
-            "%.200s.%.200s is not a type object",
-            module_name, class_name);
-        goto bad;
-    }
-#ifndef Py_LIMITED_API
-    basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
-    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
-    if (!py_basicsize)
-        goto bad;
-    basicsize = PyLong_AsSsize_t(py_basicsize);
-    Py_DECREF(py_basicsize);
-    py_basicsize = 0;
-    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
-        goto bad;
-#endif
-    if (!strict && (size_t)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)basicsize != size) {
-        PyErr_Format(PyExc_ValueError,
-            "%.200s.%.200s 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
-
-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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
-    Py_ssize_t ignore;
-    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
-            }
-        }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-        return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
-    } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
-#if !CYTHON_COMPILING_IN_PYPY
-#if PY_VERSION_HEX >= 0x02060000
-    if (PyByteArray_Check(o)) {
-        *length = PyByteArray_GET_SIZE(o);
-        return PyByteArray_AS_STRING(o);
-    } else
-#endif
-#endif
-    {
-        char* result;
-        int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (unlikely(r < 0)) {
-            return NULL;
-        } else {
-            return result;
-        }
-    }
-}
-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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
-    if (!PyLong_Check(res)) {
-#endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (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;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
-  Py_ssize_t ival;
-  PyObject *x;
-#if PY_MAJOR_VERSION < 3
-  if (likely(PyInt_CheckExact(b)))
-      return PyInt_AS_LONG(b);
-#endif
-  if (likely(PyLong_CheckExact(b))) {
-    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-     #if CYTHON_USE_PYLONG_INTERNALS
-       switch (Py_SIZE(b)) {
-       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
-       case  0: return 0;
-       case  1: return ((PyLongObject*)b)->ob_digit[0];
-       }
-     #endif
-    #endif
-  #if PY_VERSION_HEX < 0x02060000
-    return PyInt_AsSsize_t(b);
-  #else
-    return PyLong_AsSsize_t(b);
-  #endif
-  }
-  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
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/pysam/cvcf.c b/pysam/cvcf.c
deleted file mode 100644
index 3e1e1da..0000000
--- a/pysam/cvcf.c
+++ /dev/null
@@ -1,30127 +0,0 @@
-/* Generated by Cython 0.20.1 on Fri Nov 21 19:49:04 2014 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#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
-#define CYTHON_ABI "0_20_1"
-#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 Py_OptimizeFlag 0
-#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 CYTHON_FORMAT_SSIZE_T ""
-  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
-  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_As_int(o)
-  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
-                                (PyErr_Format(PyExc_TypeError, \
-                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
-                                 (PyObject*)0))
-  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
-                                  !PyComplex_Check(o))
-  #define PyIndex_Check __Pyx_PyIndex_Check
-  #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"
-  #define CYTHON_FORMAT_SSIZE_T "z"
-  #define __Pyx_PyIndex_Check PyIndex_Check
-#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-  #define __Pyx_DefaultClassType PyClass_Type
-#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)
-  #define __Pyx_DefaultClassType PyType_Type
-#endif
-#if PY_VERSION_HEX < 0x02060000
-  #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 < 0x02060000
-  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
-  #define Py_TPFLAGS_IS_ABSTRACT 0
-#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
-  #define Py_TPFLAGS_HAVE_FINALIZE 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
-  #define CYTHON_PEP393_ENABLED 1
-  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
-                                              0 : _PyUnicode_Ready((PyObject *)(op)))
-  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
-  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
-  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
-  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
-  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
-#else
-  #define CYTHON_PEP393_ENABLED 0
-  #define __Pyx_PyUnicode_READY(op)       (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]))
-  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
-  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
-  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if CYTHON_COMPILING_IN_PYPY
-  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
-#else
-  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
-  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
-      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
-#endif
-#define __Pyx_PyString_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
-#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
-#if PY_MAJOR_VERSION >= 3
-  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
-#else
-  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
-#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_MAJOR_VERSION >= 3
-  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
-  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
-  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
-                                         PyString_Check(obj) || PyUnicode_Check(obj))
-  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
-#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
-  #define PyNumber_Int                 PyNumber_Long
-#endif
-#if PY_MAJOR_VERSION >= 3
-  #define PyBoolObject                 PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x030200A4
-  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
-#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
-#ifndef CYTHON_RESTRICT
-  #if defined(__GNUC__)
-    #define CYTHON_RESTRICT __restrict__
-  #elif defined(_MSC_VER) && _MSC_VER >= 1400
-    #define CYTHON_RESTRICT __restrict
-  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-    #define CYTHON_RESTRICT restrict
-  #else
-    #define CYTHON_RESTRICT
-  #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
-  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
-   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
-   a quiet NaN. */
-  float value;
-  memset(&value, 0xFF, sizeof(value));
-  return value;
-}
-#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__pysam__cvcf
-#define __PYX_HAVE_API__pysam__cvcf
-#include "stdlib.h"
-#include "string.h"
-#include "stdint.h"
-#include "stdio.h"
-#include "fcntl.h"
-#include "unistd.h"
-#include "zlib.h"
-#include "htslib/kstring.h"
-#include "htslib/hfile.h"
-#include "htslib/bgzf.h"
-#include "htslib/hts.h"
-#include "htslib/sam.h"
-#include "pysam_stream.h"
-#include "htslib/faidx.h"
-#include "htslib/tbx.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#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 Py_ssize_t n; const char* encoding;
-                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
-    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
-    (sizeof(type) > sizeof(Py_ssize_t) &&               \
-          likely(v < (type)PY_SSIZE_T_MAX ||            \
-                 v == (type)PY_SSIZE_T_MAX)  &&         \
-          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
-                                v == (type)PY_SSIZE_T_MIN)))  ||  \
-    (sizeof(type) == sizeof(Py_ssize_t) &&              \
-          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
-                               v == (type)PY_SSIZE_T_MAX)))  )
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
-#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
-#define __Pyx_PyBytes_FromString        PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
-    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
-    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
-    const Py_UNICODE *u_end = u;
-    while (*u_end++) ;
-    return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
-#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);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    PyObject* ascii_chars_u = NULL;
-    PyObject* ascii_chars_b = NULL;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
-        __Pyx_sys_getdefaultencoding_not_ascii = 0;
-    } else {
-        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
-        char ascii_chars[128];
-        int c;
-        for (c = 0; c < 128; c++) {
-            ascii_chars[c] = c;
-        }
-        __Pyx_sys_getdefaultencoding_not_ascii = 1;
-        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
-        if (ascii_chars_u == NULL) goto bad;
-        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
-        if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
-            PyErr_Format(
-                PyExc_ValueError,
-                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
-                default_encoding_c);
-            goto bad;
-        }
-    }
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    Py_XDECREF(ascii_chars_u);
-    Py_XDECREF(ascii_chars_b);
-    return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params(void) {
-    PyObject* sys = NULL;
-    PyObject* default_encoding = NULL;
-    char* default_encoding_c;
-    sys = PyImport_ImportModule("sys");
-    if (sys == NULL) goto bad;
-    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
-    if (default_encoding == NULL) goto bad;
-    default_encoding_c = PyBytes_AS_STRING(default_encoding);
-    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
-    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
-    Py_DECREF(sys);
-    Py_DECREF(default_encoding);
-    return 0;
-bad:
-    Py_XDECREF(sys);
-    Py_XDECREF(default_encoding);
-    return -1;
-}
-#endif
-#endif
-
-
-#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_d;
-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[] = {
-  "cvcf.pyx",
-  "ctabix.pxd",
-  "TabProxies.pxd",
-};
-
-/*--- Type declarations ---*/
-struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator;
-struct __pyx_obj_5pysam_6ctabix_TabixFile;
-struct __pyx_obj_5pysam_6ctabix_Parser;
-struct __pyx_obj_5pysam_6ctabix_asTuple;
-struct __pyx_obj_5pysam_6ctabix_asGTF;
-struct __pyx_obj_5pysam_6ctabix_asBed;
-struct __pyx_obj_5pysam_6ctabix_asVCF;
-struct __pyx_obj_5pysam_6ctabix_TabixIterator;
-struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed;
-struct __pyx_obj_5pysam_6ctabix_GZIterator;
-struct __pyx_obj_5pysam_6ctabix_GZIteratorHead;
-struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed;
-struct __pyx_obj_5pysam_6ctabix_Tabixfile;
-struct __pyx_obj_5pysam_10TabProxies_TupleProxy;
-struct __pyx_obj_5pysam_10TabProxies_GTFProxy;
-struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy;
-struct __pyx_obj_5pysam_10TabProxies_BedProxy;
-struct __pyx_obj_5pysam_10TabProxies_VCFProxy;
-struct __pyx_obj_5pysam_4cvcf_VCFRecord;
-struct __pyx_obj_5pysam_4cvcf_asVCFRecord;
-struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse;
-struct __pyx_opt_args_5pysam_6ctabix__force_str;
-
-/* "ctabix.pxd":50
- * ###########################################
- * # used by cvcf.pyx
- * cdef _force_str(object s, encoding=?)             # <<<<<<<<<<<<<<
- * 
- * ###########################################
- */
-struct __pyx_opt_args_5pysam_6ctabix__force_str {
-  int __pyx_n;
-  PyObject *encoding;
-};
-
-/* "ctabix.pxd":19
- *     kstream_t, kstring_t, gzFile, tbx_t
- * 
- * cdef class tabix_file_iterator:             # <<<<<<<<<<<<<<
- *     cdef gzFile fh
- *     cdef kstream_t * kstream
- */
-struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator *__pyx_vtab;
-  gzFile fh;
-  kstream_t *kstream;
-  kstring_t buffer;
-  size_t size;
-  struct __pyx_obj_5pysam_6ctabix_Parser *parser;
-  int fd;
-  int duplicated_fd;
-  PyObject *infile;
-};
-
-
-/* "ctabix.pxd":31
- *     cdef __cnext__(self)
- * 
- * cdef class TabixFile:             # <<<<<<<<<<<<<<
- * 
- *     # pointer to tabixfile
- */
-struct __pyx_obj_5pysam_6ctabix_TabixFile {
-  PyObject_HEAD
-  htsFile *tabixfile;
-  tbx_t *index;
-  int isremote;
-  PyObject *_filename;
-  PyObject *_filename_index;
-  struct __pyx_obj_5pysam_6ctabix_Parser *parser;
-  PyObject *encoding;
-};
-
-
-/* "ctabix.pxd":53
- * 
- * ###########################################
- * cdef class Parser:             # <<<<<<<<<<<<<<
- *     cdef encoding
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_Parser {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser *__pyx_vtab;
-  PyObject *encoding;
-};
-
-
-/* "ctabix.pxd":58
- *     cdef parse(self, char * buffer, int len)
- * 
- * cdef class asTuple(Parser):             # <<<<<<<<<<<<<<
- *     cdef parse(self, char * buffer, int len)
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_asTuple {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-};
-
-
-/* "ctabix.pxd":61
- *     cdef parse(self, char * buffer, int len)
- * 
- * cdef class asGTF(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_asGTF {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-};
-
-
-/* "ctabix.pxd":64
- *     pass
- * 
- * cdef class asBed(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_asBed {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-};
-
-
-/* "ctabix.pxd":67
- *     pass
- * 
- * cdef class asVCF(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_asVCF {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-};
-
-
-/* "ctabix.pxd":70
- *     pass
- * 
- * cdef class TabixIterator:             # <<<<<<<<<<<<<<
- *     cdef hts_itr_t * iterator
- *     cdef TabixFile tabixfile
- */
-struct __pyx_obj_5pysam_6ctabix_TabixIterator {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator *__pyx_vtab;
-  hts_itr_t *iterator;
-  struct __pyx_obj_5pysam_6ctabix_TabixFile *tabixfile;
-  kstring_t buffer;
-  PyObject *encoding;
-};
-
-
-/* "ctabix.pxd":77
- *     cdef int __cnext__(self)
- * 
- * cdef class TabixIteratorParsed(TabixIterator):             # <<<<<<<<<<<<<<
- *     cdef Parser parser
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed {
-  struct __pyx_obj_5pysam_6ctabix_TabixIterator __pyx_base;
-  struct __pyx_obj_5pysam_6ctabix_Parser *parser;
-};
-
-
-/* "ctabix.pxd":80
- *     cdef Parser parser
- * 
- * cdef class GZIterator:             # <<<<<<<<<<<<<<
- *     cdef object _filename
- *     cdef gzFile gzipfile
- */
-struct __pyx_obj_5pysam_6ctabix_GZIterator {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator *__pyx_vtab;
-  PyObject *_filename;
-  gzFile gzipfile;
-  kstream_t *kstream;
-  kstring_t buffer;
-  PyObject *encoding;
-};
-
-
-/* "ctabix.pxd":88
- *     cdef encoding
- * 
- * cdef class GZIteratorHead(GZIterator):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_GZIteratorHead {
-  struct __pyx_obj_5pysam_6ctabix_GZIterator __pyx_base;
-};
-
-
-/* "ctabix.pxd":91
- *     pass
- * 
- * cdef class GZIteratorParsed(GZIterator):             # <<<<<<<<<<<<<<
- *     cdef Parser parser
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed {
-  struct __pyx_obj_5pysam_6ctabix_GZIterator __pyx_base;
-  struct __pyx_obj_5pysam_6ctabix_Parser *parser;
-};
-
-
-/* "ctabix.pxd":95
- * 
- * # Compatibility Layer for pysam < 0.8
- * cdef class Tabixfile(TabixFile):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_6ctabix_Tabixfile {
-  struct __pyx_obj_5pysam_6ctabix_TabixFile __pyx_base;
-};
-
-
-/* "TabProxies.pxd":41
- *   ctypedef int uint64_t
- * 
- * cdef class TupleProxy:             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_TupleProxy {
-  PyObject_HEAD
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *__pyx_vtab;
-  char *data;
-  char **fields;
-  int nfields;
-  int index;
-  int nbytes;
-  int offset;
-  int is_modified;
-  PyObject *encoding;
-};
-
-
-/* "TabProxies.pxd":63
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class GTFProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_GTFProxy {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy __pyx_base;
-  char *_attributes;
-  int hasOwnAttributes;
-};
-
-
-/* "TabProxies.pxd":73
- *     cdef char * getAttributes( self )
- * 
- * cdef class NamedTupleProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy __pyx_base;
-};
-
-
-/* "TabProxies.pxd":76
- *     pass
- * 
- * cdef class BedProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_BedProxy {
-  struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-  char *contig;
-  uint32_t start;
-  uint32_t end;
-  int bedfields;
-};
-
-
-/* "TabProxies.pxd":88
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class VCFProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-struct __pyx_obj_5pysam_10TabProxies_VCFProxy {
-  struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-  char *contig;
-  uint32_t pos;
-};
-
-
-/* "pysam/cvcf.pyx":96
- * ###########################################################################################################
- * 
- * cdef class VCFRecord( TabProxies.TupleProxy):             # <<<<<<<<<<<<<<
- *     '''vcf record.
- * 
- */
-struct __pyx_obj_5pysam_4cvcf_VCFRecord {
-  struct __pyx_obj_5pysam_10TabProxies_TupleProxy __pyx_base;
-  PyObject *vcf;
-  char *contig;
-  uint32_t pos;
-};
-
-
-/* "pysam/cvcf.pyx":230
- * 
- * 
- * cdef class asVCFRecord(ctabix.Parser):             # <<<<<<<<<<<<<<
- *     '''converts a :term:`tabix row` into a VCF record.'''
- *     cdef vcffile
- */
-struct __pyx_obj_5pysam_4cvcf_asVCFRecord {
-  struct __pyx_obj_5pysam_6ctabix_Parser __pyx_base;
-  PyObject *vcffile;
-};
-
-
-/* "pysam/cvcf.pyx":914
- *         return line
- * 
- *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
- *         # deal with files with header only
- *         if line.startswith("##"): return
- */
-struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse {
-  PyObject_HEAD
-  PyObject *__pyx_v_d;
-  PyObject *__pyx_v_line;
-  PyObject *__pyx_v_self;
-  PyObject *__pyx_v_stream;
-  Py_ssize_t __pyx_t_0;
-  PyObject *__pyx_t_1;
-  PyObject *(*__pyx_t_2)(PyObject *);
-};
-
-
-
-/* "ctabix.pxd":19
- *     kstream_t, kstring_t, gzFile, tbx_t
- * 
- * cdef class tabix_file_iterator:             # <<<<<<<<<<<<<<
- *     cdef gzFile fh
- *     cdef kstream_t * kstream
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator {
-  PyObject *(*__pyx___cnext__)(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator *);
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator *__pyx_vtabptr_5pysam_6ctabix_tabix_file_iterator;
-
-
-/* "ctabix.pxd":53
- * 
- * ###########################################
- * cdef class Parser:             # <<<<<<<<<<<<<<
- *     cdef encoding
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_Parser {
-  PyObject *(*parse)(struct __pyx_obj_5pysam_6ctabix_Parser *, char *, int);
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_Parser *__pyx_vtabptr_5pysam_6ctabix_Parser;
-
-
-/* "ctabix.pxd":58
- *     cdef parse(self, char * buffer, int len)
- * 
- * cdef class asTuple(Parser):             # <<<<<<<<<<<<<<
- *     cdef parse(self, char * buffer, int len)
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_asTuple {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asTuple *__pyx_vtabptr_5pysam_6ctabix_asTuple;
-
-
-/* "ctabix.pxd":61
- *     cdef parse(self, char * buffer, int len)
- * 
- * cdef class asGTF(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_asGTF {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asGTF *__pyx_vtabptr_5pysam_6ctabix_asGTF;
-
-
-/* "ctabix.pxd":64
- *     pass
- * 
- * cdef class asBed(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_asBed {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asBed *__pyx_vtabptr_5pysam_6ctabix_asBed;
-
-
-/* "ctabix.pxd":67
- *     pass
- * 
- * cdef class asVCF(Parser):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_asVCF {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_asVCF *__pyx_vtabptr_5pysam_6ctabix_asVCF;
-
-
-/* "ctabix.pxd":70
- *     pass
- * 
- * cdef class TabixIterator:             # <<<<<<<<<<<<<<
- *     cdef hts_itr_t * iterator
- *     cdef TabixFile tabixfile
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator {
-  int (*__pyx___cnext__)(struct __pyx_obj_5pysam_6ctabix_TabixIterator *);
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator *__pyx_vtabptr_5pysam_6ctabix_TabixIterator;
-
-
-/* "ctabix.pxd":77
- *     cdef int __cnext__(self)
- * 
- * cdef class TabixIteratorParsed(TabixIterator):             # <<<<<<<<<<<<<<
- *     cdef Parser parser
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_TabixIteratorParsed {
-  struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_TabixIteratorParsed *__pyx_vtabptr_5pysam_6ctabix_TabixIteratorParsed;
-
-
-/* "ctabix.pxd":80
- *     cdef Parser parser
- * 
- * cdef class GZIterator:             # <<<<<<<<<<<<<<
- *     cdef object _filename
- *     cdef gzFile gzipfile
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator {
-  int (*__pyx___cnext__)(struct __pyx_obj_5pysam_6ctabix_GZIterator *);
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator *__pyx_vtabptr_5pysam_6ctabix_GZIterator;
-
-
-/* "ctabix.pxd":88
- *     cdef encoding
- * 
- * cdef class GZIteratorHead(GZIterator):             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorHead {
-  struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorHead *__pyx_vtabptr_5pysam_6ctabix_GZIteratorHead;
-
-
-/* "ctabix.pxd":91
- *     pass
- * 
- * cdef class GZIteratorParsed(GZIterator):             # <<<<<<<<<<<<<<
- *     cdef Parser parser
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorParsed {
-  struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorParsed *__pyx_vtabptr_5pysam_6ctabix_GZIteratorParsed;
-
-
-/* "TabProxies.pxd":41
- *   ctypedef int uint64_t
- * 
- * cdef class TupleProxy:             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy {
-  int (*getMaxFields)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *);
-  int (*getMinFields)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *);
-  PyObject *(*take)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*present)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*copy)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-  PyObject *(*update)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t);
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy *__pyx_vtabptr_5pysam_10TabProxies_TupleProxy;
-
-
-/* "TabProxies.pxd":63
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class GTFProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy __pyx_base;
-  char *(*getAttributes)(struct __pyx_obj_5pysam_10TabProxies_GTFProxy *);
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy *__pyx_vtabptr_5pysam_10TabProxies_GTFProxy;
-
-
-/* "TabProxies.pxd":73
- *     cdef char * getAttributes( self )
- * 
- * cdef class NamedTupleProxy(TupleProxy) :             # <<<<<<<<<<<<<<
- *     pass
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy *__pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy;
-
-
-/* "TabProxies.pxd":76
- *     pass
- * 
- * cdef class BedProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy *__pyx_vtabptr_5pysam_10TabProxies_BedProxy;
-
-
-/* "TabProxies.pxd":88
- *     cdef update(self, char * buffer, size_t nbytes)
- * 
- * cdef class VCFProxy(NamedTupleProxy) :             # <<<<<<<<<<<<<<
- * 
- *     cdef:
- */
-
-struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy *__pyx_vtabptr_5pysam_10TabProxies_VCFProxy;
-
-
-/* "pysam/cvcf.pyx":96
- * ###########################################################################################################
- * 
- * cdef class VCFRecord( TabProxies.TupleProxy):             # <<<<<<<<<<<<<<
- *     '''vcf record.
- * 
- */
-
-struct __pyx_vtabstruct_5pysam_4cvcf_VCFRecord {
-  struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_4cvcf_VCFRecord *__pyx_vtabptr_5pysam_4cvcf_VCFRecord;
-
-
-/* "pysam/cvcf.pyx":230
- * 
- * 
- * cdef class asVCFRecord(ctabix.Parser):             # <<<<<<<<<<<<<<
- *     '''converts a :term:`tabix row` into a VCF record.'''
- *     cdef vcffile
- */
-
-struct __pyx_vtabstruct_5pysam_4cvcf_asVCFRecord {
-  struct __pyx_vtabstruct_5pysam_6ctabix_Parser __pyx_base;
-};
-static struct __pyx_vtabstruct_5pysam_4cvcf_asVCFRecord *__pyx_vtabptr_5pysam_4cvcf_asVCFRecord;
-#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_XDECREF_SET(r, v) do {                            \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_XDECREF(tmp);                              \
-    } while (0)
-#define __Pyx_DECREF_SET(r, v) do {                             \
-        PyObject *tmp = (PyObject *) r;                         \
-        r = v; __Pyx_DECREF(tmp);                               \
-    } while (0)
-#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)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_getattro))
-        return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_getattr))
-        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
-    return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
-    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static 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 CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
-#else
-#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
-#endif
-
-#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
-    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
-               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
-    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck);
-
-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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-#include <string.h>
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-#if PY_MAJOR_VERSION >= 3
-#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
-#else
-#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
-#endif
-
-static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
-#if CYTHON_COMPILING_IN_PYPY
-#define __Pyx_PyObject_AsDouble(obj) \
-(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
- likely(PyInt_CheckExact(obj)) ? \
- PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
-#else
-#define __Pyx_PyObject_AsDouble(obj) \
-((likely(PyFloat_CheckExact(obj))) ? \
- PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
-#endif
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-
-#if PY_MAJOR_VERSION < 3
-#define __Pyx_PyString_Join __Pyx_PyBytes_Join
-#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
-#else
-#define __Pyx_PyString_Join PyUnicode_Join
-#define __Pyx_PyBaseString_Join PyUnicode_Join
-#endif
-#if CYTHON_COMPILING_IN_CPYTHON
-    #if PY_MAJOR_VERSION < 3
-    #define __Pyx_PyBytes_Join _PyString_Join
-    #else
-    #define __Pyx_PyBytes_Join _PyBytes_Join
-    #endif
-#else
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values); /*proto*/
-#endif
-
-#if PY_MAJOR_VERSION >= 3
-static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
-    PyObject *value;
-    value = PyDict_GetItemWithError(d, key);
-    if (unlikely(!value)) {
-        if (!PyErr_Occurred()) {
-            PyObject* args = PyTuple_Pack(1, key);
-            if (likely(args))
-                PyErr_SetObject(PyExc_KeyError, args);
-            Py_XDECREF(args);
-        }
-        return NULL;
-    }
-    Py_INCREF(value);
-    return value;
-}
-#else
-    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
-#endif
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
-        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
-        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
-        int has_cstart, int has_cstop, int wraparound);
-
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
-static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
-    PyTypeObject* tp = Py_TYPE(obj);
-    if (likely(tp->tp_setattro))
-        return tp->tp_setattro(obj, attr_name, value);
-#if PY_MAJOR_VERSION < 3
-    if (likely(tp->tp_setattr))
-        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
-#endif
-    return PyObject_SetAttr(obj, attr_name, value);
-}
-#else
-#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
-#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
-#endif
-
-static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
-    int result = PySequence_Contains(seq, item);
-    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
-
-static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
-    int result = PyDict_Contains(dict, item);
-    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
-    PyListObject* L = (PyListObject*) list;
-    Py_ssize_t len = Py_SIZE(list);
-    if (likely(L->allocated > len)) {
-        Py_INCREF(x);
-        PyList_SET_ITEM(list, len, x);
-        Py_SIZE(list) = len+1;
-        return 0;
-    }
-    return PyList_Append(list, x);
-}
-#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
-#endif
-
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
-#else
-#define __Pyx_PyList_GetSlice(seq, start, stop)   PySequence_GetSlice(seq, start, stop)
-#define __Pyx_PyTuple_GetSlice(seq, start, stop)  PySequence_GetSlice(seq, start, stop)
-#endif
-
-static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
-    PyObject *method, *result = NULL;
-    if (unlikely(!args)) return NULL;
-    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
-    if (unlikely(!method)) goto bad;
-    result = __Pyx_PyObject_Call(method, args, NULL);
-    Py_DECREF(method);
-bad:
-    Py_DECREF(args);
-    return result;
-}
-#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
-#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
-#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
-#define __Pyx_PyObject_CallMethod0(obj, name) \
-    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))
-
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/
-
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
-
-static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
-
-static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
-                                             int is_tuple, int has_known_size, int decref_tuple);
-
-static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
-                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
-static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
-                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
-
-#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
-    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
-    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
-    (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
-               __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
-                                               int is_list, int wraparound, int boundscheck);
-
-static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
-
-static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
-
-static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
-
-static void* __Pyx_GetVtable(PyObject *dict); /*proto*/
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/
-
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
-
-#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 PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
-
-#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;
-    PyObject *func_dict;
-    PyObject *func_weakreflist;
-    PyObject *func_name;
-    PyObject *func_qualname;
-    PyObject *func_doc;
-    PyObject *func_globals;
-    PyObject *func_code;
-    PyObject *func_closure;
-    PyObject *func_classobj; /* No-args super() class cell */
-    void *defaults;
-    int defaults_pyobjects;
-    int flags;
-    PyObject *defaults_tuple;   /* Const defaults tuple */
-    PyObject *defaults_kwdict;  /* Const kwonly defaults dict */
-    PyObject *(*defaults_getter)(PyObject *);
-    PyObject *func_annotations; /* function annotations dict */
-} __pyx_CyFunctionObject;
-static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
-    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
-static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
-                                      int flags, PyObject* qualname,
-                                      PyObject *self,
-                                      PyObject *module, PyObject *globals,
-                                      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 CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
-                                                             PyObject *dict);
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
-                                                              PyObject *dict);
-static int __Pyx_CyFunction_init(void);
-
-static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
-                                           PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/
-static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
-                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-#define __Pyx_Generator_USED
-#include <structmember.h>
-#include <frameobject.h>
-typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
-typedef struct {
-    PyObject_HEAD
-    __pyx_generator_body_t body;
-    PyObject *closure;
-    PyObject *exc_type;
-    PyObject *exc_value;
-    PyObject *exc_traceback;
-    PyObject *gi_weakreflist;
-    PyObject *classobj;
-    PyObject *yieldfrom;
-    int resume_label;
-    char is_running;
-} __pyx_GeneratorObject;
-static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
-                                                  PyObject *closure);
-static int __pyx_Generator_init(void);
-static int __Pyx_Generator_clear(PyObject* self);
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
-#else
-#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
-#endif
-
-static int __Pyx_check_binary_version(void);
-
-#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 PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*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 'libc.stdint' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdlib' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'pysam.chtslib' */
-
-/* Module declarations from 'pysam.ctabix' */
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_tabix_file_iterator = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_TabixFile = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_Parser = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_asTuple = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_asGTF = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_asBed = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_asVCF = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_TabixIterator = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_TabixIteratorParsed = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_GZIterator = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_GZIteratorHead = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_GZIteratorParsed = 0;
-static PyTypeObject *__pyx_ptype_5pysam_6ctabix_Tabixfile = 0;
-static PyObject *(*__pyx_f_5pysam_6ctabix__force_str)(PyObject *, struct __pyx_opt_args_5pysam_6ctabix__force_str *__pyx_optional_args); /*proto*/
-
-/* Module declarations from 'pysam.TabProxies' */
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_TupleProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_GTFProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_BedProxy = 0;
-static PyTypeObject *__pyx_ptype_5pysam_10TabProxies_VCFProxy = 0;
-
-/* Module declarations from 'pysam.cvcf' */
-static PyTypeObject *__pyx_ptype_5pysam_4cvcf_VCFRecord = 0;
-static PyTypeObject *__pyx_ptype_5pysam_4cvcf_asVCFRecord = 0;
-static PyTypeObject *__pyx_ptype_5pysam_4cvcf___pyx_scope_struct___parse = 0;
-#define __Pyx_MODULE_NAME "pysam.cvcf"
-int __pyx_module_is_main_pysam__cvcf = 0;
-
-/* Implementation of 'pysam.cvcf' */
-static PyObject *__pyx_builtin_object;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_builtin_enumerate;
-static PyObject *__pyx_builtin_map;
-static PyObject *__pyx_builtin_min;
-static PyObject *__pyx_builtin_zip;
-static PyObject *__pyx_builtin_StopIteration;
-static PyObject *__pyx_builtin_KeyError;
-static PyObject *__pyx_builtin_NotImplementedError;
-static PyObject *__pyx_pf_5pysam_4cvcf_get_sequence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_fa); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_2parse_regions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string); /* proto */
-static int __pyx_pf_5pysam_4cvcf_9VCFRecord___init__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_vcf); /* proto */
-static int __pyx_pf_5pysam_4cvcf_9VCFRecord_2__cinit__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_vcf); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_4error(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_error, PyObject *__pyx_v_opt); /* proto */
-static Py_ssize_t __pyx_pf_5pysam_4cvcf_9VCFRecord_6__len__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_6contig___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_3pos___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_2id___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_3ref___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_3alt___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_4qual___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_6filter___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_4info___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_6format___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_7samples___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_8__getitem__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static int __pyx_pf_5pysam_4cvcf_11asVCFRecord___init__(struct __pyx_obj_5pysam_4cvcf_asVCFRecord *__pyx_v_self, PyObject *__pyx_v_vcffile); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__copy, PyObject *__pyx_v_reference, PyObject *__pyx_v_regions, PyObject *__pyx_v_lines, PyObject *__pyx_v_leftalign); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_2error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_error, PyObject *__pyx_v_opt); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_4parse_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_format, PyObject *__pyx_v_filter); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_6format_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fmt, PyObject *__pyx_v_filter); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_8get_expected(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_alt); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_10_add_definition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_key, PyObject *__pyx_v_data, PyObject *__pyx_v_line); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_12format_formatdata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_format, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_separator); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_14enter_default_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_16parse_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_18write_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_20parse_heading(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_22write_heading(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_24convertGT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_GTstring); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_26convertGTback(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_GTdata); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_28parse_formatdata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_line); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_30inregion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_pos); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_32parse_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_lineparse); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_34write_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_data); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_36_parse_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_38_parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_stream); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_41getsamples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_43setsamples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_samples); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_45getheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_47setheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_header); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_49getinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_51setinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_info); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_53getformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_55setformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_57getfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_59setfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filter); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_61setversion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_version); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_63setregions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_regions); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_65setreference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ref); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_67ignoreerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorstring); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_69warnerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorstring); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_71parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_73write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_datagenerator); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_75writeheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_77compare_calls(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_pos1, PyObject *__pyx_v_ref1, PyObject *__pyx_v_alt1, PyObject *__pyx_v_pos2, PyObject *__pyx_v_ref2, PyObject *__pyx_v_alt2); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_79connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_encoding); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_81fetch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region); /* proto */
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_83validate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_record); /* proto */
-static PyObject *__pyx_tp_new_5pysam_4cvcf_VCFRecord(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_4cvcf_asVCFRecord(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_5pysam_4cvcf___pyx_scope_struct___parse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_[] = "";
-static char __pyx_k_0[] = "0";
-static char __pyx_k_A[] = "A";
-static char __pyx_k_D[] = "D";
-static char __pyx_k_G[] = "G";
-static char __pyx_k_I[] = "I";
-static char __pyx_k_N[] = "N";
-static char __pyx_k_a[] = "a";
-static char __pyx_k_c[] = "c";
-static char __pyx_k_d[] = "d";
-static char __pyx_k_f[] = "f";
-static char __pyx_k_i[] = "i";
-static char __pyx_k_k[] = "k";
-static char __pyx_k_l[] = "l";
-static char __pyx_k_n[] = "n";
-static char __pyx_k_r[] = "r";
-static char __pyx_k_s[] = "s";
-static char __pyx_k_t[] = "t";
-static char __pyx_k_v[] = "v";
-static char __pyx_k_x[] = "x";
-static char __pyx_k_y[] = "y";
-static char __pyx_k_DP[] = "DP";
-static char __pyx_k_EC[] = "EC";
-static char __pyx_k_FT[] = "FT";
-static char __pyx_k_GL[] = "GL";
-static char __pyx_k_GP[] = "GP";
-static char __pyx_k_GQ[] = "GQ";
-static char __pyx_k_GT[] = "GT";
-static char __pyx_k_HQ[] = "HQ";
-static char __pyx_k_ID[] = "ID=";
-static char __pyx_k_MQ[] = "MQ";
-static char __pyx_k_PL[] = "PL";
-static char __pyx_k_PQ[] = "PQ";
-static char __pyx_k_PS[] = "PS";
-static char __pyx_k__2[] = ",";
-static char __pyx_k__4[] = ":";
-static char __pyx_k__6[] = "-";
-static char __pyx_k__8[] = ".";
-static char __pyx_k_fa[] = "fa";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_na[] = "na";
-static char __pyx_k_re[] = "re";
-static char __pyx_k_ALT[] = "ALT";
-static char __pyx_k_GLE[] = "GLE";
-static char __pyx_k_POS[] = "POS";
-static char __pyx_k_REF[] = "REF";
-static char __pyx_k_VCF[] = "VCF";
-static char __pyx_k__10[] = ";";
-static char __pyx_k__13[] = "=";
-static char __pyx_k__21[] = "<";
-static char __pyx_k__23[] = ">";
-static char __pyx_k__29[] = "\"";
-static char __pyx_k__46[] = "##";
-static char __pyx_k__51[] = "#";
-static char __pyx_k__55[] = "\t";
-static char __pyx_k__60[] = "\n";
-static char __pyx_k__61[] = "|";
-static char __pyx_k__91[] = "[|/\\\\]";
-static char __pyx_k_add[] = "add";
-static char __pyx_k_all[] = "__all__";
-static char __pyx_k_alt[] = "alt";
-static char __pyx_k_doc[] = "__doc__";
-static char __pyx_k_end[] = "end";
-static char __pyx_k_err[] = "err";
-static char __pyx_k_fmt[] = "fmt";
-static char __pyx_k_get[] = "get";
-static char __pyx_k_gts[] = "gts";
-static char __pyx_k_idx[] = "idx";
-static char __pyx_k_key[] = "key";
-static char __pyx_k_map[] = "map";
-static char __pyx_k_min[] = "min";
-static char __pyx_k_nmb[] = "nmb";
-static char __pyx_k_opt[] = "opt";
-static char __pyx_k_pos[] = "pos";
-static char __pyx_k_ref[] = "ref";
-static char __pyx_k_s_s[] = "%s=%s";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_var[] = "var";
-static char __pyx_k_vcf[] = "vcf";
-static char __pyx_k_zip[] = "zip";
-static char __pyx_k_Flag[] = "Flag";
-static char __pyx_k_ID_2[] = "ID";
-static char __pyx_k_INFO[] = "INFO";
-static char __pyx_k_PASS[] = "PASS";
-static char __pyx_k_QUAL[] = "QUAL";
-static char __pyx_k_Type[] = "Type=";
-static char __pyx_k_addn[] = "addn";
-static char __pyx_k_alt1[] = "alt1";
-static char __pyx_k_alt2[] = "alt2";
-static char __pyx_k_args[] = "args";
-static char __pyx_k_cols[] = "cols";
-static char __pyx_k_copy[] = "_copy";
-static char __pyx_k_data[] = "data";
-static char __pyx_k_dict[] = "__dict__";
-static char __pyx_k_elts[] = "elts";
-static char __pyx_k_find[] = "find";
-static char __pyx_k_info[] = "_info";
-static char __pyx_k_init[] = "__init__";
-static char __pyx_k_join[] = "join";
-static char __pyx_k_keys[] = "keys";
-static char __pyx_k_last[] = "last";
-static char __pyx_k_left[] = "left";
-static char __pyx_k_line[] = "line";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_pos1[] = "pos1";
-static char __pyx_k_pos2[] = "pos2";
-static char __pyx_k_qual[] = "qual";
-static char __pyx_k_ref1[] = "ref1";
-static char __pyx_k_ref2[] = "ref2";
-static char __pyx_k_rest[] = "rest";
-static char __pyx_k_self[] = "self";
-static char __pyx_k_send[] = "send";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_type[] = "type";
-static char __pyx_k_ACGTN[] = "ACGTN";
-static char __pyx_k_CHROM[] = "CHROM";
-static char __pyx_k_Error[] = "Error";
-static char __pyx_k_Float[] = "Float";
-static char __pyx_k_addns[] = "addns";
-static char __pyx_k_ascii[] = "ascii";
-static char __pyx_k_blurp[] = "blurp";
-static char __pyx_k_chrom[] = "chrom";
-static char __pyx_k_close[] = "close";
-static char __pyx_k_descr[] = "descr";
-static char __pyx_k_error[] = "error";
-static char __pyx_k_faref[] = "faref";
-static char __pyx_k_fetch[] = "fetch";
-static char __pyx_k_first[] = "first";
-static char __pyx_k_ielts[] = "ielts";
-static char __pyx_k_label[] = "label";
-static char __pyx_k_lines[] = "lines";
-static char __pyx_k_match[] = "match";
-static char __pyx_k_parse[] = "_parse";
-static char __pyx_k_pysam[] = "pysam";
-static char __pyx_k_range[] = "range";
-static char __pyx_k_s_s_2[] = "##%s=%s\n";
-static char __pyx_k_sdata[] = "sdata";
-static char __pyx_k_split[] = "split";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_strip[] = "strip";
-static char __pyx_k_throw[] = "throw";
-static char __pyx_k_upper[] = "upper";
-static char __pyx_k_value[] = "value";
-static char __pyx_k_write[] = "write";
-static char __pyx_k_FILTER[] = "FILTER";
-static char __pyx_k_FORMAT[] = "FORMAT";
-static char __pyx_k_GTdata[] = "GTdata";
-static char __pyx_k_Number[] = "Number=";
-static char __pyx_k_String[] = "String";
-static char __pyx_k_Type_2[] = "Type";
-static char __pyx_k_allele[] = "allele";
-static char __pyx_k_append[] = "append";
-static char __pyx_k_bisect[] = "bisect";
-static char __pyx_k_copy_2[] = "copy";
-static char __pyx_k_dict_2[] = "dict";
-static char __pyx_k_errors[] = "_errors";
-static char __pyx_k_filter[] = "_filter";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_header[] = "_header";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_info_2[] = "info";
-static char __pyx_k_line_2[] = "_line";
-static char __pyx_k_lineno[] = "_lineno";
-static char __pyx_k_module[] = "__module__";
-static char __pyx_k_number[] = "number";
-static char __pyx_k_object[] = "object";
-static char __pyx_k_output[] = "(output)";
-static char __pyx_k_parser[] = "parser";
-static char __pyx_k_record[] = "record";
-static char __pyx_k_region[] = "region";
-static char __pyx_k_result[] = "result";
-static char __pyx_k_sample[] = "sample";
-static char __pyx_k_stream[] = "stream";
-static char __pyx_k_string[] = "string";
-static char __pyx_k_values[] = "values";
-static char __pyx_k_ACGTN_2[] = "^[ACGTN]+$";
-static char __pyx_k_Integer[] = "Integer";
-static char __pyx_k_VCFv3_3[] = "VCFv3.3";
-static char __pyx_k_VCFv4_0[] = "VCFv4.0";
-static char __pyx_k_VCFv4_1[] = "VCFv4.1";
-static char __pyx_k_Warning[] = "Warning";
-static char __pyx_k_alleles[] = "#alleles";
-static char __pyx_k_compile[] = "compile";
-static char __pyx_k_connect[] = "connect";
-static char __pyx_k_errwarn[] = "errwarn";
-static char __pyx_k_getinfo[] = "getinfo";
-static char __pyx_k_lines_2[] = "_lines";
-static char __pyx_k_longest[] = "longest";
-static char __pyx_k_missing[] = "missing";
-static char __pyx_k_movable[] = "movable";
-static char __pyx_k_newalts[] = "newalts";
-static char __pyx_k_parse_2[] = "parse";
-static char __pyx_k_prepare[] = "__prepare__";
-static char __pyx_k_regions[] = "regions";
-static char __pyx_k_replace[] = "replace";
-static char __pyx_k_samples[] = "_samples";
-static char __pyx_k_setinfo[] = "setinfo";
-static char __pyx_k_vcffile[] = "vcffile";
-static char __pyx_k_version[] = "_version";
-static char __pyx_k_GTstring[] = "GTstring";
-static char __pyx_k_Genotype[] = "Genotype";
-static char __pyx_k_KeyError[] = "KeyError";
-static char __pyx_k_Number_2[] = "Number";
-static char __pyx_k_deepcopy[] = "deepcopy";
-static char __pyx_k_encoding[] = "encoding";
-static char __pyx_k_endswith[] = "endswith";
-static char __pyx_k_expected[] = "expected";
-static char __pyx_k_filename[] = "filename";
-static char __pyx_k_filter_2[] = "filter";
-static char __pyx_k_format_2[] = "_format";
-static char __pyx_k_gtsRegEx[] = "gtsRegEx";
-static char __pyx_k_header_2[] = "header";
-static char __pyx_k_headings[] = "headings";
-static char __pyx_k_inregion[] = "inregion";
-static char __pyx_k_operator[] = "operator";
-static char __pyx_k_output_2[] = "output";
-static char __pyx_k_qualname[] = "__qualname__";
-static char __pyx_k_required[] = "_required";
-static char __pyx_k_sequence[] = "sequence";
-static char __pyx_k_shortest[] = "shortest";
-static char __pyx_k_validate[] = "validate";
-static char __pyx_k_Character[] = "Character";
-static char __pyx_k_NT_NUMBER[] = "NT_NUMBER";
-static char __pyx_k_Phase_set[] = "Phase set";
-static char __pyx_k_Tabixfile[] = "Tabixfile";
-static char __pyx_k_VCFRecord[] = "VCFRecord";
-static char __pyx_k_VCF_error[] = "VCF.error";
-static char __pyx_k_VCF_fetch[] = "VCF.fetch";
-static char __pyx_k_VCF_parse[] = "VCF.parse";
-static char __pyx_k_VCF_write[] = "VCF.write";
-static char __pyx_k_WRONG_REF[] = "WRONG_REF";
-static char __pyx_k_convertGT[] = "convertGT";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_genotypes[] = "#genotypes";
-static char __pyx_k_getfilter[] = "getfilter";
-static char __pyx_k_getformat[] = "getformat";
-static char __pyx_k_getheader[] = "getheader";
-static char __pyx_k_last_line[] = "last_line";
-static char __pyx_k_leftalign[] = "leftalign";
-static char __pyx_k_lineparse[] = "lineparse";
-static char __pyx_k_metaclass[] = "__metaclass__";
-static char __pyx_k_reference[] = "reference";
-static char __pyx_k_regions_2[] = "_regions";
-static char __pyx_k_samples_2[] = "samples";
-static char __pyx_k_separator[] = "separator";
-static char __pyx_k_setfilter[] = "setfilter";
-static char __pyx_k_setformat[] = "setformat";
-static char __pyx_k_setheader[] = "setheader";
-static char __pyx_k_tabixfile[] = "tabixfile";
-static char __pyx_k_version_2[] = "version";
-static char __pyx_k_warnerror[] = "warnerror";
-static char __pyx_k_NT_ALLELES[] = "NT_ALLELES";
-static char __pyx_k_NT_UNKNOWN[] = "NT_UNKNOWN";
-static char __pyx_k_VCF___init[] = "VCF.__init__";
-static char __pyx_k_VCF__parse[] = "VCF._parse";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_errorlabel[] = "errorlabel";
-static char __pyx_k_fileformat[] = "fileformat";
-static char __pyx_k_formatdict[] = "formatdict";
-static char __pyx_k_getsamples[] = "getsamples";
-static char __pyx_k_itemgetter[] = "itemgetter";
-static char __pyx_k_itervalues[] = "itervalues";
-static char __pyx_k_namedtuple[] = "namedtuple";
-static char __pyx_k_numbertype[] = "numbertype";
-static char __pyx_k_parse_data[] = "parse_data";
-static char __pyx_k_pysam_cvcf[] = "pysam.cvcf";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_required_2[] = "required";
-static char __pyx_k_setregions[] = "setregions";
-static char __pyx_k_setsamples[] = "setsamples";
-static char __pyx_k_setversion[] = "setversion";
-static char __pyx_k_startswith[] = "startswith";
-static char __pyx_k_write_data[] = "write_data";
-static char __pyx_k_Description[] = "Description=";
-static char __pyx_k_MISSING_REF[] = "MISSING_REF";
-static char __pyx_k_V33_BAD_REF[] = "V33_BAD_REF";
-static char __pyx_k_VCF_connect[] = "VCF.connect";
-static char __pyx_k_VCF_getinfo[] = "VCF.getinfo";
-static char __pyx_k_VCF_setinfo[] = "VCF.setinfo";
-static char __pyx_k_alleleRegEx[] = "alleleRegEx";
-static char __pyx_k_collections[] = "collections";
-static char __pyx_k_defaultdict[] = "defaultdict";
-static char __pyx_k_description[] = "description";
-static char __pyx_k_errorstring[] = "errorstring";
-static char __pyx_k_ignoreerror[] = "ignoreerror";
-static char __pyx_k_leftalign_2[] = "_leftalign";
-static char __pyx_k_reference_2[] = "_reference";
-static char __pyx_k_warn_errors[] = "_warn_errors";
-static char __pyx_k_writeheader[] = "writeheader";
-static char __pyx_k_BAD_GENOTYPE[] = "BAD_GENOTYPE";
-static char __pyx_k_NT_GENOTYPES[] = "NT_GENOTYPES";
-static char __pyx_k_VCF_inregion[] = "VCF.inregion";
-static char __pyx_k_VCF_validate[] = "VCF.validate";
-static char __pyx_k_get_expected[] = "get_expected";
-static char __pyx_k_get_sequence[] = "get_sequence";
-static char __pyx_k_missingvalue[] = "missingvalue";
-static char __pyx_k_parse_format[] = "parse_format";
-static char __pyx_k_parse_header[] = "parse_header";
-static char __pyx_k_setreference[] = "setreference";
-static char __pyx_k_write_header[] = "write_header";
-static char __pyx_k_Description_2[] = "Description";
-static char __pyx_k_NT_NR_ALLELES[] = "NT_NR_ALLELES";
-static char __pyx_k_StopIteration[] = "StopIteration";
-static char __pyx_k_Undefined_tag[] = "(Undefined tag)";
-static char __pyx_k_VCF_convertGT[] = "VCF.convertGT";
-static char __pyx_k_VCF_getfilter[] = "VCF.getfilter";
-static char __pyx_k_VCF_getformat[] = "VCF.getformat";
-static char __pyx_k_VCF_getheader[] = "VCF.getheader";
-static char __pyx_k_VCF_setfilter[] = "VCF.setfilter";
-static char __pyx_k_VCF_setformat[] = "VCF.setformat";
-static char __pyx_k_VCF_setheader[] = "VCF.setheader";
-static char __pyx_k_VCF_warnerror[] = "VCF.warnerror";
-static char __pyx_k_compare_calls[] = "compare_calls";
-static char __pyx_k_convertGTback[] = "convertGTback";
-static char __pyx_k_datagenerator[] = "datagenerator";
-static char __pyx_k_format_format[] = "format_format";
-static char __pyx_k_parse_heading[] = "parse_heading";
-static char __pyx_k_parse_regions[] = "parse_regions";
-static char __pyx_k_sample2column[] = "_sample2column";
-static char __pyx_k_write_heading[] = "write_heading";
-static char __pyx_k_V33_BAD_ALLELE[] = "V33_BAD_ALLELE";
-static char __pyx_k_V40_BAD_ALLELE[] = "V40_BAD_ALLELE";
-static char __pyx_k_VCF_getsamples[] = "VCF.getsamples";
-static char __pyx_k_VCF_parse_data[] = "VCF.parse_data";
-static char __pyx_k_VCF_setregions[] = "VCF.setregions";
-static char __pyx_k_VCF_setsamples[] = "VCF.setsamples";
-static char __pyx_k_VCF_setversion[] = "VCF.setversion";
-static char __pyx_k_VCF_write_data[] = "VCF.write_data";
-static char __pyx_k_add_definition[] = "_add_definition";
-static char __pyx_k_have_deletions[] = "have_deletions";
-static char __pyx_k_ignored_errors[] = "_ignored_errors";
-static char __pyx_k_nonref_alleles[] = "#nonref_alleles";
-static char __pyx_k_parse_header_2[] = "_parse_header";
-static char __pyx_k_Phasing_quality[] = "Phasing quality";
-static char __pyx_k_VCF_ignoreerror[] = "VCF.ignoreerror";
-static char __pyx_k_VCF_writeheader[] = "VCF.writeheader";
-static char __pyx_k_faref_leftflank[] = "faref_leftflank";
-static char __pyx_k_Genotype_Quality[] = "Genotype Quality";
-static char __pyx_k_POS_NOT_POSITIVE[] = "POS_NOT_POSITIVE";
-static char __pyx_k_VCF_get_expected[] = "VCF.get_expected";
-static char __pyx_k_VCF_parse_format[] = "VCF.parse_format";
-static char __pyx_k_VCF_parse_header[] = "VCF.parse_header";
-static char __pyx_k_VCF_setreference[] = "VCF.setreference";
-static char __pyx_k_VCF_write_header[] = "VCF.write_header";
-static char __pyx_k_parse_formatdata[] = "parse_formatdata";
-static char __pyx_k_phased_genotypes[] = "#phased_genotypes";
-static char __pyx_k_ERROR_INFO_STRING[] = "ERROR_INFO_STRING";
-static char __pyx_k_ERROR_UNKNOWN_KEY[] = "ERROR_UNKNOWN_KEY";
-static char __pyx_k_Haplotype_Quality[] = "Haplotype Quality";
-static char __pyx_k_POS_NOT_NUMERICAL[] = "POS_NOT_NUMERICAL";
-static char __pyx_k_VCF__parse_header[] = "VCF._parse_header";
-static char __pyx_k_VCF_compare_calls[] = "VCF.compare_calls";
-static char __pyx_k_VCF_convertGTback[] = "VCF.convertGTback";
-static char __pyx_k_VCF_format_format[] = "VCF.format_format";
-static char __pyx_k_VCF_parse_heading[] = "VCF.parse_heading";
-static char __pyx_k_VCF_write_heading[] = "VCF.write_heading";
-static char __pyx_k_format_formatdata[] = "format_formatdata";
-static char __pyx_k_in_line_s_s_s_s_s[] = " in line %s: '%s'\n%s %s: %s\n";
-static char __pyx_k_FILTER_NOT_DEFINED[] = "FILTER_NOT_DEFINED";
-static char __pyx_k_FORMAT_NOT_DEFINED[] = "FORMAT_NOT_DEFINED";
-static char __pyx_k_QUAL_NOT_NUMERICAL[] = "QUAL_NOT_NUMERICAL";
-static char __pyx_k_ZERO_LENGTH_ALLELE[] = "ZERO_LENGTH_ALLELE";
-static char __pyx_k_found_s_expected_s[] = "(found %s, expected %s)";
-static char __pyx_k_ERROR_TRAILING_DATA[] = "ERROR_TRAILING_DATA";
-static char __pyx_k_NT_PHASED_GENOTYPES[] = "NT_PHASED_GENOTYPES";
-static char __pyx_k_NotImplementedError[] = "NotImplementedError";
-static char __pyx_k_RMS_mapping_quality[] = "RMS mapping quality";
-static char __pyx_k_UNKNOWN_CHAR_IN_REF[] = "UNKNOWN_CHAR_IN_REF";
-static char __pyx_k_VCF__add_definition[] = "VCF._add_definition";
-static char __pyx_k_fileformat_VCFv_s_s[] = "##fileformat=VCFv%s.%s\n";
-static char __pyx_k_needs_to_be_checked[] = "needs to be checked";
-static char __pyx_k_sth_entry_not_found[] = "(%sth entry not found)";
-static char __pyx_k_BAD_NUMBER_OF_VALUES[] = "BAD_NUMBER_OF_VALUES";
-static char __pyx_k_ERROR_FLAG_HAS_VALUE[] = "ERROR_FLAG_HAS_VALUE";
-static char __pyx_k_Genotype_likelihoods[] = "Genotype likelihoods";
-static char __pyx_k_VCF_parse_formatdata[] = "VCF.parse_formatdata";
-static char __pyx_k_enter_default_format[] = "enter_default_format";
-static char __pyx_k_BAD_NUMBER_OF_COLUMNS[] = "BAD_NUMBER_OF_COLUMNS";
-static char __pyx_k_ERROR_FORMAT_NOT_CHAR[] = "ERROR_FORMAT_NOT_CHAR";
-static char __pyx_k_FORMAT_MISSING_QUOTES[] = "FORMAT_MISSING_QUOTES";
-static char __pyx_k_UNKNOWN_FORMAT_STRING[] = "UNKNOWN_FORMAT_STRING";
-static char __pyx_k_VCF_format_formatdata[] = "VCF.format_formatdata";
-static char __pyx_k_Invalid_error_string_s[] = "Invalid error string: %s";
-static char __pyx_k_Sample_Genotype_Filter[] = "Sample Genotype Filter";
-static char __pyx_k_V33_UNMATCHED_DELETION[] = "V33_UNMATCHED_DELETION";
-static char __pyx_k_BADLY_FORMATTED_HEADING[] = "BADLY_FORMATTED_HEADING";
-static char __pyx_k_ZERO_FOR_NON_FLAG_FIELD[] = "ZERO_FOR_NON_FLAG_FIELD";
-static char __pyx_k_BAD_NUMBER_OF_PARAMETERS[] = "BAD_NUMBER_OF_PARAMETERS";
-static char __pyx_k_ERROR_FORMAT_NOT_INTEGER[] = "ERROR_FORMAT_NOT_INTEGER";
-static char __pyx_k_VCF_enter_default_format[] = "VCF.enter_default_format";
-static char __pyx_k_reference_is_s_VCF_says_s[] = "(reference is %s, VCF says %s)";
-static char __pyx_k_ERROR_FORMAT_NOT_NUMERICAL[] = "ERROR_FORMAT_NOT_NUMERICAL";
-static char __pyx_k_V40_MISSING_ANGLE_BRACKETS[] = "V40_MISSING_ANGLE_BRACKETS";
-static char __pyx_k_WRONG_REF_Wrong_reference_s[] = "WRONG_REF:Wrong reference %s";
-static char __pyx_k_Conditional_genotype_quality[] = "Conditional genotype quality";
-static char __pyx_k_deletion_is_s_reference_is_s[] = "(deletion is %s, reference is %s)";
-static char __pyx_k_BADLY_FORMATTED_FORMAT_STRING[] = "BADLY_FORMATTED_FORMAT_STRING";
-static char __pyx_k_HEADING_NOT_SEPARATED_BY_TABS[] = "HEADING_NOT_SEPARATED_BY_TABS";
-static char __pyx_k_MISSING_INDEL_ALLELE_REF_BASE[] = "MISSING_INDEL_ALLELE_REF_BASE";
-static char __pyx_k_home_andreas_devel_pysam_pysam[] = "/home/andreas/devel/pysam/pysam/cvcf.pyx";
-static char __pyx_k_BADLY_FORMATTED_HEADING_Did_not[] = "BADLY_FORMATTED_HEADING:Did not find 9 required headings (CHROM, POS, ..., FORMAT) %s";
-static char __pyx_k_ERROR_FORMAT_NOT_CHAR_Eexpected[] = "ERROR_FORMAT_NOT_CHAR:Eexpected character in formatted field; got string";
-static char __pyx_k_ERROR_UNKNOWN_KEY_Unknown_key_s[] = "ERROR_UNKNOWN_KEY:Unknown key (%s) found in formatted field (info; format; or filter)";
-static char __pyx_k_Expected_alternate_allel_counts[] = "Expected alternate allel counts";
-static char __pyx_k_FILTER_NOT_DEFINED_Identifier_s[] = "FILTER_NOT_DEFINED:Identifier (%s) in filter found which was not defined in header";
-static char __pyx_k_FORMAT_NOT_DEFINED_Identifier_s[] = "FORMAT_NOT_DEFINED:Identifier (%s) in format found which was not defined in header";
-static char __pyx_k_POS_NOT_POSITIVE_Position_field[] = "POS_NOT_POSITIVE:Position field must be >0";
-static char __pyx_k_Read_depth_at_this_position_for[] = "Read depth at this position for this sample";
-static char __pyx_k_Unknown_number_type_encountered[] = "Unknown number type encountered: %s";
-static char __pyx_k_V33_BAD_ALLELE_Cannot_interpret[] = "V33_BAD_ALLELE:Cannot interpret allele for v3.3 VCF";
-static char __pyx_k_V33_BAD_REF_Reference_should_be[] = "V33_BAD_REF:Reference should be single-character in v3.3 VCF";
-static char __pyx_k_V40_BAD_ALLELE_Bad_allele_found[] = "V40_BAD_ALLELE:Bad allele found for v4.0 VCF (%s)";
-static char __pyx_k_found_s_values_in_element_s_exp[] = "(found %s values in element %s; expected %s)";
-static char __pyx_k_BADLY_FORMATTED_FORMAT_STRING_Fo[] = "BADLY_FORMATTED_FORMAT_STRING:Formatting error in the format string";
-static char __pyx_k_BAD_CHR_TAG_Error_calculating_ch[] = "BAD_CHR_TAG:Error calculating chr tag for %s";
-static char __pyx_k_BAD_GENOTYPE_Cannot_parse_genoty[] = "BAD_GENOTYPE:Cannot parse genotype (%s)";
-static char __pyx_k_BAD_NUMBER_OF_COLUMNS_Wrong_numb[] = "BAD_NUMBER_OF_COLUMNS:Wrong number of columns found (%s)";
-static char __pyx_k_BAD_NUMBER_OF_PARAMETERS_Found_u[] = "BAD_NUMBER_OF_PARAMETERS:Found unexpected number of parameters (%s)";
-static char __pyx_k_BAD_NUMBER_OF_VALUES_Found_too_m[] = "BAD_NUMBER_OF_VALUES:Found too many of values in sample column (%s)";
-static char __pyx_k_Can_only_handle_v3_3_and_v4_0_VC[] = "Can only handle v3.3 and v4.0 VCF files";
-static char __pyx_k_Don_t_understand_region_string_s[] = "Don't understand region string '%s'";
-static char __pyx_k_ERROR_FLAG_HAS_VALUE_Flag_fields[] = "ERROR_FLAG_HAS_VALUE:Flag fields should not have a value";
-static char __pyx_k_ERROR_FORMAT_NOT_INTEGER_Expecte[] = "ERROR_FORMAT_NOT_INTEGER:Expected integer in formatted field; got %s";
-static char __pyx_k_ERROR_FORMAT_NOT_NUMERICAL_Expec[] = "ERROR_FORMAT_NOT_NUMERICAL:Expected integer or float in formatted field; got %s";
-static char __pyx_k_ERROR_INFO_STRING_Error_while_pa[] = "ERROR_INFO_STRING:Error while parsing info field";
-static char __pyx_k_ERROR_TRAILING_DATA_Numerical_fi[] = "ERROR_TRAILING_DATA:Numerical field ('%s') has semicolon-separated trailing data";
-static char __pyx_k_FORMAT_MISSING_QUOTES_Descriptio[] = "FORMAT_MISSING_QUOTES:Description field in format definition is not surrounded by quotes";
-static char __pyx_k_Genotype_posterior_probabilities[] = "Genotype posterior probabilities";
-static char __pyx_k_HEADING_NOT_SEPARATED_BY_TABS_He[] = "HEADING_NOT_SEPARATED_BY_TABS:Heading line appears separated by spaces, not tabs";
-static char __pyx_k_MISSING_INDEL_ALLELE_REF_BASE_In[] = "MISSING_INDEL_ALLELE_REF_BASE:Indel alleles must begin with single reference base";
-static char __pyx_k_MISSING_REF_Reference_allele_mis[] = "MISSING_REF:Reference allele missing";
-static char __pyx_k_POS_NOT_NUMERICAL_Position_colum[] = "POS_NOT_NUMERICAL:Position column is not numerical";
-static char __pyx_k_Phred_scaled_genotype_likelihood[] = "Phred-scaled genotype likelihoods";
-static char __pyx_k_QUAL_NOT_NUMERICAL_Quality_field[] = "QUAL_NOT_NUMERICAL:Quality field must be numerical, or '.'";
-static char __pyx_k_Required_key_s_not_found_in_data[] = "Required key %s not found in data";
-static char __pyx_k_UNKNOWN_CHAR_IN_REF_Unknown_char[] = "UNKNOWN_CHAR_IN_REF:Unknown character in reference field";
-static char __pyx_k_UNKNOWN_FORMAT_STRING_Unknown_fi[] = "UNKNOWN_FORMAT_STRING:Unknown file format identifier";
-static char __pyx_k_V33_UNMATCHED_DELETION_Deleted_s[] = "V33_UNMATCHED_DELETION:Deleted sequence does not match reference (%s)";
-static char __pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD[] = "V40_FORMAT_MUST_HAVE_NAMED_FIELDS";
-static char __pyx_k_V40_MISSING_ANGLE_BRACKETS_Forma[] = "V40_MISSING_ANGLE_BRACKETS:Format definition is not deliminted by angular brackets";
-static char __pyx_k_ZERO_FOR_NON_FLAG_FIELD_number_s[] = "ZERO_FOR_NON_FLAG_FIELD: number set to 0, but type is not 'FLAG'";
-static char __pyx_k_ZERO_LENGTH_ALLELE_Found_zero_le[] = "ZERO_LENGTH_ALLELE:Found zero-length allele";
-static char __pyx_k_expected_s_for_s_samples_s_got_s[] = "expected %s for %s samples (%s), got %s";
-static char __pyx_k_id_numbertype_number_type_descri[] = "id numbertype number type description missingvalue";
-static char __pyx_k_id_s_expected_s_parameters_got_s[] = "id=%s, expected %s parameters, got %s";
-static char __pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2[] = "V40_FORMAT_MUST_HAVE_NAMED_FIELDS:Fields in v4.0 VCF format definition must have named fields";
-static PyObject *__pyx_kp_s_;
-static PyObject *__pyx_kp_b_0;
-static PyObject *__pyx_kp_s_0;
-static PyObject *__pyx_n_s_A;
-static PyObject *__pyx_n_s_ACGTN;
-static PyObject *__pyx_kp_s_ACGTN_2;
-static PyObject *__pyx_n_s_ALT;
-static PyObject *__pyx_n_s_BADLY_FORMATTED_FORMAT_STRING;
-static PyObject *__pyx_kp_s_BADLY_FORMATTED_FORMAT_STRING_Fo;
-static PyObject *__pyx_n_s_BADLY_FORMATTED_HEADING;
-static PyObject *__pyx_kp_s_BADLY_FORMATTED_HEADING_Did_not;
-static PyObject *__pyx_kp_s_BAD_CHR_TAG_Error_calculating_ch;
-static PyObject *__pyx_n_s_BAD_GENOTYPE;
-static PyObject *__pyx_kp_s_BAD_GENOTYPE_Cannot_parse_genoty;
-static PyObject *__pyx_n_s_BAD_NUMBER_OF_COLUMNS;
-static PyObject *__pyx_kp_s_BAD_NUMBER_OF_COLUMNS_Wrong_numb;
-static PyObject *__pyx_n_s_BAD_NUMBER_OF_PARAMETERS;
-static PyObject *__pyx_kp_s_BAD_NUMBER_OF_PARAMETERS_Found_u;
-static PyObject *__pyx_n_s_BAD_NUMBER_OF_VALUES;
-static PyObject *__pyx_kp_s_BAD_NUMBER_OF_VALUES_Found_too_m;
-static PyObject *__pyx_n_s_CHROM;
-static PyObject *__pyx_kp_s_Can_only_handle_v3_3_and_v4_0_VC;
-static PyObject *__pyx_n_s_Character;
-static PyObject *__pyx_kp_s_Conditional_genotype_quality;
-static PyObject *__pyx_n_s_D;
-static PyObject *__pyx_n_s_DP;
-static PyObject *__pyx_kp_s_Description;
-static PyObject *__pyx_n_s_Description_2;
-static PyObject *__pyx_kp_s_Don_t_understand_region_string_s;
-static PyObject *__pyx_n_s_EC;
-static PyObject *__pyx_n_s_ERROR_FLAG_HAS_VALUE;
-static PyObject *__pyx_kp_s_ERROR_FLAG_HAS_VALUE_Flag_fields;
-static PyObject *__pyx_n_s_ERROR_FORMAT_NOT_CHAR;
-static PyObject *__pyx_kp_s_ERROR_FORMAT_NOT_CHAR_Eexpected;
-static PyObject *__pyx_n_s_ERROR_FORMAT_NOT_INTEGER;
-static PyObject *__pyx_kp_s_ERROR_FORMAT_NOT_INTEGER_Expecte;
-static PyObject *__pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL;
-static PyObject *__pyx_kp_s_ERROR_FORMAT_NOT_NUMERICAL_Expec;
-static PyObject *__pyx_n_s_ERROR_INFO_STRING;
-static PyObject *__pyx_kp_s_ERROR_INFO_STRING_Error_while_pa;
-static PyObject *__pyx_n_s_ERROR_TRAILING_DATA;
-static PyObject *__pyx_kp_s_ERROR_TRAILING_DATA_Numerical_fi;
-static PyObject *__pyx_n_s_ERROR_UNKNOWN_KEY;
-static PyObject *__pyx_kp_s_ERROR_UNKNOWN_KEY_Unknown_key_s;
-static PyObject *__pyx_n_s_Error;
-static PyObject *__pyx_kp_s_Expected_alternate_allel_counts;
-static PyObject *__pyx_n_s_FILTER;
-static PyObject *__pyx_n_s_FILTER_NOT_DEFINED;
-static PyObject *__pyx_kp_s_FILTER_NOT_DEFINED_Identifier_s;
-static PyObject *__pyx_n_s_FORMAT;
-static PyObject *__pyx_n_s_FORMAT_MISSING_QUOTES;
-static PyObject *__pyx_kp_s_FORMAT_MISSING_QUOTES_Descriptio;
-static PyObject *__pyx_n_s_FORMAT_NOT_DEFINED;
-static PyObject *__pyx_kp_s_FORMAT_NOT_DEFINED_Identifier_s;
-static PyObject *__pyx_n_s_FT;
-static PyObject *__pyx_n_s_Flag;
-static PyObject *__pyx_n_s_Float;
-static PyObject *__pyx_n_s_G;
-static PyObject *__pyx_n_s_GL;
-static PyObject *__pyx_n_s_GLE;
-static PyObject *__pyx_n_s_GP;
-static PyObject *__pyx_n_s_GQ;
-static PyObject *__pyx_n_s_GT;
-static PyObject *__pyx_n_s_GTdata;
-static PyObject *__pyx_n_s_GTstring;
-static PyObject *__pyx_n_s_Genotype;
-static PyObject *__pyx_kp_s_Genotype_Quality;
-static PyObject *__pyx_kp_s_Genotype_likelihoods;
-static PyObject *__pyx_kp_s_Genotype_posterior_probabilities;
-static PyObject *__pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS;
-static PyObject *__pyx_kp_s_HEADING_NOT_SEPARATED_BY_TABS_He;
-static PyObject *__pyx_n_s_HQ;
-static PyObject *__pyx_kp_s_Haplotype_Quality;
-static PyObject *__pyx_n_s_I;
-static PyObject *__pyx_kp_s_ID;
-static PyObject *__pyx_n_s_ID_2;
-static PyObject *__pyx_n_s_INFO;
-static PyObject *__pyx_n_s_Integer;
-static PyObject *__pyx_kp_s_Invalid_error_string_s;
-static PyObject *__pyx_n_s_KeyError;
-static PyObject *__pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE;
-static PyObject *__pyx_kp_s_MISSING_INDEL_ALLELE_REF_BASE_In;
-static PyObject *__pyx_n_s_MISSING_REF;
-static PyObject *__pyx_kp_s_MISSING_REF_Reference_allele_mis;
-static PyObject *__pyx_n_s_MQ;
-static PyObject *__pyx_n_s_N;
-static PyObject *__pyx_n_s_NT_ALLELES;
-static PyObject *__pyx_n_s_NT_GENOTYPES;
-static PyObject *__pyx_n_s_NT_NR_ALLELES;
-static PyObject *__pyx_n_s_NT_NUMBER;
-static PyObject *__pyx_n_s_NT_PHASED_GENOTYPES;
-static PyObject *__pyx_n_s_NT_UNKNOWN;
-static PyObject *__pyx_n_s_NotImplementedError;
-static PyObject *__pyx_kp_s_Number;
-static PyObject *__pyx_n_s_Number_2;
-static PyObject *__pyx_n_b_PASS;
-static PyObject *__pyx_n_s_PASS;
-static PyObject *__pyx_n_s_PL;
-static PyObject *__pyx_n_s_POS;
-static PyObject *__pyx_n_s_POS_NOT_NUMERICAL;
-static PyObject *__pyx_kp_s_POS_NOT_NUMERICAL_Position_colum;
-static PyObject *__pyx_n_s_POS_NOT_POSITIVE;
-static PyObject *__pyx_kp_s_POS_NOT_POSITIVE_Position_field;
-static PyObject *__pyx_n_s_PQ;
-static PyObject *__pyx_n_s_PS;
-static PyObject *__pyx_kp_s_Phase_set;
-static PyObject *__pyx_kp_s_Phasing_quality;
-static PyObject *__pyx_kp_s_Phred_scaled_genotype_likelihood;
-static PyObject *__pyx_n_s_QUAL;
-static PyObject *__pyx_n_s_QUAL_NOT_NUMERICAL;
-static PyObject *__pyx_kp_s_QUAL_NOT_NUMERICAL_Quality_field;
-static PyObject *__pyx_n_s_REF;
-static PyObject *__pyx_kp_s_RMS_mapping_quality;
-static PyObject *__pyx_kp_s_Read_depth_at_this_position_for;
-static PyObject *__pyx_kp_s_Required_key_s_not_found_in_data;
-static PyObject *__pyx_kp_s_Sample_Genotype_Filter;
-static PyObject *__pyx_n_s_StopIteration;
-static PyObject *__pyx_n_s_String;
-static PyObject *__pyx_n_s_Tabixfile;
-static PyObject *__pyx_kp_s_Type;
-static PyObject *__pyx_n_s_Type_2;
-static PyObject *__pyx_n_s_UNKNOWN_CHAR_IN_REF;
-static PyObject *__pyx_kp_s_UNKNOWN_CHAR_IN_REF_Unknown_char;
-static PyObject *__pyx_n_s_UNKNOWN_FORMAT_STRING;
-static PyObject *__pyx_kp_s_UNKNOWN_FORMAT_STRING_Unknown_fi;
-static PyObject *__pyx_kp_s_Undefined_tag;
-static PyObject *__pyx_kp_s_Unknown_number_type_encountered;
-static PyObject *__pyx_n_s_V33_BAD_ALLELE;
-static PyObject *__pyx_kp_s_V33_BAD_ALLELE_Cannot_interpret;
-static PyObject *__pyx_n_s_V33_BAD_REF;
-static PyObject *__pyx_kp_s_V33_BAD_REF_Reference_should_be;
-static PyObject *__pyx_n_s_V33_UNMATCHED_DELETION;
-static PyObject *__pyx_kp_s_V33_UNMATCHED_DELETION_Deleted_s;
-static PyObject *__pyx_n_s_V40_BAD_ALLELE;
-static PyObject *__pyx_kp_s_V40_BAD_ALLELE_Bad_allele_found;
-static PyObject *__pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD;
-static PyObject *__pyx_kp_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2;
-static PyObject *__pyx_n_s_V40_MISSING_ANGLE_BRACKETS;
-static PyObject *__pyx_kp_s_V40_MISSING_ANGLE_BRACKETS_Forma;
-static PyObject *__pyx_n_s_VCF;
-static PyObject *__pyx_n_s_VCFRecord;
-static PyObject *__pyx_n_s_VCF___init;
-static PyObject *__pyx_n_s_VCF__add_definition;
-static PyObject *__pyx_n_s_VCF__parse;
-static PyObject *__pyx_n_s_VCF__parse_header;
-static PyObject *__pyx_n_s_VCF_compare_calls;
-static PyObject *__pyx_n_s_VCF_connect;
-static PyObject *__pyx_n_s_VCF_convertGT;
-static PyObject *__pyx_n_s_VCF_convertGTback;
-static PyObject *__pyx_n_s_VCF_enter_default_format;
-static PyObject *__pyx_n_s_VCF_error;
-static PyObject *__pyx_n_s_VCF_fetch;
-static PyObject *__pyx_n_s_VCF_format_format;
-static PyObject *__pyx_n_s_VCF_format_formatdata;
-static PyObject *__pyx_n_s_VCF_get_expected;
-static PyObject *__pyx_n_s_VCF_getfilter;
-static PyObject *__pyx_n_s_VCF_getformat;
-static PyObject *__pyx_n_s_VCF_getheader;
-static PyObject *__pyx_n_s_VCF_getinfo;
-static PyObject *__pyx_n_s_VCF_getsamples;
-static PyObject *__pyx_n_s_VCF_ignoreerror;
-static PyObject *__pyx_n_s_VCF_inregion;
-static PyObject *__pyx_n_s_VCF_parse;
-static PyObject *__pyx_n_s_VCF_parse_data;
-static PyObject *__pyx_n_s_VCF_parse_format;
-static PyObject *__pyx_n_s_VCF_parse_formatdata;
-static PyObject *__pyx_n_s_VCF_parse_header;
-static PyObject *__pyx_n_s_VCF_parse_heading;
-static PyObject *__pyx_n_s_VCF_setfilter;
-static PyObject *__pyx_n_s_VCF_setformat;
-static PyObject *__pyx_n_s_VCF_setheader;
-static PyObject *__pyx_n_s_VCF_setinfo;
-static PyObject *__pyx_n_s_VCF_setreference;
-static PyObject *__pyx_n_s_VCF_setregions;
-static PyObject *__pyx_n_s_VCF_setsamples;
-static PyObject *__pyx_n_s_VCF_setversion;
-static PyObject *__pyx_n_s_VCF_validate;
-static PyObject *__pyx_n_s_VCF_warnerror;
-static PyObject *__pyx_n_s_VCF_write;
-static PyObject *__pyx_n_s_VCF_write_data;
-static PyObject *__pyx_n_s_VCF_write_header;
-static PyObject *__pyx_n_s_VCF_write_heading;
-static PyObject *__pyx_n_s_VCF_writeheader;
-static PyObject *__pyx_kp_s_VCFv3_3;
-static PyObject *__pyx_kp_s_VCFv4_0;
-static PyObject *__pyx_kp_s_VCFv4_1;
-static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_n_s_WRONG_REF;
-static PyObject *__pyx_kp_s_WRONG_REF_Wrong_reference_s;
-static PyObject *__pyx_n_s_Warning;
-static PyObject *__pyx_n_s_ZERO_FOR_NON_FLAG_FIELD;
-static PyObject *__pyx_kp_s_ZERO_FOR_NON_FLAG_FIELD_number_s;
-static PyObject *__pyx_n_s_ZERO_LENGTH_ALLELE;
-static PyObject *__pyx_kp_s_ZERO_LENGTH_ALLELE_Found_zero_le;
-static PyObject *__pyx_kp_s__10;
-static PyObject *__pyx_kp_s__13;
-static PyObject *__pyx_kp_s__2;
-static PyObject *__pyx_kp_s__21;
-static PyObject *__pyx_kp_s__23;
-static PyObject *__pyx_kp_s__29;
-static PyObject *__pyx_kp_s__4;
-static PyObject *__pyx_kp_s__46;
-static PyObject *__pyx_kp_s__51;
-static PyObject *__pyx_kp_s__55;
-static PyObject *__pyx_kp_s__6;
-static PyObject *__pyx_kp_s__60;
-static PyObject *__pyx_kp_s__61;
-static PyObject *__pyx_kp_b__8;
-static PyObject *__pyx_kp_s__8;
-static PyObject *__pyx_kp_s__91;
-static PyObject *__pyx_n_s_a;
-static PyObject *__pyx_n_s_add;
-static PyObject *__pyx_n_s_add_definition;
-static PyObject *__pyx_n_s_addn;
-static PyObject *__pyx_n_s_addns;
-static PyObject *__pyx_n_s_all;
-static PyObject *__pyx_n_s_allele;
-static PyObject *__pyx_n_s_alleleRegEx;
-static PyObject *__pyx_kp_s_alleles;
-static PyObject *__pyx_n_s_alt;
-static PyObject *__pyx_n_s_alt1;
-static PyObject *__pyx_n_s_alt2;
-static PyObject *__pyx_n_s_append;
-static PyObject *__pyx_n_s_args;
-static PyObject *__pyx_n_s_ascii;
-static PyObject *__pyx_n_s_bisect;
-static PyObject *__pyx_n_s_blurp;
-static PyObject *__pyx_n_s_c;
-static PyObject *__pyx_n_s_chrom;
-static PyObject *__pyx_n_s_close;
-static PyObject *__pyx_n_s_collections;
-static PyObject *__pyx_n_s_cols;
-static PyObject *__pyx_n_s_compare_calls;
-static PyObject *__pyx_n_s_compile;
-static PyObject *__pyx_n_s_connect;
-static PyObject *__pyx_n_s_convertGT;
-static PyObject *__pyx_n_s_convertGTback;
-static PyObject *__pyx_n_s_copy;
-static PyObject *__pyx_n_s_copy_2;
-static PyObject *__pyx_n_s_d;
-static PyObject *__pyx_n_s_data;
-static PyObject *__pyx_n_s_datagenerator;
-static PyObject *__pyx_n_s_deepcopy;
-static PyObject *__pyx_n_s_defaultdict;
-static PyObject *__pyx_kp_s_deletion_is_s_reference_is_s;
-static PyObject *__pyx_n_s_descr;
-static PyObject *__pyx_n_s_description;
-static PyObject *__pyx_n_s_dict;
-static PyObject *__pyx_n_s_dict_2;
-static PyObject *__pyx_n_s_doc;
-static PyObject *__pyx_n_s_elts;
-static PyObject *__pyx_n_s_encoding;
-static PyObject *__pyx_n_s_end;
-static PyObject *__pyx_n_s_endswith;
-static PyObject *__pyx_n_s_enter_default_format;
-static PyObject *__pyx_n_s_enumerate;
-static PyObject *__pyx_n_s_err;
-static PyObject *__pyx_n_s_error;
-static PyObject *__pyx_n_s_errorlabel;
-static PyObject *__pyx_n_s_errors;
-static PyObject *__pyx_n_s_errorstring;
-static PyObject *__pyx_n_s_errwarn;
-static PyObject *__pyx_n_s_expected;
-static PyObject *__pyx_kp_s_expected_s_for_s_samples_s_got_s;
-static PyObject *__pyx_n_s_f;
-static PyObject *__pyx_n_s_fa;
-static PyObject *__pyx_n_s_faref;
-static PyObject *__pyx_n_s_faref_leftflank;
-static PyObject *__pyx_n_s_fetch;
-static PyObject *__pyx_n_s_fileformat;
-static PyObject *__pyx_kp_s_fileformat_VCFv_s_s;
-static PyObject *__pyx_n_s_filename;
-static PyObject *__pyx_n_s_filter;
-static PyObject *__pyx_n_s_filter_2;
-static PyObject *__pyx_n_s_find;
-static PyObject *__pyx_n_s_first;
-static PyObject *__pyx_n_s_fmt;
-static PyObject *__pyx_n_s_format;
-static PyObject *__pyx_n_s_format_2;
-static PyObject *__pyx_n_s_format_format;
-static PyObject *__pyx_n_s_format_formatdata;
-static PyObject *__pyx_n_s_formatdict;
-static PyObject *__pyx_kp_s_found_s_expected_s;
-static PyObject *__pyx_kp_s_found_s_values_in_element_s_exp;
-static PyObject *__pyx_kp_s_genotypes;
-static PyObject *__pyx_n_s_get;
-static PyObject *__pyx_n_s_get_expected;
-static PyObject *__pyx_n_s_get_sequence;
-static PyObject *__pyx_n_s_getfilter;
-static PyObject *__pyx_n_s_getformat;
-static PyObject *__pyx_n_s_getheader;
-static PyObject *__pyx_n_s_getinfo;
-static PyObject *__pyx_n_s_getsamples;
-static PyObject *__pyx_n_s_gts;
-static PyObject *__pyx_n_s_gtsRegEx;
-static PyObject *__pyx_n_s_have_deletions;
-static PyObject *__pyx_n_s_header;
-static PyObject *__pyx_n_s_header_2;
-static PyObject *__pyx_n_s_headings;
-static PyObject *__pyx_kp_s_home_andreas_devel_pysam_pysam;
-static PyObject *__pyx_n_s_i;
-static PyObject *__pyx_n_s_id;
-static PyObject *__pyx_kp_s_id_numbertype_number_type_descri;
-static PyObject *__pyx_kp_s_id_s_expected_s_parameters_got_s;
-static PyObject *__pyx_n_s_idx;
-static PyObject *__pyx_n_s_ielts;
-static PyObject *__pyx_n_s_ignored_errors;
-static PyObject *__pyx_n_s_ignoreerror;
-static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_kp_s_in_line_s_s_s_s_s;
-static PyObject *__pyx_n_s_info;
-static PyObject *__pyx_n_s_info_2;
-static PyObject *__pyx_n_s_init;
-static PyObject *__pyx_n_s_inregion;
-static PyObject *__pyx_n_s_itemgetter;
-static PyObject *__pyx_n_s_itervalues;
-static PyObject *__pyx_n_s_join;
-static PyObject *__pyx_n_s_k;
-static PyObject *__pyx_n_s_key;
-static PyObject *__pyx_n_s_keys;
-static PyObject *__pyx_n_s_l;
-static PyObject *__pyx_n_s_label;
-static PyObject *__pyx_n_s_last;
-static PyObject *__pyx_n_s_last_line;
-static PyObject *__pyx_n_s_left;
-static PyObject *__pyx_n_s_leftalign;
-static PyObject *__pyx_n_s_leftalign_2;
-static PyObject *__pyx_n_s_line;
-static PyObject *__pyx_n_s_line_2;
-static PyObject *__pyx_n_s_lineno;
-static PyObject *__pyx_n_s_lineparse;
-static PyObject *__pyx_n_s_lines;
-static PyObject *__pyx_n_s_lines_2;
-static PyObject *__pyx_n_s_longest;
-static PyObject *__pyx_n_s_main;
-static PyObject *__pyx_n_s_map;
-static PyObject *__pyx_n_s_match;
-static PyObject *__pyx_n_s_metaclass;
-static PyObject *__pyx_n_s_min;
-static PyObject *__pyx_n_s_missing;
-static PyObject *__pyx_n_s_missingvalue;
-static PyObject *__pyx_n_s_module;
-static PyObject *__pyx_n_s_movable;
-static PyObject *__pyx_n_s_n;
-static PyObject *__pyx_n_s_na;
-static PyObject *__pyx_n_s_namedtuple;
-static PyObject *__pyx_kp_s_needs_to_be_checked;
-static PyObject *__pyx_n_s_newalts;
-static PyObject *__pyx_n_s_nmb;
-static PyObject *__pyx_kp_s_nonref_alleles;
-static PyObject *__pyx_n_s_number;
-static PyObject *__pyx_n_s_numbertype;
-static PyObject *__pyx_n_s_object;
-static PyObject *__pyx_n_s_operator;
-static PyObject *__pyx_n_s_opt;
-static PyObject *__pyx_kp_s_output;
-static PyObject *__pyx_n_s_output_2;
-static PyObject *__pyx_n_s_parse;
-static PyObject *__pyx_n_s_parse_2;
-static PyObject *__pyx_n_s_parse_data;
-static PyObject *__pyx_n_s_parse_format;
-static PyObject *__pyx_n_s_parse_formatdata;
-static PyObject *__pyx_n_s_parse_header;
-static PyObject *__pyx_n_s_parse_header_2;
-static PyObject *__pyx_n_s_parse_heading;
-static PyObject *__pyx_n_s_parse_regions;
-static PyObject *__pyx_n_s_parser;
-static PyObject *__pyx_kp_s_phased_genotypes;
-static PyObject *__pyx_n_s_pos;
-static PyObject *__pyx_n_s_pos1;
-static PyObject *__pyx_n_s_pos2;
-static PyObject *__pyx_n_s_prepare;
-static PyObject *__pyx_n_s_pysam;
-static PyObject *__pyx_n_s_pysam_cvcf;
-static PyObject *__pyx_n_s_pyx_vtable;
-static PyObject *__pyx_n_s_qual;
-static PyObject *__pyx_n_s_qualname;
-static PyObject *__pyx_n_s_r;
-static PyObject *__pyx_n_s_range;
-static PyObject *__pyx_n_s_re;
-static PyObject *__pyx_n_s_record;
-static PyObject *__pyx_n_s_ref;
-static PyObject *__pyx_n_s_ref1;
-static PyObject *__pyx_n_s_ref2;
-static PyObject *__pyx_n_s_reference;
-static PyObject *__pyx_n_s_reference_2;
-static PyObject *__pyx_kp_s_reference_is_s_VCF_says_s;
-static PyObject *__pyx_n_s_region;
-static PyObject *__pyx_n_s_regions;
-static PyObject *__pyx_n_s_regions_2;
-static PyObject *__pyx_n_s_replace;
-static PyObject *__pyx_n_s_required;
-static PyObject *__pyx_n_s_required_2;
-static PyObject *__pyx_n_s_rest;
-static PyObject *__pyx_n_s_result;
-static PyObject *__pyx_n_s_s;
-static PyObject *__pyx_kp_s_s_s;
-static PyObject *__pyx_kp_s_s_s_2;
-static PyObject *__pyx_n_s_sample;
-static PyObject *__pyx_n_s_sample2column;
-static PyObject *__pyx_n_s_samples;
-static PyObject *__pyx_n_s_samples_2;
-static PyObject *__pyx_n_s_sdata;
-static PyObject *__pyx_n_s_self;
-static PyObject *__pyx_n_s_send;
-static PyObject *__pyx_n_s_separator;
-static PyObject *__pyx_n_s_sequence;
-static PyObject *__pyx_n_s_setfilter;
-static PyObject *__pyx_n_s_setformat;
-static PyObject *__pyx_n_s_setheader;
-static PyObject *__pyx_n_s_setinfo;
-static PyObject *__pyx_n_s_setreference;
-static PyObject *__pyx_n_s_setregions;
-static PyObject *__pyx_n_s_setsamples;
-static PyObject *__pyx_n_s_setversion;
-static PyObject *__pyx_n_s_shortest;
-static PyObject *__pyx_n_s_split;
-static PyObject *__pyx_n_s_start;
-static PyObject *__pyx_n_s_startswith;
-static PyObject *__pyx_kp_s_sth_entry_not_found;
-static PyObject *__pyx_n_s_stream;
-static PyObject *__pyx_n_s_string;
-static PyObject *__pyx_n_s_strip;
-static PyObject *__pyx_n_s_sys;
-static PyObject *__pyx_n_s_t;
-static PyObject *__pyx_n_s_tabixfile;
-static PyObject *__pyx_n_s_test;
-static PyObject *__pyx_n_s_throw;
-static PyObject *__pyx_n_s_type;
-static PyObject *__pyx_n_s_upper;
-static PyObject *__pyx_n_s_v;
-static PyObject *__pyx_n_s_validate;
-static PyObject *__pyx_n_s_value;
-static PyObject *__pyx_n_s_values;
-static PyObject *__pyx_n_s_var;
-static PyObject *__pyx_n_s_vcf;
-static PyObject *__pyx_n_s_vcffile;
-static PyObject *__pyx_n_s_version;
-static PyObject *__pyx_n_s_version_2;
-static PyObject *__pyx_n_s_warn_errors;
-static PyObject *__pyx_n_s_warnerror;
-static PyObject *__pyx_n_s_write;
-static PyObject *__pyx_n_s_write_data;
-static PyObject *__pyx_n_s_write_header;
-static PyObject *__pyx_n_s_write_heading;
-static PyObject *__pyx_n_s_writeheader;
-static PyObject *__pyx_n_s_x;
-static PyObject *__pyx_n_s_y;
-static PyObject *__pyx_n_s_zip;
-static PyObject *__pyx_float_0_0;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_2;
-static PyObject *__pyx_int_3;
-static PyObject *__pyx_int_4;
-static PyObject *__pyx_int_5;
-static PyObject *__pyx_int_6;
-static PyObject *__pyx_int_7;
-static PyObject *__pyx_int_8;
-static PyObject *__pyx_int_9;
-static PyObject *__pyx_int_10;
-static PyObject *__pyx_int_11;
-static PyObject *__pyx_int_12;
-static PyObject *__pyx_int_13;
-static PyObject *__pyx_int_14;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_int_16;
-static PyObject *__pyx_int_17;
-static PyObject *__pyx_int_18;
-static PyObject *__pyx_int_19;
-static PyObject *__pyx_int_20;
-static PyObject *__pyx_int_21;
-static PyObject *__pyx_int_22;
-static PyObject *__pyx_int_23;
-static PyObject *__pyx_int_24;
-static PyObject *__pyx_int_25;
-static PyObject *__pyx_int_26;
-static PyObject *__pyx_int_27;
-static PyObject *__pyx_int_28;
-static PyObject *__pyx_int_29;
-static PyObject *__pyx_int_30;
-static PyObject *__pyx_int_31;
-static PyObject *__pyx_int_32;
-static PyObject *__pyx_int_33;
-static PyObject *__pyx_int_40;
-static PyObject *__pyx_int_100;
-static PyObject *__pyx_int_3000000000;
-static PyObject *__pyx_int_neg_1;
-static PyObject *__pyx_tuple__3;
-static PyObject *__pyx_tuple__5;
-static PyObject *__pyx_tuple__7;
-static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__18;
-static PyObject *__pyx_slice__19;
-static PyObject *__pyx_slice__25;
-static PyObject *__pyx_slice__27;
-static PyObject *__pyx_slice__42;
-static PyObject *__pyx_slice__48;
-static PyObject *__pyx_slice__50;
-static PyObject *__pyx_slice__54;
-static PyObject *__pyx_slice__57;
-static PyObject *__pyx_slice__58;
-static PyObject *__pyx_slice__59;
-static PyObject *__pyx_slice__71;
-static PyObject *__pyx_slice__73;
-static PyObject *__pyx_slice__74;
-static PyObject *__pyx_slice__76;
-static PyObject *__pyx_slice__77;
-static PyObject *__pyx_slice__78;
-static PyObject *__pyx_slice__79;
-static PyObject *__pyx_slice__80;
-static PyObject *__pyx_slice__86;
-static PyObject *__pyx_slice__87;
-static PyObject *__pyx_slice__88;
-static PyObject *__pyx_slice__89;
-static PyObject *__pyx_tuple__11;
-static PyObject *__pyx_tuple__12;
-static PyObject *__pyx_tuple__14;
-static PyObject *__pyx_tuple__15;
-static PyObject *__pyx_tuple__16;
-static PyObject *__pyx_tuple__17;
-static PyObject *__pyx_tuple__20;
-static PyObject *__pyx_tuple__22;
-static PyObject *__pyx_tuple__24;
-static PyObject *__pyx_tuple__26;
-static PyObject *__pyx_tuple__28;
-static PyObject *__pyx_tuple__30;
-static PyObject *__pyx_tuple__31;
-static PyObject *__pyx_tuple__32;
-static PyObject *__pyx_tuple__33;
-static PyObject *__pyx_tuple__34;
-static PyObject *__pyx_tuple__35;
-static PyObject *__pyx_tuple__36;
-static PyObject *__pyx_tuple__37;
-static PyObject *__pyx_tuple__38;
-static PyObject *__pyx_tuple__39;
-static PyObject *__pyx_tuple__40;
-static PyObject *__pyx_tuple__41;
-static PyObject *__pyx_tuple__43;
-static PyObject *__pyx_tuple__44;
-static PyObject *__pyx_tuple__45;
-static PyObject *__pyx_tuple__47;
-static PyObject *__pyx_tuple__49;
-static PyObject *__pyx_tuple__52;
-static PyObject *__pyx_tuple__53;
-static PyObject *__pyx_tuple__56;
-static PyObject *__pyx_tuple__62;
-static PyObject *__pyx_tuple__63;
-static PyObject *__pyx_tuple__64;
-static PyObject *__pyx_tuple__65;
-static PyObject *__pyx_tuple__66;
-static PyObject *__pyx_tuple__67;
-static PyObject *__pyx_tuple__68;
-static PyObject *__pyx_tuple__69;
-static PyObject *__pyx_tuple__70;
-static PyObject *__pyx_tuple__72;
-static PyObject *__pyx_tuple__75;
-static PyObject *__pyx_tuple__81;
-static PyObject *__pyx_tuple__82;
-static PyObject *__pyx_tuple__83;
-static PyObject *__pyx_tuple__84;
-static PyObject *__pyx_tuple__85;
-static PyObject *__pyx_tuple__90;
-static PyObject *__pyx_tuple__92;
-static PyObject *__pyx_tuple__93;
-static PyObject *__pyx_tuple__94;
-static PyObject *__pyx_tuple__96;
-static PyObject *__pyx_tuple__98;
-static PyObject *__pyx_tuple__99;
-static PyObject *__pyx_tuple__101;
-static PyObject *__pyx_tuple__102;
-static PyObject *__pyx_tuple__104;
-static PyObject *__pyx_tuple__105;
-static PyObject *__pyx_tuple__107;
-static PyObject *__pyx_tuple__108;
-static PyObject *__pyx_tuple__110;
-static PyObject *__pyx_tuple__111;
-static PyObject *__pyx_tuple__113;
-static PyObject *__pyx_tuple__115;
-static PyObject *__pyx_tuple__117;
-static PyObject *__pyx_tuple__118;
-static PyObject *__pyx_tuple__120;
-static PyObject *__pyx_tuple__122;
-static PyObject *__pyx_tuple__124;
-static PyObject *__pyx_tuple__126;
-static PyObject *__pyx_tuple__128;
-static PyObject *__pyx_tuple__130;
-static PyObject *__pyx_tuple__132;
-static PyObject *__pyx_tuple__134;
-static PyObject *__pyx_tuple__136;
-static PyObject *__pyx_tuple__138;
-static PyObject *__pyx_tuple__139;
-static PyObject *__pyx_tuple__141;
-static PyObject *__pyx_tuple__143;
-static PyObject *__pyx_tuple__145;
-static PyObject *__pyx_tuple__147;
-static PyObject *__pyx_tuple__149;
-static PyObject *__pyx_tuple__151;
-static PyObject *__pyx_tuple__153;
-static PyObject *__pyx_tuple__155;
-static PyObject *__pyx_tuple__157;
-static PyObject *__pyx_tuple__159;
-static PyObject *__pyx_tuple__161;
-static PyObject *__pyx_tuple__163;
-static PyObject *__pyx_tuple__165;
-static PyObject *__pyx_tuple__167;
-static PyObject *__pyx_tuple__169;
-static PyObject *__pyx_tuple__171;
-static PyObject *__pyx_tuple__173;
-static PyObject *__pyx_tuple__175;
-static PyObject *__pyx_tuple__177;
-static PyObject *__pyx_tuple__179;
-static PyObject *__pyx_tuple__181;
-static PyObject *__pyx_tuple__183;
-static PyObject *__pyx_tuple__185;
-static PyObject *__pyx_tuple__186;
-static PyObject *__pyx_tuple__188;
-static PyObject *__pyx_tuple__189;
-static PyObject *__pyx_codeobj__95;
-static PyObject *__pyx_codeobj__97;
-static PyObject *__pyx_codeobj__100;
-static PyObject *__pyx_codeobj__103;
-static PyObject *__pyx_codeobj__106;
-static PyObject *__pyx_codeobj__109;
-static PyObject *__pyx_codeobj__112;
-static PyObject *__pyx_codeobj__114;
-static PyObject *__pyx_codeobj__116;
-static PyObject *__pyx_codeobj__119;
-static PyObject *__pyx_codeobj__121;
-static PyObject *__pyx_codeobj__123;
-static PyObject *__pyx_codeobj__125;
-static PyObject *__pyx_codeobj__127;
-static PyObject *__pyx_codeobj__129;
-static PyObject *__pyx_codeobj__131;
-static PyObject *__pyx_codeobj__133;
-static PyObject *__pyx_codeobj__135;
-static PyObject *__pyx_codeobj__137;
-static PyObject *__pyx_codeobj__140;
-static PyObject *__pyx_codeobj__142;
-static PyObject *__pyx_codeobj__144;
-static PyObject *__pyx_codeobj__146;
-static PyObject *__pyx_codeobj__148;
-static PyObject *__pyx_codeobj__150;
-static PyObject *__pyx_codeobj__152;
-static PyObject *__pyx_codeobj__154;
-static PyObject *__pyx_codeobj__156;
-static PyObject *__pyx_codeobj__158;
-static PyObject *__pyx_codeobj__160;
-static PyObject *__pyx_codeobj__162;
-static PyObject *__pyx_codeobj__164;
-static PyObject *__pyx_codeobj__166;
-static PyObject *__pyx_codeobj__168;
-static PyObject *__pyx_codeobj__170;
-static PyObject *__pyx_codeobj__172;
-static PyObject *__pyx_codeobj__174;
-static PyObject *__pyx_codeobj__176;
-static PyObject *__pyx_codeobj__178;
-static PyObject *__pyx_codeobj__180;
-static PyObject *__pyx_codeobj__182;
-static PyObject *__pyx_codeobj__184;
-static PyObject *__pyx_codeobj__187;
-static PyObject *__pyx_codeobj__190;
-
-/* "pysam/cvcf.pyx":60
- * 
- * # Utility function.  Uses 0-based coordinates
- * def get_sequence(chrom, start, end, fa):             # <<<<<<<<<<<<<<
- *     # obtain sequence from .fa file, without truncation
- *     if end<=start: return ""
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_1get_sequence(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_1get_sequence = {__Pyx_NAMESTR("get_sequence"), (PyCFunction)__pyx_pw_5pysam_4cvcf_1get_sequence, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_1get_sequence(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_chrom = 0;
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_end = 0;
-  PyObject *__pyx_v_fa = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_sequence (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_chrom,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_fa,0};
-    PyObject* values[4] = {0,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  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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fa)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_sequence") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
-      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);
-      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
-    }
-    __pyx_v_chrom = values[0];
-    __pyx_v_start = values[1];
-    __pyx_v_end = values[2];
-    __pyx_v_fa = values[3];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get_sequence", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.get_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_get_sequence(__pyx_self, __pyx_v_chrom, __pyx_v_start, __pyx_v_end, __pyx_v_fa);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_get_sequence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_fa) {
-  PyObject *__pyx_v_sequence = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  Py_ssize_t __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("get_sequence", 0);
-
-  /* "pysam/cvcf.pyx":62
- * def get_sequence(chrom, start, end, fa):
- *     # obtain sequence from .fa file, without truncation
- *     if end<=start: return ""             # <<<<<<<<<<<<<<
- *     if not fa: return "N"*(end-start)
- *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
- */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_end, __pyx_v_start, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_kp_s_);
-    __pyx_r = __pyx_kp_s_;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":63
- *     # obtain sequence from .fa file, without truncation
- *     if end<=start: return ""
- *     if not fa: return "N"*(end-start)             # <<<<<<<<<<<<<<
- *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
- *     sequence = fa.fetch(chrom, start, end).upper()
- */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fa); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = ((!__pyx_t_2) != 0);
-  if (__pyx_t_3) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = PyNumber_Multiply(__pyx_n_s_N, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_r = __pyx_t_4;
-    __pyx_t_4 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":64
- *     if end<=start: return ""
- *     if not fa: return "N"*(end-start)
- *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()             # <<<<<<<<<<<<<<
- *     sequence = fa.fetch(chrom, start, end).upper()
- *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
- */
-  __pyx_t_4 = PyObject_RichCompare(__pyx_v_start, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_3) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = PyNumber_Negative(__pyx_v_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyNumber_Multiply(__pyx_n_s_N, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_INCREF(__pyx_v_chrom);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
-    __Pyx_GIVEREF(__pyx_v_chrom);
-    __Pyx_INCREF(__pyx_int_0);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
-    __Pyx_GIVEREF(__pyx_int_0);
-    __Pyx_INCREF(__pyx_v_end);
-    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_end);
-    __Pyx_GIVEREF(__pyx_v_end);
-    __Pyx_INCREF(__pyx_v_fa);
-    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_fa);
-    __Pyx_GIVEREF(__pyx_v_fa);
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_upper); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_r = __pyx_t_5;
-    __pyx_t_5 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":65
- *     if not fa: return "N"*(end-start)
- *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
- *     sequence = fa.fetch(chrom, start, end).upper()             # <<<<<<<<<<<<<<
- *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
- *     return sequence
- */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fa, __pyx_n_s_fetch); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_INCREF(__pyx_v_chrom);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_chrom);
-  __Pyx_GIVEREF(__pyx_v_chrom);
-  __Pyx_INCREF(__pyx_v_start);
-  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_start);
-  __Pyx_GIVEREF(__pyx_v_start);
-  __Pyx_INCREF(__pyx_v_end);
-  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_end);
-  __Pyx_GIVEREF(__pyx_v_end);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_upper); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_v_sequence = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":66
- *     if start<0: return "N"*(-start) + get_sequence(chrom, 0, end, fa).upper()
- *     sequence = fa.fetch(chrom, start, end).upper()
- *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))             # <<<<<<<<<<<<<<
- *     return sequence
- * 
- */
-  __pyx_t_7 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_6 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_5 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_7 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = PyNumber_Multiply(__pyx_n_s_N, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sequence, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF_SET(__pyx_v_sequence, __pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
-
-  /* "pysam/cvcf.pyx":67
- *     sequence = fa.fetch(chrom, start, end).upper()
- *     if len(sequence) < end-start: sequence += "N"*(end-start-len(sequence))
- *     return sequence             # <<<<<<<<<<<<<<
- * 
- * # Utility function.  Parses a region string
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_sequence);
-  __pyx_r = __pyx_v_sequence;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":60
- * 
- * # Utility function.  Uses 0-based coordinates
- * def get_sequence(chrom, start, end, fa):             # <<<<<<<<<<<<<<
- *     # obtain sequence from .fa file, without truncation
- *     if end<=start: return ""
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.cvcf.get_sequence", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_sequence);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":70
- * 
- * # Utility function.  Parses a region string
- * def parse_regions( string ):             # <<<<<<<<<<<<<<
- *     result = []
- *     for r in string.split(','):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3parse_regions(PyObject *__pyx_self, PyObject *__pyx_v_string); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3parse_regions = {__Pyx_NAMESTR("parse_regions"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3parse_regions, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3parse_regions(PyObject *__pyx_self, PyObject *__pyx_v_string) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("parse_regions (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_2parse_regions(__pyx_self, ((PyObject *)__pyx_v_string));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_2parse_regions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string) {
-  PyObject *__pyx_v_result = NULL;
-  PyObject *__pyx_v_r = NULL;
-  PyObject *__pyx_v_elts = NULL;
-  PyObject *__pyx_v_chrom = NULL;
-  PyObject *__pyx_v_start = NULL;
-  PyObject *__pyx_v_end = NULL;
-  PyObject *__pyx_v_ielts = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  Py_ssize_t __pyx_t_3;
-  PyObject *(*__pyx_t_4)(PyObject *);
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  Py_ssize_t __pyx_t_7;
-  int __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  int __pyx_t_14;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse_regions", 0);
-
-  /* "pysam/cvcf.pyx":71
- * # Utility function.  Parses a region string
- * def parse_regions( string ):
- *     result = []             # <<<<<<<<<<<<<<
- *     for r in string.split(','):
- *         elts = r.split(':')
- */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_result = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":72
- * def parse_regions( string ):
- *     result = []
- *     for r in string.split(','):             # <<<<<<<<<<<<<<
- *         elts = r.split(':')
- *         chrom, start, end = elts[0], 0, 3000000000
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_string, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
-    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
-    __pyx_t_4 = NULL;
-  } else {
-    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  for (;;) {
-    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
-      if (unlikely(!__pyx_t_2)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_2);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":73
- *     result = []
- *     for r in string.split(','):
- *         elts = r.split(':')             # <<<<<<<<<<<<<<
- *         chrom, start, end = elts[0], 0, 3000000000
- *         if len(elts)==1: pass
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_elts, __pyx_t_5);
-    __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":74
- *     for r in string.split(','):
- *         elts = r.split(':')
- *         chrom, start, end = elts[0], 0, 3000000000             # <<<<<<<<<<<<<<
- *         if len(elts)==1: pass
- *         elif len(elts)==2:
- */
-    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = __pyx_int_0;
-    __Pyx_INCREF(__pyx_t_2);
-    __pyx_t_6 = __pyx_int_3000000000;
-    __Pyx_INCREF(__pyx_t_6);
-    __Pyx_XDECREF_SET(__pyx_v_chrom, __pyx_t_5);
-    __pyx_t_5 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2);
-    __pyx_t_2 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_6);
-    __pyx_t_6 = 0;
-
-    /* "pysam/cvcf.pyx":75
- *         elts = r.split(':')
- *         chrom, start, end = elts[0], 0, 3000000000
- *         if len(elts)==1: pass             # <<<<<<<<<<<<<<
- *         elif len(elts)==2:
- *             if len(elts[1])>0:
- */
-    __pyx_t_7 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_8 = ((__pyx_t_7 == 1) != 0);
-    if (__pyx_t_8) {
-      goto __pyx_L5;
-    }
-
-    /* "pysam/cvcf.pyx":76
- *         chrom, start, end = elts[0], 0, 3000000000
- *         if len(elts)==1: pass
- *         elif len(elts)==2:             # <<<<<<<<<<<<<<
- *             if len(elts[1])>0:
- *                 ielts = elts[1].split('-')
- */
-    __pyx_t_7 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_8 = ((__pyx_t_7 == 2) != 0);
-    if (__pyx_t_8) {
-
-      /* "pysam/cvcf.pyx":77
- *         if len(elts)==1: pass
- *         elif len(elts)==2:
- *             if len(elts[1])>0:             # <<<<<<<<<<<<<<
- *                 ielts = elts[1].split('-')
- *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
- */
-      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_8 = ((__pyx_t_7 > 0) != 0);
-      if (__pyx_t_8) {
-
-        /* "pysam/cvcf.pyx":78
- *         elif len(elts)==2:
- *             if len(elts[1])>0:
- *                 ielts = elts[1].split('-')             # <<<<<<<<<<<<<<
- *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
- *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
- */
-        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_XDECREF_SET(__pyx_v_ielts, __pyx_t_6);
-        __pyx_t_6 = 0;
-
-        /* "pysam/cvcf.pyx":79
- *             if len(elts[1])>0:
- *                 ielts = elts[1].split('-')
- *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
- *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
- *                 except: raise ValueError("Don't understand region string '%s'" % r)
- */
-        __pyx_t_7 = PyObject_Length(__pyx_v_ielts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_8 = ((__pyx_t_7 != 2) != 0);
-        if (__pyx_t_8) {
-          __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Don_t_understand_region_string_s, __pyx_v_r); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
-          __Pyx_GIVEREF(__pyx_t_6);
-          __pyx_t_6 = 0;
-          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          goto __pyx_L7;
-        }
-        __pyx_L7:;
-
-        /* "pysam/cvcf.pyx":80
- *                 ielts = elts[1].split('-')
- *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
- *                 try:    start, end = int(ielts[0])-1, int(ielts[1])             # <<<<<<<<<<<<<<
- *                 except: raise ValueError("Don't understand region string '%s'" % r)
- *         else:
- */
-        {
-          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
-          __Pyx_XGOTREF(__pyx_t_9);
-          __Pyx_XGOTREF(__pyx_t_10);
-          __Pyx_XGOTREF(__pyx_t_11);
-          /*try:*/ {
-            __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_ielts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L8_error;};
-            __Pyx_GOTREF(__pyx_t_6);
-            __pyx_t_2 = PyNumber_Int(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
-            __Pyx_GOTREF(__pyx_t_2);
-            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-            __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
-            __Pyx_GOTREF(__pyx_t_6);
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ielts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L8_error;};
-            __Pyx_GOTREF(__pyx_t_2);
-            __pyx_t_5 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
-            __Pyx_GOTREF(__pyx_t_5);
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_6);
-            __pyx_t_6 = 0;
-            __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_5);
-            __pyx_t_5 = 0;
-          }
-          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-          goto __pyx_L15_try_end;
-          __pyx_L8_error:;
-          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-          /* "pysam/cvcf.pyx":81
- *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
- *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
- *                 except: raise ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
- *         else:
- *             raise ValueError("Don't understand region string '%s'" % r)
- */
-          /*except:*/ {
-            __Pyx_AddTraceback("pysam.cvcf.parse_regions", __pyx_clineno, __pyx_lineno, __pyx_filename);
-            if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-            __Pyx_GOTREF(__pyx_t_5);
-            __Pyx_GOTREF(__pyx_t_6);
-            __Pyx_GOTREF(__pyx_t_2);
-            __pyx_t_12 = __Pyx_PyString_Format(__pyx_kp_s_Don_t_understand_region_string_s, __pyx_v_r); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-            __Pyx_GOTREF(__pyx_t_12);
-            __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-            __Pyx_GOTREF(__pyx_t_13);
-            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12);
-            __Pyx_GIVEREF(__pyx_t_12);
-            __pyx_t_12 = 0;
-            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-            __Pyx_GOTREF(__pyx_t_12);
-            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-            __Pyx_Raise(__pyx_t_12, 0, 0, 0);
-            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
-            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            goto __pyx_L9_exception_handled;
-          }
-          __pyx_L10_except_error:;
-          __Pyx_XGIVEREF(__pyx_t_9);
-          __Pyx_XGIVEREF(__pyx_t_10);
-          __Pyx_XGIVEREF(__pyx_t_11);
-          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
-          goto __pyx_L1_error;
-          __pyx_L9_exception_handled:;
-          __Pyx_XGIVEREF(__pyx_t_9);
-          __Pyx_XGIVEREF(__pyx_t_10);
-          __Pyx_XGIVEREF(__pyx_t_11);
-          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
-          __pyx_L15_try_end:;
-        }
-        goto __pyx_L6;
-      }
-      __pyx_L6:;
-      goto __pyx_L5;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":83
- *                 except: raise ValueError("Don't understand region string '%s'" % r)
- *         else:
- *             raise ValueError("Don't understand region string '%s'" % r)             # <<<<<<<<<<<<<<
- *         result.append( (chrom,start,end) )
- *     return result
- */
-      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Don_t_understand_region_string_s, __pyx_v_r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __pyx_L5:;
-
-    /* "pysam/cvcf.pyx":84
- *         else:
- *             raise ValueError("Don't understand region string '%s'" % r)
- *         result.append( (chrom,start,end) )             # <<<<<<<<<<<<<<
- *     return result
- * 
- */
-    __pyx_t_2 = PyTuple_New(3); 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_INCREF(__pyx_v_chrom);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
-    __Pyx_GIVEREF(__pyx_v_chrom);
-    __Pyx_INCREF(__pyx_v_start);
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_start);
-    __Pyx_GIVEREF(__pyx_v_start);
-    __Pyx_INCREF(__pyx_v_end);
-    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
-    __Pyx_GIVEREF(__pyx_v_end);
-    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":85
- *             raise ValueError("Don't understand region string '%s'" % r)
- *         result.append( (chrom,start,end) )
- *     return result             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":70
- * 
- * # Utility function.  Parses a region string
- * def parse_regions( string ):             # <<<<<<<<<<<<<<
- *     result = []
- *     for r in string.split(','):
- */
-
-  /* function exit code */
-  __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_12);
-  __Pyx_XDECREF(__pyx_t_13);
-  __Pyx_AddTraceback("pysam.cvcf.parse_regions", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_r);
-  __Pyx_XDECREF(__pyx_v_elts);
-  __Pyx_XDECREF(__pyx_v_chrom);
-  __Pyx_XDECREF(__pyx_v_start);
-  __Pyx_XDECREF(__pyx_v_end);
-  __Pyx_XDECREF(__pyx_v_ielts);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":106
- *     cdef uint32_t pos
- * 
- *     def __init__(self, vcf):             # <<<<<<<<<<<<<<
- *         self.vcf = vcf
- *         # if len(data) != len(self.vcf._samples):
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_4cvcf_9VCFRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_4cvcf_9VCFRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_vcf = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vcf,0};
-    PyObject* values[1] = {0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vcf)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-    }
-    __pyx_v_vcf = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord___init__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self), __pyx_v_vcf);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_4cvcf_9VCFRecord___init__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_vcf) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-
-  /* "pysam/cvcf.pyx":107
- * 
- *     def __init__(self, vcf):
- *         self.vcf = vcf             # <<<<<<<<<<<<<<
- *         # if len(data) != len(self.vcf._samples):
- *         #     self.vcf.error(str(data),
- */
-  __Pyx_INCREF(__pyx_v_vcf);
-  __Pyx_GIVEREF(__pyx_v_vcf);
-  __Pyx_GOTREF(__pyx_v_self->vcf);
-  __Pyx_DECREF(__pyx_v_self->vcf);
-  __pyx_v_self->vcf = __pyx_v_vcf;
-
-  /* "pysam/cvcf.pyx":106
- *     cdef uint32_t pos
- * 
- *     def __init__(self, vcf):             # <<<<<<<<<<<<<<
- *         self.vcf = vcf
- *         # if len(data) != len(self.vcf._samples):
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":117
- *         #                     len(data)))
- * 
- *     def __cinit__(self, vcf):             # <<<<<<<<<<<<<<
- *         # start indexed access at genotypes
- *         self.offset = 9
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_4cvcf_9VCFRecord_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_4cvcf_9VCFRecord_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_vcf = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vcf,0};
-    PyObject* values[1] = {0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vcf)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-    }
-    __pyx_v_vcf = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_2__cinit__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self), __pyx_v_vcf);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_4cvcf_9VCFRecord_2__cinit__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_vcf) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__cinit__", 0);
-
-  /* "pysam/cvcf.pyx":119
- *     def __cinit__(self, vcf):
- *         # start indexed access at genotypes
- *         self.offset = 9             # <<<<<<<<<<<<<<
- * 
- *         self.vcf = vcf
- */
-  __pyx_v_self->__pyx_base.offset = 9;
-
-  /* "pysam/cvcf.pyx":121
- *         self.offset = 9
- * 
- *         self.vcf = vcf             # <<<<<<<<<<<<<<
- * 
- *     def error(self, line, error, opt=None):
- */
-  __Pyx_INCREF(__pyx_v_vcf);
-  __Pyx_GIVEREF(__pyx_v_vcf);
-  __Pyx_GOTREF(__pyx_v_self->vcf);
-  __Pyx_DECREF(__pyx_v_self->vcf);
-  __pyx_v_self->vcf = __pyx_v_vcf;
-
-  /* "pysam/cvcf.pyx":117
- *         #                     len(data)))
- * 
- *     def __cinit__(self, vcf):             # <<<<<<<<<<<<<<
- *         # start indexed access at genotypes
- *         self.offset = 9
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":123
- *         self.vcf = vcf
- * 
- *     def error(self, line, error, opt=None):             # <<<<<<<<<<<<<<
- *         '''raise error.'''
- *         # pass to vcf file for error handling
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_5error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_9VCFRecord_4error[] = "raise error.";
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_5error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_line = 0;
-  PyObject *__pyx_v_error = 0;
-  PyObject *__pyx_v_opt = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("error (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_line,&__pyx_n_s_error,&__pyx_n_s_opt,0};
-    PyObject* values[3] = {0,0,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("error", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_opt);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "error") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_line = values[0];
-    __pyx_v_error = values[1];
-    __pyx_v_opt = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("error", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_4error(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self), __pyx_v_line, __pyx_v_error, __pyx_v_opt);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_4error(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_error, PyObject *__pyx_v_opt) {
-  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_RefNannySetupContext("error", 0);
-
-  /* "pysam/cvcf.pyx":126
- *         '''raise error.'''
- *         # pass to vcf file for error handling
- *         return self.vcf.error( line, error, opt )             # <<<<<<<<<<<<<<
- * 
- *     cdef update(self, char * buffer, size_t nbytes):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __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 = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_line);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
-  __Pyx_GIVEREF(__pyx_v_line);
-  __Pyx_INCREF(__pyx_v_error);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_error);
-  __Pyx_GIVEREF(__pyx_v_error);
-  __Pyx_INCREF(__pyx_v_opt);
-  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_opt);
-  __Pyx_GIVEREF(__pyx_v_opt);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_3;
-  __pyx_t_3 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":123
- *         self.vcf = vcf
- * 
- *     def error(self, line, error, opt=None):             # <<<<<<<<<<<<<<
- *         '''raise error.'''
- *         # pass to vcf file for error handling
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":128
- *         return self.vcf.error( line, error, opt )
- * 
- *     cdef update(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''update internal data.
- * 
- */
-
-static PyObject *__pyx_f_5pysam_4cvcf_9VCFRecord_update(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, char *__pyx_v_buffer, size_t __pyx_v_nbytes) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("update", 0);
-
-  /* "pysam/cvcf.pyx":133
- *         nbytes does not include the terminal '\0'.
- *         '''
- *         TabProxies.TupleProxy.update(self, buffer, nbytes)             # <<<<<<<<<<<<<<
- * 
- *         self.contig = self.fields[0]
- */
-  __pyx_t_1 = __pyx_vtabptr_5pysam_10TabProxies_TupleProxy->update(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_self), __pyx_v_buffer, __pyx_v_nbytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":135
- *         TabProxies.TupleProxy.update(self, buffer, nbytes)
- * 
- *         self.contig = self.fields[0]             # <<<<<<<<<<<<<<
- *         # vcf counts from 1 - correct here
- *         self.pos = atoi(self.fields[1]) - 1
- */
-  __pyx_v_self->contig = (__pyx_v_self->__pyx_base.fields[0]);
-
-  /* "pysam/cvcf.pyx":137
- *         self.contig = self.fields[0]
- *         # vcf counts from 1 - correct here
- *         self.pos = atoi(self.fields[1]) - 1             # <<<<<<<<<<<<<<
- * 
- *     def __len__(self):
- */
-  __pyx_v_self->pos = (atoi((__pyx_v_self->__pyx_base.fields[1])) - 1);
-
-  /* "pysam/cvcf.pyx":128
- *         return self.vcf.error( line, error, opt )
- * 
- *     cdef update(self, char * buffer, size_t nbytes):             # <<<<<<<<<<<<<<
- *         '''update internal data.
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":139
- *         self.pos = atoi(self.fields[1]) - 1
- * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         return max(0, self.nfields - 9)
- * 
- */
-
-/* Python wrapper */
-static Py_ssize_t __pyx_pw_5pysam_4cvcf_9VCFRecord_7__len__(PyObject *__pyx_v_self); /*proto*/
-static Py_ssize_t __pyx_pw_5pysam_4cvcf_9VCFRecord_7__len__(PyObject *__pyx_v_self) {
-  Py_ssize_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_6__len__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static Py_ssize_t __pyx_pf_5pysam_4cvcf_9VCFRecord_6__len__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self) {
-  Py_ssize_t __pyx_r;
-  __Pyx_RefNannyDeclarations
-  long __pyx_t_1;
-  long __pyx_t_2;
-  long __pyx_t_3;
-  __Pyx_RefNannySetupContext("__len__", 0);
-
-  /* "pysam/cvcf.pyx":140
- * 
- *     def __len__(self):
- *         return max(0, self.nfields - 9)             # <<<<<<<<<<<<<<
- * 
- *     property contig:
- */
-  __pyx_t_1 = (__pyx_v_self->__pyx_base.nfields - 9);
-  __pyx_t_2 = 0;
-  if (((__pyx_t_1 > __pyx_t_2) != 0)) {
-    __pyx_t_3 = __pyx_t_1;
-  } else {
-    __pyx_t_3 = __pyx_t_2;
-  }
-  __pyx_r = __pyx_t_3;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":139
- *         self.pos = atoi(self.fields[1]) - 1
- * 
- *     def __len__(self):             # <<<<<<<<<<<<<<
- *         return max(0, self.nfields - 9)
- * 
- */
-
-  /* function exit code */
-  __pyx_L0:;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":143
- * 
- *     property contig:
- *         def __get__(self): return self.contig             # <<<<<<<<<<<<<<
- * 
- *     property pos:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_6contig_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_6contig_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_6contig___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_6contig___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_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_RefNannySetupContext("__get__", 0);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->contig); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.contig.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":146
- * 
- *     property pos:
- *         def __get__(self): return self.pos             # <<<<<<<<<<<<<<
- * 
- *     property id:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_3pos_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_3pos_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_3pos___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_3pos___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_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_RefNannySetupContext("__get__", 0);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_self->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.pos.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":149
- * 
- *     property id:
- *         def __get__(self): return self.fields[2]             # <<<<<<<<<<<<<<
- * 
- *     property ref:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_2id_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_2id___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_2id___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_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_RefNannySetupContext("__get__", 0);
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[2])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":152
- * 
- *     property ref:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.fields[3]
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_3ref_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_3ref___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_3ref___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_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_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/cvcf.pyx":153
- *     property ref:
- *         def __get__(self):
- *             return self.fields[3]             # <<<<<<<<<<<<<<
- * 
- *     property alt:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[3])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":152
- * 
- *     property ref:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.fields[3]
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":156
- * 
- *     property alt:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             # convert v3.3 to v4.0 alleles below
- *             alt = self.fields[4]
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_3alt_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_3alt_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_3alt___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_3alt___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self) {
-  PyObject *__pyx_v_alt = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/cvcf.pyx":158
- *         def __get__(self):
- *             # convert v3.3 to v4.0 alleles below
- *             alt = self.fields[4]             # <<<<<<<<<<<<<<
- *             if alt == ".": alt = []
- *             else: alt = alt.upper().split(',')
- */
-  __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[4])); 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_v_alt = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":159
- *             # convert v3.3 to v4.0 alleles below
- *             alt = self.fields[4]
- *             if alt == ".": alt = []             # <<<<<<<<<<<<<<
- *             else: alt = alt.upper().split(',')
- *             return alt
- */
-  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alt, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_2) {
-    __pyx_t_1 = PyList_New(0); 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_SET(__pyx_v_alt, __pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":160
- *             alt = self.fields[4]
- *             if alt == ".": alt = []
- *             else: alt = alt.upper().split(',')             # <<<<<<<<<<<<<<
- *             return alt
- * 
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_alt, __pyx_n_s_upper); 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_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_split); 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_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_3);
-    __pyx_t_3 = 0;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":161
- *             if alt == ".": alt = []
- *             else: alt = alt.upper().split(',')
- *             return alt             # <<<<<<<<<<<<<<
- * 
- *     property qual:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_alt);
-  __pyx_r = __pyx_v_alt;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":156
- * 
- *     property alt:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             # convert v3.3 to v4.0 alleles below
- *             alt = self.fields[4]
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.alt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_alt);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":164
- * 
- *     property qual:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             qual = self.fields[5]
- *             if qual == b".": qual = -1
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_4qual_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_4qual_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_4qual___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_4qual___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self) {
-  PyObject *__pyx_v_qual = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  double __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/cvcf.pyx":165
- *     property qual:
- *         def __get__(self):
- *             qual = self.fields[5]             # <<<<<<<<<<<<<<
- *             if qual == b".": qual = -1
- *             else:
- */
-  __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[5])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_qual = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":166
- *         def __get__(self):
- *             qual = self.fields[5]
- *             if qual == b".": qual = -1             # <<<<<<<<<<<<<<
- *             else:
- *                 try:    qual = float(qual)
- */
-  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_qual, __pyx_kp_b__8, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_2) {
-    __Pyx_INCREF(__pyx_int_neg_1);
-    __Pyx_DECREF_SET(__pyx_v_qual, __pyx_int_neg_1);
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":168
- *             if qual == b".": qual = -1
- *             else:
- *                 try:    qual = float(qual)             # <<<<<<<<<<<<<<
- *                 except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL)
- *             return qual
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
-      __Pyx_XGOTREF(__pyx_t_3);
-      __Pyx_XGOTREF(__pyx_t_4);
-      __Pyx_XGOTREF(__pyx_t_5);
-      /*try:*/ {
-        __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_v_qual); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF_SET(__pyx_v_qual, __pyx_t_1);
-        __pyx_t_1 = 0;
-      }
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L11_try_end;
-      __pyx_L4_error:;
-      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/cvcf.pyx":169
- *             else:
- *                 try:    qual = float(qual)
- *                 except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
- *             return qual
- * 
- */
-      /*except:*/ {
-        __Pyx_AddTraceback("pysam.cvcf.VCFRecord.qual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_INCREF(((PyObject *)__pyx_v_self));
-        PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_self));
-        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-        __pyx_t_11 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_QUAL_NOT_NUMERICAL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_12);
-        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11);
-        __Pyx_GIVEREF(__pyx_t_11);
-        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10);
-        __Pyx_GIVEREF(__pyx_t_10);
-        __pyx_t_11 = 0;
-        __pyx_t_10 = 0;
-        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        goto __pyx_L5_exception_handled;
-      }
-      __pyx_L6_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-      goto __pyx_L1_error;
-      __pyx_L5_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_3);
-      __Pyx_XGIVEREF(__pyx_t_4);
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-      __pyx_L11_try_end:;
-    }
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":170
- *                 try:    qual = float(qual)
- *                 except: self.vcf.error(str(self),self.QUAL_NOT_NUMERICAL)
- *             return qual             # <<<<<<<<<<<<<<
- * 
- *     property filter:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_qual);
-  __pyx_r = __pyx_v_qual;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":164
- * 
- *     property qual:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             qual = self.fields[5]
- *             if qual == b".": qual = -1
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.qual.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_qual);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":173
- * 
- *     property filter:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             f = self.fields[6]
- *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_6filter_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_6filter_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_6filter___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_6filter___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self) {
-  char *__pyx_v_f;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/cvcf.pyx":174
- *     property filter:
- *         def __get__(self):
- *             f = self.fields[6]             # <<<<<<<<<<<<<<
- *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- *             if f == b"." or f == b"PASS" or f == b"0": return []
- */
-  __pyx_v_f = (__pyx_v_self->__pyx_base.fields[6]);
-
-  /* "pysam/cvcf.pyx":176
- *             f = self.fields[6]
- *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- *             if f == b"." or f == b"PASS" or f == b"0": return []             # <<<<<<<<<<<<<<
- *             else: return f.split(';')
- * 
- */
-  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__8, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (!__pyx_t_2) {
-    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_n_b_PASS, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (!__pyx_t_3) {
-      __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_4 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b_0, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __pyx_t_4;
-    } else {
-      __pyx_t_5 = __pyx_t_3;
-    }
-    __pyx_t_3 = __pyx_t_5;
-  } else {
-    __pyx_t_3 = __pyx_t_2;
-  }
-  if (__pyx_t_3) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":177
- *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- *             if f == b"." or f == b"PASS" or f == b"0": return []
- *             else: return f.split(';')             # <<<<<<<<<<<<<<
- * 
- *     property info:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_f); 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_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__11, NULL); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":173
- * 
- *     property filter:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             f = self.fields[6]
- *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.filter.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":180
- * 
- *     property info:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             col = self.fields[7]
- *             # dictionary of keys, and list of values
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_4info_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_4info_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_4info___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_4info___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self) {
-  char *__pyx_v_col;
-  PyObject *__pyx_v_info = NULL;
-  PyObject *__pyx_v_blurp = NULL;
-  PyObject *__pyx_v_elts = NULL;
-  PyObject *__pyx_v_v = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  Py_ssize_t __pyx_t_4;
-  PyObject *(*__pyx_t_5)(PyObject *);
-  PyObject *__pyx_t_6 = NULL;
-  Py_ssize_t __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/cvcf.pyx":181
- *     property info:
- *         def __get__(self):
- *             col = self.fields[7]             # <<<<<<<<<<<<<<
- *             # dictionary of keys, and list of values
- *             info = {}
- */
-  __pyx_v_col = (__pyx_v_self->__pyx_base.fields[7]);
-
-  /* "pysam/cvcf.pyx":183
- *             col = self.fields[7]
- *             # dictionary of keys, and list of values
- *             info = {}             # <<<<<<<<<<<<<<
- *             if col != b".":
- *                 for blurp in col.split(';'):
- */
-  __pyx_t_1 = PyDict_New(); 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_v_info = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":184
- *             # dictionary of keys, and list of values
- *             info = {}
- *             if col != b".":             # <<<<<<<<<<<<<<
- *                 for blurp in col.split(';'):
- *                     elts = blurp.split('=')
- */
-  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_col); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_1, __pyx_kp_b__8, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/cvcf.pyx":185
- *             info = {}
- *             if col != b".":
- *                 for blurp in col.split(';'):             # <<<<<<<<<<<<<<
- *                     elts = blurp.split('=')
- *                     if len(elts) == 1: v = None
- */
-    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_col); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
-      __pyx_t_3 = __pyx_t_1; __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_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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_1); __pyx_t_1 = 0;
-    for (;;) {
-      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
-        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
-        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_1 = __pyx_t_5(__pyx_t_3);
-        if (unlikely(!__pyx_t_1)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_1);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_blurp, __pyx_t_1);
-      __pyx_t_1 = 0;
-
-      /* "pysam/cvcf.pyx":186
- *             if col != b".":
- *                 for blurp in col.split(';'):
- *                     elts = blurp.split('=')             # <<<<<<<<<<<<<<
- *                     if len(elts) == 1: v = None
- *                     elif len(elts) == 2: v = elts[1]
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_blurp, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_elts, __pyx_t_6);
-      __pyx_t_6 = 0;
-
-      /* "pysam/cvcf.pyx":187
- *                 for blurp in col.split(';'):
- *                     elts = blurp.split('=')
- *                     if len(elts) == 1: v = None             # <<<<<<<<<<<<<<
- *                     elif len(elts) == 2: v = elts[1]
- *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
- */
-      __pyx_t_7 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = ((__pyx_t_7 == 1) != 0);
-      if (__pyx_t_2) {
-        __Pyx_INCREF(Py_None);
-        __Pyx_XDECREF_SET(__pyx_v_v, Py_None);
-        goto __pyx_L6;
-      }
-
-      /* "pysam/cvcf.pyx":188
- *                     elts = blurp.split('=')
- *                     if len(elts) == 1: v = None
- *                     elif len(elts) == 2: v = elts[1]             # <<<<<<<<<<<<<<
- *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
- *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
- */
-      __pyx_t_7 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = ((__pyx_t_7 == 2) != 0);
-      if (__pyx_t_2) {
-        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
-        __pyx_t_6 = 0;
-        goto __pyx_L6;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":189
- *                     if len(elts) == 1: v = None
- *                     elif len(elts) == 2: v = elts[1]
- *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
- *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
- *             return info
- */
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_INCREF(((PyObject *)__pyx_v_self));
-        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-        __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ERROR_INFO_STRING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
-        __Pyx_GIVEREF(__pyx_t_8);
-        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
-        __Pyx_GIVEREF(__pyx_t_1);
-        __pyx_t_8 = 0;
-        __pyx_t_1 = 0;
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      }
-      __pyx_L6:;
-
-      /* "pysam/cvcf.pyx":190
- *                     elif len(elts) == 2: v = elts[1]
- *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
- *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))             # <<<<<<<<<<<<<<
- *             return info
- * 
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_parse_formatdata); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_9);
-      if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_INCREF(((PyObject *)__pyx_v_self));
-      PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_self));
-      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
-      __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_v);
-      __Pyx_GIVEREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_10);
-      __Pyx_GIVEREF(__pyx_t_10);
-      __pyx_t_9 = 0;
-      __pyx_t_6 = 0;
-      __pyx_t_10 = 0;
-      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_8);
-      if (unlikely(PyDict_SetItem(__pyx_v_info, __pyx_t_8, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":191
- *                     else: self.vcf.error(str(self),self.ERROR_INFO_STRING)
- *                     info[elts[0]] = self.vcf.parse_formatdata(elts[0], v, self.vcf._info, str(self))
- *             return info             # <<<<<<<<<<<<<<
- * 
- *     property format:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_info);
-  __pyx_r = __pyx_v_info;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":180
- * 
- *     property info:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             col = self.fields[7]
- *             # dictionary of keys, and list of values
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.info.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_info);
-  __Pyx_XDECREF(__pyx_v_blurp);
-  __Pyx_XDECREF(__pyx_v_elts);
-  __Pyx_XDECREF(__pyx_v_v);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":194
- * 
- *     property format:
- *          def __get__(self):             # <<<<<<<<<<<<<<
- *              return self.fields[8].split(':')
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_6format_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_6format_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_6format___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_6format___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/cvcf.pyx":195
- *     property format:
- *          def __get__(self):
- *              return self.fields[8].split(':')             # <<<<<<<<<<<<<<
- * 
- *     property samples:
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[8])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":194
- * 
- *     property format:
- *          def __get__(self):             # <<<<<<<<<<<<<<
- *              return self.fields[8].split(':')
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.format.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":198
- * 
- *     property samples:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.vcf._samples
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_7samples_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_7samples_1__get__(PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_7samples___get__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_7samples___get__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_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_RefNannySetupContext("__get__", 0);
-
-  /* "pysam/cvcf.pyx":199
- *     property samples:
- *         def __get__(self):
- *             return self.vcf._samples             # <<<<<<<<<<<<<<
- * 
- *     def __getitem__(self, key):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":198
- * 
- *     property samples:
- *         def __get__(self):             # <<<<<<<<<<<<<<
- *             return self.vcf._samples
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.samples.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":201
- *             return self.vcf._samples
- * 
- *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
- * 
- *         # parse sample columns
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static PyObject *__pyx_pw_5pysam_4cvcf_9VCFRecord_9__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_9VCFRecord_8__getitem__(((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_v_self), ((PyObject *)__pyx_v_key));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_9VCFRecord_8__getitem__(struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_self, PyObject *__pyx_v_key) {
-  PyObject *__pyx_v_values = NULL;
-  PyObject *__pyx_v_alt = NULL;
-  PyObject *__pyx_v_format = NULL;
-  PyObject *__pyx_v_result = NULL;
-  Py_ssize_t __pyx_v_idx;
-  PyObject *__pyx_v_expected = NULL;
-  PyObject *__pyx_v_value = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  Py_ssize_t __pyx_t_3;
-  Py_ssize_t __pyx_t_4;
-  int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  Py_ssize_t __pyx_t_10;
-  int __pyx_t_11;
-  int __pyx_t_12;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__getitem__", 0);
-
-  /* "pysam/cvcf.pyx":204
- * 
- *         # parse sample columns
- *         values = self.fields[self.vcf._sample2column[key]].split(':')             # <<<<<<<<<<<<<<
- *         alt = self.alt
- *         format = self.format
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_sample2column); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyBytes_FromString((__pyx_v_self->__pyx_base.fields[__pyx_t_3])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_values = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":205
- *         # parse sample columns
- *         values = self.fields[self.vcf._sample2column[key]].split(':')
- *         alt = self.alt             # <<<<<<<<<<<<<<
- *         format = self.format
- * 
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_alt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_alt = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":206
- *         values = self.fields[self.vcf._sample2column[key]].split(':')
- *         alt = self.alt
- *         format = self.format             # <<<<<<<<<<<<<<
- * 
- *         if len(values) > len(format):
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_format = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":208
- *         format = self.format
- * 
- *         if len(values) > len(format):             # <<<<<<<<<<<<<<
- *             self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\
- *                            (len(values),key,len(format)))
- */
-  __pyx_t_3 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_5 = ((__pyx_t_3 > __pyx_t_4) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/cvcf.pyx":209
- * 
- *         if len(values) > len(format):
- *             self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\             # <<<<<<<<<<<<<<
- *                            (len(values),key,len(format)))
- * 
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BAD_NUMBER_OF_VALUES); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-
-    /* "pysam/cvcf.pyx":210
- *         if len(values) > len(format):
- *             self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\
- *                            (len(values),key,len(format)))             # <<<<<<<<<<<<<<
- * 
- *         result = {}
- */
-    __pyx_t_4 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
-    __Pyx_GIVEREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    __pyx_t_7 = 0;
-    __pyx_t_8 = 0;
-
-    /* "pysam/cvcf.pyx":209
- * 
- *         if len(values) > len(format):
- *             self.vcf.error(str(self.line),self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" %\             # <<<<<<<<<<<<<<
- *                            (len(values),key,len(format)))
- * 
- */
-    __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_found_s_values_in_element_s_exp, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    __pyx_t_1 = 0;
-    __pyx_t_6 = 0;
-    __pyx_t_8 = 0;
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":212
- *                            (len(values),key,len(format)))
- * 
- *         result = {}             # <<<<<<<<<<<<<<
- *         for idx in range(len(format)):
- *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
- */
-  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_v_result = ((PyObject*)__pyx_t_8);
-  __pyx_t_8 = 0;
-
-  /* "pysam/cvcf.pyx":213
- * 
- *         result = {}
- *         for idx in range(len(format)):             # <<<<<<<<<<<<<<
- *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
- *             if idx < len(values): value = values[idx]
- */
-  __pyx_t_4 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_4; __pyx_t_3+=1) {
-    __pyx_v_idx = __pyx_t_3;
-
-    /* "pysam/cvcf.pyx":214
- *         result = {}
- *         for idx in range(len(format)):
- *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)             # <<<<<<<<<<<<<<
- *             if idx < len(values): value = values[idx]
- *             else:
- */
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_get_expected); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_format_2); 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_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_alt);
-    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_alt);
-    __Pyx_GIVEREF(__pyx_v_alt);
-    __pyx_t_9 = 0;
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); 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_8); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_expected, __pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":215
- *         for idx in range(len(format)):
- *             expected = self.vcf.get_expected(format[idx], self.vcf._format, alt)
- *             if idx < len(values): value = values[idx]             # <<<<<<<<<<<<<<
- *             else:
- *                 if expected == -1: value = "."
- */
-    __pyx_t_10 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = ((__pyx_v_idx < __pyx_t_10) != 0);
-    if (__pyx_t_5) {
-      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2);
-      __pyx_t_2 = 0;
-      goto __pyx_L6;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":217
- *             if idx < len(values): value = values[idx]
- *             else:
- *                 if expected == -1: value = "."             # <<<<<<<<<<<<<<
- *                 else: value = ",".join(["."]*expected)
- * 
- */
-      __pyx_t_2 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (__pyx_t_5) {
-        __Pyx_INCREF(__pyx_kp_s__8);
-        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_kp_s__8);
-        goto __pyx_L7;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":218
- *             else:
- *                 if expected == -1: value = "."
- *                 else: value = ",".join(["."]*expected)             # <<<<<<<<<<<<<<
- * 
- *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
- */
-        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_kp_s__8);
-        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s__8);
-        __Pyx_GIVEREF(__pyx_kp_s__8);
-        { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_expected); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_temp);
-          __Pyx_DECREF(__pyx_t_2);
-          __pyx_t_2 = __pyx_temp;
-        }
-        __pyx_t_6 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
-        __pyx_t_6 = 0;
-      }
-      __pyx_L7:;
-    }
-    __pyx_L6:;
-
-    /* "pysam/cvcf.pyx":220
- *                 else: value = ",".join(["."]*expected)
- * 
- *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))             # <<<<<<<<<<<<<<
- *             if expected != -1 and len(result[format[idx]]) != expected:
- *                 self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
- */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_parse_formatdata); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_format_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __pyx_t_2 = 0;
-    __pyx_t_8 = 0;
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_1);
-    if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_1, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":221
- * 
- *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
- *             if expected != -1 and len(result[format[idx]]) != expected:             # <<<<<<<<<<<<<<
- *                 self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
- */
-    __pyx_t_9 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (__pyx_t_5) {
-      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_10 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_v_expected, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_12 = __pyx_t_11;
-    } else {
-      __pyx_t_12 = __pyx_t_5;
-    }
-    if (__pyx_t_12) {
-
-      /* "pysam/cvcf.pyx":222
- *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
- *             if expected != -1 and len(result[format[idx]]) != expected:
- *                 self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,             # <<<<<<<<<<<<<<
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
- *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
- */
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->vcf, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_BAD_NUMBER_OF_PARAMETERS); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-
-      /* "pysam/cvcf.pyx":223
- *             if expected != -1 and len(result[format[idx]]) != expected:
- *                 self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))             # <<<<<<<<<<<<<<
- *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
- *                 result[format[idx]] = result[format[idx]][:expected]
- */
-      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_v_expected);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_expected);
-      __Pyx_GIVEREF(__pyx_v_expected);
-      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      __pyx_t_8 = 0;
-      __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_id_s_expected_s_parameters_got_s, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-      /* "pysam/cvcf.pyx":222
- *             result[format[idx]] = self.vcf.parse_formatdata(format[idx], value, self.vcf._format, str(self.data))
- *             if expected != -1 and len(result[format[idx]]) != expected:
- *                 self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,             # <<<<<<<<<<<<<<
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
- *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
- */
-      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      __pyx_t_1 = 0;
-      __pyx_t_6 = 0;
-      __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-      /* "pysam/cvcf.pyx":224
- *                 self.vcf.error(str(self.data),self.BAD_NUMBER_OF_PARAMETERS,
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
- *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))             # <<<<<<<<<<<<<<
- *                 result[format[idx]] = result[format[idx]][:expected]
- * 
- */
-      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_10 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_v_expected, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      if (__pyx_t_12) {
-        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_9); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_6, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_6); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_10 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_6 = PyNumber_Subtract(__pyx_v_expected, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
-        __Pyx_GIVEREF(__pyx_t_9);
-        { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_temp);
-          __Pyx_DECREF(__pyx_t_1);
-          __pyx_t_1 = __pyx_temp;
-        }
-        __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_7, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L9;
-      }
-      __pyx_L9:;
-
-      /* "pysam/cvcf.pyx":225
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,result[format[idx]]))
- *                 if len(result[format[idx]] ) < expected: result[format[idx]] += [result[format[idx]][-1]]*(expected-len(result[format[idx]]))
- *                 result[format[idx]] = result[format[idx]][:expected]             # <<<<<<<<<<<<<<
- * 
- *         return result
- */
-      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_6, 0, 0, NULL, &__pyx_v_expected, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_6);
-      if (unlikely(PyDict_SetItem(__pyx_v_result, __pyx_t_6, __pyx_t_7) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L8;
-    }
-    __pyx_L8:;
-  }
-
-  /* "pysam/cvcf.pyx":227
- *                 result[format[idx]] = result[format[idx]][:expected]
- * 
- *         return result             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_result);
-  __pyx_r = __pyx_v_result;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":201
- *             return self.vcf._samples
- * 
- *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
- * 
- *         # parse sample columns
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("pysam.cvcf.VCFRecord.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_values);
-  __Pyx_XDECREF(__pyx_v_alt);
-  __Pyx_XDECREF(__pyx_v_format);
-  __Pyx_XDECREF(__pyx_v_result);
-  __Pyx_XDECREF(__pyx_v_expected);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":233
- *     '''converts a :term:`tabix row` into a VCF record.'''
- *     cdef vcffile
- *     def __init__(self, vcffile):             # <<<<<<<<<<<<<<
- *         self.vcffile = vcffile
- * 
- */
-
-/* Python wrapper */
-static int __pyx_pw_5pysam_4cvcf_11asVCFRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_5pysam_4cvcf_11asVCFRecord_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_vcffile = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vcffile,0};
-    PyObject* values[1] = {0};
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vcffile)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
-      goto __pyx_L5_argtuple_error;
-    } else {
-      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-    }
-    __pyx_v_vcffile = values[0];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.asVCFRecord.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return -1;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_11asVCFRecord___init__(((struct __pyx_obj_5pysam_4cvcf_asVCFRecord *)__pyx_v_self), __pyx_v_vcffile);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static int __pyx_pf_5pysam_4cvcf_11asVCFRecord___init__(struct __pyx_obj_5pysam_4cvcf_asVCFRecord *__pyx_v_self, PyObject *__pyx_v_vcffile) {
-  int __pyx_r;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__", 0);
-
-  /* "pysam/cvcf.pyx":234
- *     cdef vcffile
- *     def __init__(self, vcffile):
- *         self.vcffile = vcffile             # <<<<<<<<<<<<<<
- * 
- *     cdef parse(self, char * buffer, int len):
- */
-  __Pyx_INCREF(__pyx_v_vcffile);
-  __Pyx_GIVEREF(__pyx_v_vcffile);
-  __Pyx_GOTREF(__pyx_v_self->vcffile);
-  __Pyx_DECREF(__pyx_v_self->vcffile);
-  __pyx_v_self->vcffile = __pyx_v_vcffile;
-
-  /* "pysam/cvcf.pyx":233
- *     '''converts a :term:`tabix row` into a VCF record.'''
- *     cdef vcffile
- *     def __init__(self, vcffile):             # <<<<<<<<<<<<<<
- *         self.vcffile = vcffile
- * 
- */
-
-  /* function exit code */
-  __pyx_r = 0;
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":236
- *         self.vcffile = vcffile
- * 
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef VCFRecord r
- *         r = VCFRecord(self.vcffile)
- */
-
-static PyObject *__pyx_f_5pysam_4cvcf_11asVCFRecord_parse(struct __pyx_obj_5pysam_4cvcf_asVCFRecord *__pyx_v_self, char *__pyx_v_buffer, int __pyx_v_len) {
-  struct __pyx_obj_5pysam_4cvcf_VCFRecord *__pyx_v_r = 0;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse", 0);
-
-  /* "pysam/cvcf.pyx":238
- *     cdef parse(self, char * buffer, int len):
- *         cdef VCFRecord r
- *         r = VCFRecord(self.vcffile)             # <<<<<<<<<<<<<<
- *         r.copy(buffer, len)
- *         return r
- */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_self->vcffile);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->vcffile);
-  __Pyx_GIVEREF(__pyx_v_self->vcffile);
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_4cvcf_VCFRecord)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_r = ((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":239
- *         cdef VCFRecord r
- *         r = VCFRecord(self.vcffile)
- *         r.copy(buffer, len)             # <<<<<<<<<<<<<<
- *         return r
- * 
- */
-  __pyx_t_2 = ((struct __pyx_vtabstruct_5pysam_4cvcf_VCFRecord *)__pyx_v_r->__pyx_base.__pyx_vtab)->__pyx_base.copy(((struct __pyx_obj_5pysam_10TabProxies_TupleProxy *)__pyx_v_r), __pyx_v_buffer, __pyx_v_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":240
- *         r = VCFRecord(self.vcffile)
- *         r.copy(buffer, len)
- *         return r             # <<<<<<<<<<<<<<
- * 
- * class VCF(object):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(((PyObject *)__pyx_v_r));
-  __pyx_r = ((PyObject *)__pyx_v_r);
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":236
- *         self.vcffile = vcffile
- * 
- *     cdef parse(self, char * buffer, int len):             # <<<<<<<<<<<<<<
- *         cdef VCFRecord r
- *         r = VCFRecord(self.vcffile)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cvcf.asVCFRecord.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = 0;
-  __pyx_L0:;
-  __Pyx_XDECREF((PyObject *)__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":319
- *     _lines = None
- * 
- *     def __init__(self, _copy=None, reference=None, regions=None,             # <<<<<<<<<<<<<<
- *                  lines=None, leftalign=False):
- *         # make error identifiers accessible by name
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_1__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_1__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v__copy = 0;
-  PyObject *__pyx_v_reference = 0;
-  PyObject *__pyx_v_regions = 0;
-  PyObject *__pyx_v_lines = 0;
-  PyObject *__pyx_v_leftalign = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_copy,&__pyx_n_s_reference,&__pyx_n_s_regions,&__pyx_n_s_lines,&__pyx_n_s_leftalign,0};
-    PyObject* values[6] = {0,0,0,0,0,0};
-    values[1] = ((PyObject *)((PyObject *)Py_None));
-    values[2] = ((PyObject *)((PyObject *)Py_None));
-    values[3] = ((PyObject *)((PyObject *)Py_None));
-
-    /* "pysam/cvcf.pyx":320
- * 
- *     def __init__(self, _copy=None, reference=None, regions=None,
- *                  lines=None, leftalign=False):             # <<<<<<<<<<<<<<
- *         # make error identifiers accessible by name
- *         for id in self._errors.keys():
- */
-    values[4] = ((PyObject *)((PyObject *)Py_None));
-    values[5] = ((PyObject *)((PyObject *)Py_False));
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_copy);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reference);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_regions);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lines);
-          if (value) { values[4] = value; kw_args--; }
-        }
-        case  5:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_leftalign);
-          if (value) { values[5] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_self = values[0];
-    __pyx_v__copy = values[1];
-    __pyx_v_reference = values[2];
-    __pyx_v_regions = values[3];
-    __pyx_v_lines = values[4];
-    __pyx_v_leftalign = values[5];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF___init__(__pyx_self, __pyx_v_self, __pyx_v__copy, __pyx_v_reference, __pyx_v_regions, __pyx_v_lines, __pyx_v_leftalign);
-
-  /* "pysam/cvcf.pyx":319
- *     _lines = None
- * 
- *     def __init__(self, _copy=None, reference=None, regions=None,             # <<<<<<<<<<<<<<
- *                  lines=None, leftalign=False):
- *         # make error identifiers accessible by name
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v__copy, PyObject *__pyx_v_reference, PyObject *__pyx_v_regions, PyObject *__pyx_v_lines, PyObject *__pyx_v_leftalign) {
-  PyObject *__pyx_v_id = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  Py_ssize_t __pyx_t_3;
-  PyObject *(*__pyx_t_4)(PyObject *);
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("__init__", 0);
-
-  /* "pysam/cvcf.pyx":322
- *                  lines=None, leftalign=False):
- *         # make error identifiers accessible by name
- *         for id in self._errors.keys():             # <<<<<<<<<<<<<<
- *             self.__dict__[self._errors[id].split(':')[0]] = id
- *         if _copy != None:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
-    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
-    __pyx_t_4 = NULL;
-  } else {
-    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  for (;;) {
-    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
-      if (unlikely(!__pyx_t_1)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_1);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_id, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":323
- *         # make error identifiers accessible by name
- *         for id in self._errors.keys():
- *             self.__dict__[self._errors[id].split(':')[0]] = id             # <<<<<<<<<<<<<<
- *         if _copy != None:
- *             self._leftalign = _copy._leftalign
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyObject_GetItem(__pyx_t_5, __pyx_v_id); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_5, __pyx_v_id) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":324
- *         for id in self._errors.keys():
- *             self.__dict__[self._errors[id].split(':')[0]] = id
- *         if _copy != None:             # <<<<<<<<<<<<<<
- *             self._leftalign = _copy._leftalign
- *             self._header = _copy._header[:]
- */
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v__copy, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_7) {
-
-    /* "pysam/cvcf.pyx":325
- *             self.__dict__[self._errors[id].split(':')[0]] = id
- *         if _copy != None:
- *             self._leftalign = _copy._leftalign             # <<<<<<<<<<<<<<
- *             self._header = _copy._header[:]
- *             self._version = _copy._version
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_leftalign_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_leftalign_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":326
- *         if _copy != None:
- *             self._leftalign = _copy._leftalign
- *             self._header = _copy._header[:]             # <<<<<<<<<<<<<<
- *             self._version = _copy._version
- *             self._info = copy.deepcopy(_copy._info)
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_header); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__18, 0, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":327
- *             self._leftalign = _copy._leftalign
- *             self._header = _copy._header[:]
- *             self._version = _copy._version             # <<<<<<<<<<<<<<
- *             self._info = copy.deepcopy(_copy._info)
- *             self._filter = copy.deepcopy(_copy._filter)
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":328
- *             self._header = _copy._header[:]
- *             self._version = _copy._version
- *             self._info = copy.deepcopy(_copy._info)             # <<<<<<<<<<<<<<
- *             self._filter = copy.deepcopy(_copy._filter)
- *             self._format = copy.deepcopy(_copy._format)
- */
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_info, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":329
- *             self._version = _copy._version
- *             self._info = copy.deepcopy(_copy._info)
- *             self._filter = copy.deepcopy(_copy._filter)             # <<<<<<<<<<<<<<
- *             self._format = copy.deepcopy(_copy._format)
- *             self._samples = _copy._samples[:]
- */
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_filter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_filter, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":330
- *             self._info = copy.deepcopy(_copy._info)
- *             self._filter = copy.deepcopy(_copy._filter)
- *             self._format = copy.deepcopy(_copy._format)             # <<<<<<<<<<<<<<
- *             self._samples = _copy._samples[:]
- *             self._sample2column = copy.deepcopy(_copy._sample2column)
- */
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_format_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_format_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":331
- *             self._filter = copy.deepcopy(_copy._filter)
- *             self._format = copy.deepcopy(_copy._format)
- *             self._samples = _copy._samples[:]             # <<<<<<<<<<<<<<
- *             self._sample2column = copy.deepcopy(_copy._sample2column)
- *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_samples); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, NULL, NULL, &__pyx_slice__19, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_samples, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":332
- *             self._format = copy.deepcopy(_copy._format)
- *             self._samples = _copy._samples[:]
- *             self._sample2column = copy.deepcopy(_copy._sample2column)             # <<<<<<<<<<<<<<
- *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
- *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_sample2column); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __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 = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sample2column, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":333
- *             self._samples = _copy._samples[:]
- *             self._sample2column = copy.deepcopy(_copy._sample2column)
- *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)             # <<<<<<<<<<<<<<
- *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
- *             self._reference = _copy._reference
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_ignored_errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ignored_errors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":334
- *             self._sample2column = copy.deepcopy(_copy._sample2column)
- *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
- *             self._warn_errors = copy.deepcopy(_copy._warn_errors)             # <<<<<<<<<<<<<<
- *             self._reference = _copy._reference
- *             self._regions = _copy._regions
- */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_warn_errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __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 = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_warn_errors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":335
- *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
- *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
- *             self._reference = _copy._reference             # <<<<<<<<<<<<<<
- *             self._regions = _copy._regions
- *         if reference: self._reference = reference
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reference_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":336
- *             self._warn_errors = copy.deepcopy(_copy._warn_errors)
- *             self._reference = _copy._reference
- *             self._regions = _copy._regions             # <<<<<<<<<<<<<<
- *         if reference: self._reference = reference
- *         if regions: self._regions = regions
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v__copy, __pyx_n_s_regions_2); 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);
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_regions_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    goto __pyx_L5;
-  }
-  __pyx_L5:;
-
-  /* "pysam/cvcf.pyx":337
- *             self._reference = _copy._reference
- *             self._regions = _copy._regions
- *         if reference: self._reference = reference             # <<<<<<<<<<<<<<
- *         if regions: self._regions = regions
- *         if leftalign: self._leftalign = leftalign
- */
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_reference); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_7) {
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reference_2, __pyx_v_reference) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
-
-  /* "pysam/cvcf.pyx":338
- *             self._regions = _copy._regions
- *         if reference: self._reference = reference
- *         if regions: self._regions = regions             # <<<<<<<<<<<<<<
- *         if leftalign: self._leftalign = leftalign
- *         self._lines = lines
- */
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_regions); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_7) {
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_regions_2, __pyx_v_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L7;
-  }
-  __pyx_L7:;
-
-  /* "pysam/cvcf.pyx":339
- *         if reference: self._reference = reference
- *         if regions: self._regions = regions
- *         if leftalign: self._leftalign = leftalign             # <<<<<<<<<<<<<<
- *         self._lines = lines
- *         self.encoding = "ascii"
- */
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_leftalign); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_7) {
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_leftalign_2, __pyx_v_leftalign) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L8;
-  }
-  __pyx_L8:;
-
-  /* "pysam/cvcf.pyx":340
- *         if regions: self._regions = regions
- *         if leftalign: self._leftalign = leftalign
- *         self._lines = lines             # <<<<<<<<<<<<<<
- *         self.encoding = "ascii"
- * 
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lines_2, __pyx_v_lines) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":341
- *         if leftalign: self._leftalign = leftalign
- *         self._lines = lines
- *         self.encoding = "ascii"             # <<<<<<<<<<<<<<
- * 
- *     def error(self,line,error,opt=None):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_encoding, __pyx_n_s_ascii) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":319
- *     _lines = None
- * 
- *     def __init__(self, _copy=None, reference=None, regions=None,             # <<<<<<<<<<<<<<
- *                  lines=None, leftalign=False):
- *         # make error identifiers accessible by name
- */
-
-  /* function exit code */
-  __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_AddTraceback("pysam.cvcf.VCF.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_id);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":343
- *         self.encoding = "ascii"
- * 
- *     def error(self,line,error,opt=None):             # <<<<<<<<<<<<<<
- *         if error in self._ignored_errors: return
- *         errorlabel, errorstring = self._errors[error].split(':')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_3error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_3error = {__Pyx_NAMESTR("error"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_3error, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_3error(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_line = 0;
-  PyObject *__pyx_v_error = 0;
-  PyObject *__pyx_v_opt = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("error (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,&__pyx_n_s_error,&__pyx_n_s_opt,0};
-    PyObject* values[4] = {0,0,0,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_error)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_opt);
-          if (value) { values[3] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "error") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __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);
-        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_self = values[0];
-    __pyx_v_line = values[1];
-    __pyx_v_error = values[2];
-    __pyx_v_opt = values[3];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("error", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_2error(__pyx_self, __pyx_v_self, __pyx_v_line, __pyx_v_error, __pyx_v_opt);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_2error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_error, PyObject *__pyx_v_opt) {
-  PyObject *__pyx_v_errorlabel = NULL;
-  PyObject *__pyx_v_errorstring = NULL;
-  PyObject *__pyx_v_errwarn = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *(*__pyx_t_7)(PyObject *);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("error", 0);
-
-  /* "pysam/cvcf.pyx":344
- * 
- *     def error(self,line,error,opt=None):
- *         if error in self._ignored_errors: return             # <<<<<<<<<<<<<<
- *         errorlabel, errorstring = self._errors[error].split(':')
- *         if opt: errorstring = errorstring % opt
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ignored_errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_error, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = (__pyx_t_2 != 0);
-  if (__pyx_t_3) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":345
- *     def error(self,line,error,opt=None):
- *         if error in self._ignored_errors: return
- *         errorlabel, errorstring = self._errors[error].split(':')             # <<<<<<<<<<<<<<
- *         if opt: errorstring = errorstring % opt
- *         errwarn = ["Error","Warning"][error in self._warn_errors]
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_v_error); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-    PyObject* sequence = __pyx_t_4;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    Py_ssize_t size = Py_SIZE(sequence);
-    #else
-    Py_ssize_t size = PySequence_Size(sequence);
-    #endif
-    if (unlikely(size != 2)) {
-      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    #if CYTHON_COMPILING_IN_CPYTHON
-    if (likely(PyTuple_CheckExact(sequence))) {
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
-    } else {
-      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
-    }
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_t_5);
-    #else
-    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    #endif
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  } else {
-    Py_ssize_t index = -1;
-    __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
-    index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_1);
-    index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
-    __Pyx_GOTREF(__pyx_t_5);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = NULL;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    goto __pyx_L5_unpacking_done;
-    __pyx_L4_unpacking_failed:;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_7 = NULL;
-    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_L5_unpacking_done:;
-  }
-  __pyx_v_errorlabel = __pyx_t_1;
-  __pyx_t_1 = 0;
-  __pyx_v_errorstring = __pyx_t_5;
-  __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":346
- *         if error in self._ignored_errors: return
- *         errorlabel, errorstring = self._errors[error].split(':')
- *         if opt: errorstring = errorstring % opt             # <<<<<<<<<<<<<<
- *         errwarn = ["Error","Warning"][error in self._warn_errors]
- *         errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring)
- */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_opt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
-    __pyx_t_4 = PyNumber_Remainder(__pyx_v_errorstring, __pyx_v_opt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF_SET(__pyx_v_errorstring, __pyx_t_4);
-    __pyx_t_4 = 0;
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
-
-  /* "pysam/cvcf.pyx":347
- *         errorlabel, errorstring = self._errors[error].split(':')
- *         if opt: errorstring = errorstring % opt
- *         errwarn = ["Error","Warning"][error in self._warn_errors]             # <<<<<<<<<<<<<<
- *         errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring)
- *         if error in self._warn_errors: return
- */
-  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_n_s_Error);
-  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Error);
-  __Pyx_GIVEREF(__pyx_n_s_Error);
-  __Pyx_INCREF(__pyx_n_s_Warning);
-  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_Warning);
-  __Pyx_GIVEREF(__pyx_n_s_Warning);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_warn_errors); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_error, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_t_4, __pyx_t_3, int, 1, __Pyx_PyBool_FromLong, 1, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_v_errwarn = __pyx_t_5;
-  __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":348
- *         if opt: errorstring = errorstring % opt
- *         errwarn = ["Error","Warning"][error in self._warn_errors]
- *         errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring)             # <<<<<<<<<<<<<<
- *         if error in self._warn_errors: return
- *         raise ValueError(errorstring)
- */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lineno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  __Pyx_INCREF(__pyx_v_line);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_line);
-  __Pyx_GIVEREF(__pyx_v_line);
-  __Pyx_INCREF(__pyx_v_errwarn);
-  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_errwarn);
-  __Pyx_GIVEREF(__pyx_v_errwarn);
-  __Pyx_INCREF(__pyx_v_errorlabel);
-  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_errorlabel);
-  __Pyx_GIVEREF(__pyx_v_errorlabel);
-  __Pyx_INCREF(__pyx_v_errorstring);
-  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_errorstring);
-  __Pyx_GIVEREF(__pyx_v_errorstring);
-  __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_in_line_s_s_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_errorstring, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF_SET(__pyx_v_errorstring, __pyx_t_4);
-  __pyx_t_4 = 0;
-
-  /* "pysam/cvcf.pyx":349
- *         errwarn = ["Error","Warning"][error in self._warn_errors]
- *         errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring)
- *         if error in self._warn_errors: return             # <<<<<<<<<<<<<<
- *         raise ValueError(errorstring)
- * 
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_warn_errors); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_error, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_2 = (__pyx_t_3 != 0);
-  if (__pyx_t_2) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":350
- *         errorstring += " in line %s: '%s'\n%s %s: %s\n" % (self._lineno,line,errwarn,errorlabel,errorstring)
- *         if error in self._warn_errors: return
- *         raise ValueError(errorstring)             # <<<<<<<<<<<<<<
- * 
- *     def parse_format(self,line,format,filter=False):
- */
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_errorstring);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_errorstring);
-  __Pyx_GIVEREF(__pyx_v_errorstring);
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":343
- *         self.encoding = "ascii"
- * 
- *     def error(self,line,error,opt=None):             # <<<<<<<<<<<<<<
- *         if error in self._ignored_errors: return
- *         errorlabel, errorstring = self._errors[error].split(':')
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_errorlabel);
-  __Pyx_XDECREF(__pyx_v_errorstring);
-  __Pyx_XDECREF(__pyx_v_errwarn);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":352
- *         raise ValueError(errorstring)
- * 
- *     def parse_format(self,line,format,filter=False):             # <<<<<<<<<<<<<<
- *         if self._version == 40:
- *             if not format.startswith('<'):
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_5parse_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_5parse_format = {__Pyx_NAMESTR("parse_format"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_5parse_format, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_5parse_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_line = 0;
-  PyObject *__pyx_v_format = 0;
-  PyObject *__pyx_v_filter = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("parse_format (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,&__pyx_n_s_format,&__pyx_n_s_filter_2,0};
-    PyObject* values[4] = {0,0,0,0};
-    values[3] = ((PyObject *)((PyObject *)Py_False));
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter_2);
-          if (value) { values[3] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __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);
-        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_self = values[0];
-    __pyx_v_line = values[1];
-    __pyx_v_format = values[2];
-    __pyx_v_filter = values[3];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parse_format", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_4parse_format(__pyx_self, __pyx_v_self, __pyx_v_line, __pyx_v_format, __pyx_v_filter);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_4parse_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_format, PyObject *__pyx_v_filter) {
-  PyObject *__pyx_v_data = NULL;
-  PyObject *__pyx_v_idx = NULL;
-  PyObject *__pyx_v_elts = NULL;
-  PyObject *__pyx_v_first = NULL;
-  PyObject *__pyx_v_rest = NULL;
-  PyObject *__pyx_v_n = NULL;
-  PyObject *__pyx_v_t = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  Py_ssize_t __pyx_t_6;
-  int __pyx_t_7;
-  int __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  int __pyx_t_14;
-  PyObject *__pyx_t_15 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse_format", 0);
-  __Pyx_INCREF(__pyx_v_format);
-
-  /* "pysam/cvcf.pyx":353
- * 
- *     def parse_format(self,line,format,filter=False):
- *         if self._version == 40:             # <<<<<<<<<<<<<<
- *             if not format.startswith('<'):
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); 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_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_40, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
-
-    /* "pysam/cvcf.pyx":354
- *     def parse_format(self,line,format,filter=False):
- *         if self._version == 40:
- *             if not format.startswith('<'):             # <<<<<<<<<<<<<<
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format = "<"+format
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = ((!__pyx_t_3) != 0);
-    if (__pyx_t_4) {
-
-      /* "pysam/cvcf.pyx":355
- *         if self._version == 40:
- *             if not format.startswith('<'):
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)             # <<<<<<<<<<<<<<
- *                 format = "<"+format
- *             if not format.endswith('>'):
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V40_MISSING_ANGLE_BRACKETS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-      /* "pysam/cvcf.pyx":356
- *             if not format.startswith('<'):
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format = "<"+format             # <<<<<<<<<<<<<<
- *             if not format.endswith('>'):
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- */
-      __pyx_t_2 = PyNumber_Add(__pyx_kp_s__21, __pyx_v_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_2);
-      __pyx_t_2 = 0;
-      goto __pyx_L4;
-    }
-    __pyx_L4:;
-
-    /* "pysam/cvcf.pyx":357
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format = "<"+format
- *             if not format.endswith('>'):             # <<<<<<<<<<<<<<
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format += ">"
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_3 = ((!__pyx_t_4) != 0);
-    if (__pyx_t_3) {
-
-      /* "pysam/cvcf.pyx":358
- *                 format = "<"+format
- *             if not format.endswith('>'):
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)             # <<<<<<<<<<<<<<
- *                 format += ">"
- *             format = format[1:-1]
- */
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V40_MISSING_ANGLE_BRACKETS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyTuple_New(2); 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_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-      /* "pysam/cvcf.pyx":359
- *             if not format.endswith('>'):
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format += ">"             # <<<<<<<<<<<<<<
- *             format = format[1:-1]
- *         data = {'id':None,'number':None,'type':None,'descr':None}
- */
-      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_format, __pyx_kp_s__23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_2);
-      __pyx_t_2 = 0;
-      goto __pyx_L5;
-    }
-    __pyx_L5:;
-
-    /* "pysam/cvcf.pyx":360
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format += ">"
- *             format = format[1:-1]             # <<<<<<<<<<<<<<
- *         data = {'id':None,'number':None,'type':None,'descr':None}
- *         idx = 0
- */
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_format, 1, -1, NULL, NULL, &__pyx_slice__25, 1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_2);
-    __pyx_t_2 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":361
- *                 format += ">"
- *             format = format[1:-1]
- *         data = {'id':None,'number':None,'type':None,'descr':None}             # <<<<<<<<<<<<<<
- *         idx = 0
- *         while len(format.strip())>0:
- */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_id, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_number, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_descr, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_data = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":362
- *             format = format[1:-1]
- *         data = {'id':None,'number':None,'type':None,'descr':None}
- *         idx = 0             # <<<<<<<<<<<<<<
- *         while len(format.strip())>0:
- *             elts = format.strip().split(',')
- */
-  __Pyx_INCREF(__pyx_int_0);
-  __pyx_v_idx = __pyx_int_0;
-
-  /* "pysam/cvcf.pyx":363
- *         data = {'id':None,'number':None,'type':None,'descr':None}
- *         idx = 0
- *         while len(format.strip())>0:             # <<<<<<<<<<<<<<
- *             elts = format.strip().split(',')
- *             first, rest = elts[0], ','.join(elts[1:])
- */
-  while (1) {
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = ((__pyx_t_6 > 0) != 0);
-    if (!__pyx_t_3) break;
-
-    /* "pysam/cvcf.pyx":364
- *         idx = 0
- *         while len(format.strip())>0:
- *             elts = format.strip().split(',')             # <<<<<<<<<<<<<<
- *             first, rest = elts[0], ','.join(elts[1:])
- *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_elts, __pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":365
- *         while len(format.strip())>0:
- *             elts = format.strip().split(',')
- *             first, rest = elts[0], ','.join(elts[1:])             # <<<<<<<<<<<<<<
- *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
- *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
- */
-    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_elts, 1, 0, NULL, NULL, &__pyx_slice__27, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_first, __pyx_t_2);
-    __pyx_t_2 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_rest, ((PyObject*)__pyx_t_5));
-    __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":366
- *             elts = format.strip().split(',')
- *             first, rest = elts[0], ','.join(elts[1:])
- *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):             # <<<<<<<<<<<<<<
- *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
- *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (!__pyx_t_3) {
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_find); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_8 = __pyx_t_7;
-      } else {
-        __pyx_t_8 = __pyx_t_4;
-      }
-      __pyx_t_4 = __pyx_t_8;
-    } else {
-      __pyx_t_4 = __pyx_t_3;
-    }
-    if (__pyx_t_4) {
-
-      /* "pysam/cvcf.pyx":367
- *             first, rest = elts[0], ','.join(elts[1:])
- *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
- *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)             # <<<<<<<<<<<<<<
- *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *                 first = ["ID=","Number=","Type=","Description="][idx] + first
- */
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_int_40, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
-        __Pyx_GIVEREF(__pyx_t_5);
-        __pyx_t_5 = 0;
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        goto __pyx_L9;
-      }
-      __pyx_L9:;
-
-      /* "pysam/cvcf.pyx":368
- *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
- *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
- *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
- *                 first = ["ID=","Number=","Type=","Description="][idx] + first
- *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
- */
-      __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); 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_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_1 = PyTuple_New(2); 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_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L10;
-      }
-      __pyx_L10:;
-
-      /* "pysam/cvcf.pyx":369
- *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
- *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *                 first = ["ID=","Number=","Type=","Description="][idx] + first             # <<<<<<<<<<<<<<
- *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
- */
-      __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_kp_s_ID);
-      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_ID);
-      __Pyx_GIVEREF(__pyx_kp_s_ID);
-      __Pyx_INCREF(__pyx_kp_s_Number);
-      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_s_Number);
-      __Pyx_GIVEREF(__pyx_kp_s_Number);
-      __Pyx_INCREF(__pyx_kp_s_Type);
-      PyList_SET_ITEM(__pyx_t_2, 2, __pyx_kp_s_Type);
-      __Pyx_GIVEREF(__pyx_kp_s_Type);
-      __Pyx_INCREF(__pyx_kp_s_Description);
-      PyList_SET_ITEM(__pyx_t_2, 3, __pyx_kp_s_Description);
-      __Pyx_GIVEREF(__pyx_kp_s_Description);
-      __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_idx); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_first); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF_SET(__pyx_v_first, __pyx_t_2);
-      __pyx_t_2 = 0;
-      goto __pyx_L8;
-    }
-    __pyx_L8:;
-
-    /* "pysam/cvcf.pyx":370
- *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *                 first = ["ID=","Number=","Type=","Description="][idx] + first
- *             if first.startswith('ID='):            data['id'] = first.split('=')[1]             # <<<<<<<<<<<<<<
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_4) {
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_n_s_id, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L11;
-    }
-
-    /* "pysam/cvcf.pyx":371
- *                 first = ["ID=","Number=","Type=","Description="][idx] + first
- *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]             # <<<<<<<<<<<<<<
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
- *             elif first.startswith('Description='):
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_startswith); 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 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__35, NULL); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_4) {
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_split); 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_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__36, NULL); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_n_s_number, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L11;
-    }
-
-    /* "pysam/cvcf.pyx":372
- *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]             # <<<<<<<<<<<<<<
- *             elif first.startswith('Description='):
- *                 elts = format.split('"')
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_4) {
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_n_s_type, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L11;
-    }
-
-    /* "pysam/cvcf.pyx":373
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
- *             elif first.startswith('Description='):             # <<<<<<<<<<<<<<
- *                 elts = format.split('"')
- *                 if len(elts)<3:
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_4) {
-
-      /* "pysam/cvcf.pyx":374
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
- *             elif first.startswith('Description='):
- *                 elts = format.split('"')             # <<<<<<<<<<<<<<
- *                 if len(elts)<3:
- *                     self.error(line,self.FORMAT_MISSING_QUOTES)
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF_SET(__pyx_v_elts, __pyx_t_1);
-      __pyx_t_1 = 0;
-
-      /* "pysam/cvcf.pyx":375
- *             elif first.startswith('Description='):
- *                 elts = format.split('"')
- *                 if len(elts)<3:             # <<<<<<<<<<<<<<
- *                     self.error(line,self.FORMAT_MISSING_QUOTES)
- *                     elts = first.split('=') + [rest]
- */
-      __pyx_t_6 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_4 = ((__pyx_t_6 < 3) != 0);
-      if (__pyx_t_4) {
-
-        /* "pysam/cvcf.pyx":376
- *                 elts = format.split('"')
- *                 if len(elts)<3:
- *                     self.error(line,self.FORMAT_MISSING_QUOTES)             # <<<<<<<<<<<<<<
- *                     elts = first.split('=') + [rest]
- *                 data['descr'] = elts[1]
- */
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FORMAT_MISSING_QUOTES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-        /* "pysam/cvcf.pyx":377
- *                 if len(elts)<3:
- *                     self.error(line,self.FORMAT_MISSING_QUOTES)
- *                     elts = first.split('=') + [rest]             # <<<<<<<<<<<<<<
- *                 data['descr'] = elts[1]
- *                 rest = '"'.join(elts[2:])
- */
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_first, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_v_rest);
-        PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_rest);
-        __Pyx_GIVEREF(__pyx_v_rest);
-        __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF_SET(__pyx_v_elts, __pyx_t_1);
-        __pyx_t_1 = 0;
-        goto __pyx_L12;
-      }
-      __pyx_L12:;
-
-      /* "pysam/cvcf.pyx":378
- *                     self.error(line,self.FORMAT_MISSING_QUOTES)
- *                     elts = first.split('=') + [rest]
- *                 data['descr'] = elts[1]             # <<<<<<<<<<<<<<
- *                 rest = '"'.join(elts[2:])
- *                 if rest.startswith(','): rest = rest[1:]
- */
-      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_n_s_descr, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-      /* "pysam/cvcf.pyx":379
- *                     elts = first.split('=') + [rest]
- *                 data['descr'] = elts[1]
- *                 rest = '"'.join(elts[2:])             # <<<<<<<<<<<<<<
- *                 if rest.startswith(','): rest = rest[1:]
- *             else:
- */
-      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_elts, 2, 0, NULL, NULL, &__pyx_slice__42, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__29, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF_SET(__pyx_v_rest, ((PyObject*)__pyx_t_2));
-      __pyx_t_2 = 0;
-
-      /* "pysam/cvcf.pyx":380
- *                 data['descr'] = elts[1]
- *                 rest = '"'.join(elts[2:])
- *                 if rest.startswith(','): rest = rest[1:]             # <<<<<<<<<<<<<<
- *             else:
- *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rest, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (__pyx_t_4) {
-        if (unlikely(__pyx_v_rest == Py_None)) {
-          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_v_rest, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF_SET(__pyx_v_rest, ((PyObject*)__pyx_t_1));
-        __pyx_t_1 = 0;
-        goto __pyx_L13;
-      }
-      __pyx_L13:;
-      goto __pyx_L11;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":382
- *                 if rest.startswith(','): rest = rest[1:]
- *             else:
- *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
- *             format = rest
- *             idx += 1
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    }
-    __pyx_L11:;
-
-    /* "pysam/cvcf.pyx":383
- *             else:
- *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *             format = rest             # <<<<<<<<<<<<<<
- *             idx += 1
- *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
- */
-    __Pyx_INCREF(__pyx_v_rest);
-    __Pyx_DECREF_SET(__pyx_v_format, __pyx_v_rest);
-
-    /* "pysam/cvcf.pyx":384
- *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *             format = rest
- *             idx += 1             # <<<<<<<<<<<<<<
- *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
- *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":385
- *             format = rest
- *             idx += 1
- *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings             # <<<<<<<<<<<<<<
- *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *         if 'descr' not in data:
- */
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_4) {
-      __pyx_t_2 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_8 = __pyx_t_3;
-    } else {
-      __pyx_t_8 = __pyx_t_4;
-    }
-    if (__pyx_t_8) {
-      __Pyx_INCREF(__pyx_int_3);
-      __Pyx_DECREF_SET(__pyx_v_idx, __pyx_int_3);
-      goto __pyx_L14;
-    }
-    __pyx_L14:;
-  }
-
-  /* "pysam/cvcf.pyx":386
- *             idx += 1
- *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
- *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
- *         if 'descr' not in data:
- *             # missing description
- */
-  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_id); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = ((!__pyx_t_8) != 0);
-  if (__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); 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);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    goto __pyx_L15;
-  }
-  __pyx_L15:;
-
-  /* "pysam/cvcf.pyx":387
- *             if filter and idx==1: idx=3  # skip number and type fields for FILTER format strings
- *         if not data['id']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *         if 'descr' not in data:             # <<<<<<<<<<<<<<
- *             # missing description
- *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-  __pyx_t_4 = (__Pyx_PyDict_Contains(__pyx_n_s_descr, __pyx_v_data, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_8 = (__pyx_t_4 != 0);
-  if (__pyx_t_8) {
-
-    /* "pysam/cvcf.pyx":389
- *         if 'descr' not in data:
- *             # missing description
- *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
- *             data['descr'] = ""
- *         if not data['type'] and not data['number']:
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __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 = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":390
- *             # missing description
- *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *             data['descr'] = ""             # <<<<<<<<<<<<<<
- *         if not data['type'] and not data['number']:
- *             # fine, ##filter format
- */
-    if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_n_s_descr, __pyx_kp_s_) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L16;
-  }
-  __pyx_L16:;
-
-  /* "pysam/cvcf.pyx":391
- *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *             data['descr'] = ""
- *         if not data['type'] and not data['number']:             # <<<<<<<<<<<<<<
- *             # fine, ##filter format
- *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
- */
-  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_type); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = ((!__pyx_t_8) != 0);
-  if (__pyx_t_4) {
-    __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = ((!__pyx_t_8) != 0);
-    __pyx_t_8 = __pyx_t_3;
-  } else {
-    __pyx_t_8 = __pyx_t_4;
-  }
-  if (__pyx_t_8) {
-
-    /* "pysam/cvcf.pyx":393
- *         if not data['type'] and not data['number']:
- *             # fine, ##filter format
- *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')             # <<<<<<<<<<<<<<
- *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:
- *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_id); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_descr); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(__pyx_int_0);
-    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_0);
-    __Pyx_GIVEREF(__pyx_int_0);
-    __Pyx_INCREF(__pyx_n_s_Flag);
-    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_n_s_Flag);
-    __Pyx_GIVEREF(__pyx_n_s_Flag);
-    PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __Pyx_INCREF(__pyx_kp_s__8);
-    PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_kp_s__8);
-    __Pyx_GIVEREF(__pyx_kp_s__8);
-    __pyx_t_2 = 0;
-    __pyx_t_5 = 0;
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_r = __pyx_t_9;
-    __pyx_t_9 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":394
- *             # fine, ##filter format
- *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
- *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:             # <<<<<<<<<<<<<<
- *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *         # I would like a missing-value field, but it isn't there
- */
-  __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_type); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_Integer, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_8) {
-    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_Float, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __pyx_t_4;
-  } else {
-    __pyx_t_3 = __pyx_t_8;
-  }
-  if (__pyx_t_3) {
-    __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_Character, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = __pyx_t_8;
-  } else {
-    __pyx_t_4 = __pyx_t_3;
-  }
-  if (__pyx_t_4) {
-    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_String, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_8 = __pyx_t_3;
-  } else {
-    __pyx_t_8 = __pyx_t_4;
-  }
-  if (__pyx_t_8) {
-    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_Flag, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __pyx_t_4;
-  } else {
-    __pyx_t_3 = __pyx_t_8;
-  }
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_8 = (__pyx_t_3 != 0);
-  if (__pyx_t_8) {
-
-    /* "pysam/cvcf.pyx":395
- *             return FORMAT(data['id'],self.NT_NUMBER,0,"Flag",data['descr'],'.')
- *         if not data['type'] in ["Integer","Float","Character","String","Flag"]:
- *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
- *         # I would like a missing-value field, but it isn't there
- *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
- */
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __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 = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_10);
-    __Pyx_GIVEREF(__pyx_t_10);
-    __pyx_t_10 = 0;
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    goto __pyx_L18;
-  }
-  __pyx_L18:;
-
-  /* "pysam/cvcf.pyx":397
- *             self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *         # I would like a missing-value field, but it isn't there
- *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value             # <<<<<<<<<<<<<<
- *         else:                                   data['missing'] = '.'
- *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-  __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_type); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_Integer, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_8) {
-    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_Float, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = __pyx_t_3;
-  } else {
-    __pyx_t_4 = __pyx_t_8;
-  }
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_8 = (__pyx_t_4 != 0);
-  if (__pyx_t_8) {
-    if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_n_s_missing, Py_None) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L19;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":398
- *         # I would like a missing-value field, but it isn't there
- *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
- *         else:                                   data['missing'] = '.'             # <<<<<<<<<<<<<<
- *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *         try:
- */
-    if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_n_s_missing, __pyx_kp_s__8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __pyx_L19:;
-
-  /* "pysam/cvcf.pyx":399
- *         if data['type'] in ['Integer','Float']: data['missing'] = None    # Do NOT use arbitrary int/float as missing value
- *         else:                                   data['missing'] = '.'
- *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
- *         try:
- *             n = int(data['number'])
- */
-  __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_4 = ((!__pyx_t_8) != 0);
-  if (__pyx_t_4) {
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    goto __pyx_L20;
-  }
-  __pyx_L20:;
-
-  /* "pysam/cvcf.pyx":400
- *         else:                                   data['missing'] = '.'
- *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *         try:             # <<<<<<<<<<<<<<
- *             n = int(data['number'])
- *             t = self.NT_NUMBER
- */
-  {
-    __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
-    __Pyx_XGOTREF(__pyx_t_11);
-    __Pyx_XGOTREF(__pyx_t_12);
-    __Pyx_XGOTREF(__pyx_t_13);
-    /*try:*/ {
-
-      /* "pysam/cvcf.pyx":401
- *         if not data['number']: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *         try:
- *             n = int(data['number'])             # <<<<<<<<<<<<<<
- *             t = self.NT_NUMBER
- *         except ValueError:
- */
-      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L21_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_9 = PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_v_n = __pyx_t_9;
-      __pyx_t_9 = 0;
-
-      /* "pysam/cvcf.pyx":402
- *         try:
- *             n = int(data['number'])
- *             t = self.NT_NUMBER             # <<<<<<<<<<<<<<
- *         except ValueError:
- *             n = -1
- */
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_v_t = __pyx_t_9;
-      __pyx_t_9 = 0;
-    }
-    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-    goto __pyx_L28_try_end;
-    __pyx_L21_error:;
-    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":403
- *             n = int(data['number'])
- *             t = self.NT_NUMBER
- *         except ValueError:             # <<<<<<<<<<<<<<
- *             n = -1
- *             if data['number'] == '.':                   t = self.NT_UNKNOWN
- */
-    __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-    if (__pyx_t_14) {
-      __Pyx_AddTraceback("pysam.cvcf.VCF.parse_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_1, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_GOTREF(__pyx_t_10);
-
-      /* "pysam/cvcf.pyx":404
- *             t = self.NT_NUMBER
- *         except ValueError:
- *             n = -1             # <<<<<<<<<<<<<<
- *             if data['number'] == '.':                   t = self.NT_UNKNOWN
- *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
- */
-      __Pyx_INCREF(__pyx_int_neg_1);
-      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_int_neg_1);
-
-      /* "pysam/cvcf.pyx":405
- *         except ValueError:
- *             n = -1
- *             if data['number'] == '.':                   t = self.NT_UNKNOWN             # <<<<<<<<<<<<<<
- *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
- *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
- */
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;};
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
-        __pyx_t_5 = 0;
-        goto __pyx_L31;
-      }
-
-      /* "pysam/cvcf.pyx":406
- *             n = -1
- *             if data['number'] == '.':                   t = self.NT_UNKNOWN
- *             elif data['number'] == '#alleles':          t = self.NT_ALLELES             # <<<<<<<<<<<<<<
- *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
- *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
- */
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;};
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_alleles, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
-        __pyx_t_5 = 0;
-        goto __pyx_L31;
-      }
-
-      /* "pysam/cvcf.pyx":407
- *             if data['number'] == '.':                   t = self.NT_UNKNOWN
- *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
- *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES             # <<<<<<<<<<<<<<
- *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
- *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
- */
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;};
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_nonref_alleles, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NR_ALLELES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
-        __pyx_t_5 = 0;
-        goto __pyx_L31;
-      }
-
-      /* "pysam/cvcf.pyx":408
- *             elif data['number'] == '#alleles':          t = self.NT_ALLELES
- *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
- *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES             # <<<<<<<<<<<<<<
- *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
- *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
- */
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;};
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_genotypes, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
-        __pyx_t_5 = 0;
-        goto __pyx_L31;
-      }
-
-      /* "pysam/cvcf.pyx":409
- *             elif data['number'] == '#nonref_alleles':   t = self.NT_NR_ALLELES
- *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
- *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES             # <<<<<<<<<<<<<<
- *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
- *             # abbreviations added in VCF version v4.1
- */
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;};
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_phased_genotypes, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
-        __pyx_t_5 = 0;
-        goto __pyx_L31;
-      }
-
-      /* "pysam/cvcf.pyx":410
- *             elif data['number'] == '#genotypes':        t = self.NT_GENOTYPES
- *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
- *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES             # <<<<<<<<<<<<<<
- *             # abbreviations added in VCF version v4.1
- *             elif data['number'] == 'A': t = self.NT_ALLELES
- */
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;};
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_kp_s_phased_genotypes, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
-        __pyx_t_5 = 0;
-        goto __pyx_L31;
-      }
-
-      /* "pysam/cvcf.pyx":412
- *             elif data['number'] == '#phased_genotypes': t = self.NT_PHASED_GENOTYPES
- *             # abbreviations added in VCF version v4.1
- *             elif data['number'] == 'A': t = self.NT_ALLELES             # <<<<<<<<<<<<<<
- *             elif data['number'] == 'G': t = self.NT_GENOTYPES
- *             else:
- */
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;};
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_A, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
-        __pyx_t_5 = 0;
-        goto __pyx_L31;
-      }
-
-      /* "pysam/cvcf.pyx":413
- *             # abbreviations added in VCF version v4.1
- *             elif data['number'] == 'A': t = self.NT_ALLELES
- *             elif data['number'] == 'G': t = self.NT_GENOTYPES             # <<<<<<<<<<<<<<
- *             else:
- *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-      __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_number); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;};
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_5, __pyx_n_s_G, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__pyx_t_4) {
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
-        __pyx_t_5 = 0;
-        goto __pyx_L31;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":415
- *             elif data['number'] == 'G': t = self.NT_GENOTYPES
- *             else:
- *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)             # <<<<<<<<<<<<<<
- *         # if number is 0 - type must be Flag
- *         if n == 0 and data['type'] != 'Flag':
- */
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_FORMAT_STRING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_15);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      }
-      __pyx_L31:;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      goto __pyx_L22_exception_handled;
-    }
-    goto __pyx_L23_except_error;
-    __pyx_L23_except_error:;
-    __Pyx_XGIVEREF(__pyx_t_11);
-    __Pyx_XGIVEREF(__pyx_t_12);
-    __Pyx_XGIVEREF(__pyx_t_13);
-    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
-    goto __pyx_L1_error;
-    __pyx_L22_exception_handled:;
-    __Pyx_XGIVEREF(__pyx_t_11);
-    __Pyx_XGIVEREF(__pyx_t_12);
-    __Pyx_XGIVEREF(__pyx_t_13);
-    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
-    __pyx_L28_try_end:;
-  }
-
-  /* "pysam/cvcf.pyx":417
- *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *         # if number is 0 - type must be Flag
- *         if n == 0 and data['type'] != 'Flag':             # <<<<<<<<<<<<<<
- *             self.error( line, self.ZERO_FOR_NON_FLAG_FIELD)
- *             # force type 'Flag' if no number
- */
-  __pyx_t_10 = PyObject_RichCompare(__pyx_v_n, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  if (__pyx_t_4) {
-    __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_type); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_n_s_Flag, Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_t_3 = __pyx_t_8;
-  } else {
-    __pyx_t_3 = __pyx_t_4;
-  }
-  if (__pyx_t_3) {
-
-    /* "pysam/cvcf.pyx":418
- *         # if number is 0 - type must be Flag
- *         if n == 0 and data['type'] != 'Flag':
- *             self.error( line, self.ZERO_FOR_NON_FLAG_FIELD)             # <<<<<<<<<<<<<<
- *             # force type 'Flag' if no number
- *             data['type'] = 'Flag'
- */
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ZERO_FOR_NON_FLAG_FIELD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":420
- *             self.error( line, self.ZERO_FOR_NON_FLAG_FIELD)
- *             # force type 'Flag' if no number
- *             data['type'] = 'Flag'             # <<<<<<<<<<<<<<
- * 
- *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])
- */
-    if (unlikely(PyDict_SetItem(__pyx_v_data, __pyx_n_s_type, __pyx_n_s_Flag) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    goto __pyx_L32;
-  }
-  __pyx_L32:;
-
-  /* "pysam/cvcf.pyx":422
- *             data['type'] = 'Flag'
- * 
- *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])             # <<<<<<<<<<<<<<
- * 
- *     def format_format( self, fmt, filter=False ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_id); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_9);
-  if (unlikely(!__pyx_v_t)) { __Pyx_RaiseUnboundLocalError("t"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_type); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_descr); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_data, __pyx_n_s_missing); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_15);
-  __pyx_t_5 = PyTuple_New(6); 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);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_9);
-  __Pyx_INCREF(__pyx_v_t);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_t);
-  __Pyx_GIVEREF(__pyx_v_t);
-  __Pyx_INCREF(__pyx_v_n);
-  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_n);
-  __Pyx_GIVEREF(__pyx_v_n);
-  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_10);
-  __Pyx_GIVEREF(__pyx_t_10);
-  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_15);
-  __Pyx_GIVEREF(__pyx_t_15);
-  __pyx_t_9 = 0;
-  __pyx_t_10 = 0;
-  __pyx_t_2 = 0;
-  __pyx_t_15 = 0;
-  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_15);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_r = __pyx_t_15;
-  __pyx_t_15 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":352
- *         raise ValueError(errorstring)
- * 
- *     def parse_format(self,line,format,filter=False):             # <<<<<<<<<<<<<<
- *         if self._version == 40:
- *             if not format.startswith('<'):
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_15);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_data);
-  __Pyx_XDECREF(__pyx_v_idx);
-  __Pyx_XDECREF(__pyx_v_elts);
-  __Pyx_XDECREF(__pyx_v_first);
-  __Pyx_XDECREF(__pyx_v_rest);
-  __Pyx_XDECREF(__pyx_v_n);
-  __Pyx_XDECREF(__pyx_v_t);
-  __Pyx_XDECREF(__pyx_v_format);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":424
- *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])
- * 
- *     def format_format( self, fmt, filter=False ):             # <<<<<<<<<<<<<<
- *         values = [('ID',fmt.id)]
- *         if fmt.number != None and not filter:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_7format_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_7format_format = {__Pyx_NAMESTR("format_format"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_7format_format, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_7format_format(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_fmt = 0;
-  PyObject *__pyx_v_filter = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("format_format (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_fmt,&__pyx_n_s_filter_2,0};
-    PyObject* values[3] = {0,0,0};
-    values[2] = ((PyObject *)((PyObject *)Py_False));
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fmt)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("format_format", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter_2);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format_format") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_self = values[0];
-    __pyx_v_fmt = values[1];
-    __pyx_v_filter = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("format_format", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.format_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_6format_format(__pyx_self, __pyx_v_self, __pyx_v_fmt, __pyx_v_filter);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_6format_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fmt, PyObject *__pyx_v_filter) {
-  PyObject *__pyx_v_values = NULL;
-  PyObject *__pyx_v_nmb = NULL;
-  PyObject *__pyx_v_format = NULL;
-  PyObject *__pyx_v_k = NULL;
-  PyObject *__pyx_v_v = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_t_5;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  Py_ssize_t __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *(*__pyx_t_12)(PyObject *);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("format_format", 0);
-
-  /* "pysam/cvcf.pyx":425
- * 
- *     def format_format( self, fmt, filter=False ):
- *         values = [('ID',fmt.id)]             # <<<<<<<<<<<<<<
- *         if fmt.number != None and not filter:
- *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_n_s_ID_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ID_2);
-  __Pyx_GIVEREF(__pyx_n_s_ID_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_v_values = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":426
- *     def format_format( self, fmt, filter=False ):
- *         values = [('ID',fmt.id)]
- *         if fmt.number != None and not filter:             # <<<<<<<<<<<<<<
- *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
- *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_number); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = (!__pyx_t_4);
-    __pyx_t_4 = __pyx_t_5;
-  } else {
-    __pyx_t_4 = __pyx_t_3;
-  }
-  if (__pyx_t_4) {
-
-    /* "pysam/cvcf.pyx":427
- *         values = [('ID',fmt.id)]
- *         if fmt.number != None and not filter:
- *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."             # <<<<<<<<<<<<<<
- *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
- *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); 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_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_4) {
-      __Pyx_INCREF(__pyx_kp_s__8);
-      __pyx_v_nmb = __pyx_kp_s__8;
-      goto __pyx_L4;
-    }
-
-    /* "pysam/cvcf.pyx":428
- *         if fmt.number != None and not filter:
- *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
- *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)             # <<<<<<<<<<<<<<
- *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
- *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
- */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_4) {
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_number); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_v_nmb = __pyx_t_2;
-      __pyx_t_2 = 0;
-      goto __pyx_L4;
-    }
-
-    /* "pysam/cvcf.pyx":429
- *             if fmt.numbertype == self.NT_UNKNOWN: nmb = "."
- *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
- *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"             # <<<<<<<<<<<<<<
- *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
- *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); 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_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_4) {
-      __Pyx_INCREF(__pyx_kp_s_alleles);
-      __pyx_v_nmb = __pyx_kp_s_alleles;
-      goto __pyx_L4;
-    }
-
-    /* "pysam/cvcf.pyx":430
- *             elif fmt.numbertype == self.NT_NUMBER: nmb = str(fmt.number)
- *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
- *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"             # <<<<<<<<<<<<<<
- *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
- *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
- */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NR_ALLELES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_4) {
-      __Pyx_INCREF(__pyx_kp_s_nonref_alleles);
-      __pyx_v_nmb = __pyx_kp_s_nonref_alleles;
-      goto __pyx_L4;
-    }
-
-    /* "pysam/cvcf.pyx":431
- *             elif fmt.numbertype == self.NT_ALLELES: nmb = "#alleles"
- *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
- *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"             # <<<<<<<<<<<<<<
- *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
- *             else:
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (__pyx_t_4) {
-      __Pyx_INCREF(__pyx_kp_s_genotypes);
-      __pyx_v_nmb = __pyx_kp_s_genotypes;
-      goto __pyx_L4;
-    }
-
-    /* "pysam/cvcf.pyx":432
- *             elif fmt.numbertype == self.NT_NR_ALLELES: nmb = "#nonref_alleles"
- *             elif fmt.numbertype == self.NT_GENOTYPES: nmb = "#genotypes"
- *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"             # <<<<<<<<<<<<<<
- *             else:
- *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
- */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_4) {
-      __Pyx_INCREF(__pyx_kp_s_phased_genotypes);
-      __pyx_v_nmb = __pyx_kp_s_phased_genotypes;
-      goto __pyx_L4;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":434
- *             elif fmt.numbertype == self.NT_PHASED_GENOTYPES: nmb = "#phased_genotypes"
- *             else:
- *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)             # <<<<<<<<<<<<<<
- *             values.append( ('Number',nmb) )
- *             values.append( ('Type', fmt.type) )
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_number_type_encountered, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __pyx_L4:;
-
-    /* "pysam/cvcf.pyx":435
- *             else:
- *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
- *             values.append( ('Number',nmb) )             # <<<<<<<<<<<<<<
- *             values.append( ('Type', fmt.type) )
- *         values.append( ('Description', '"' + fmt.description + '"') )
- */
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_n_s_Number_2);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Number_2);
-    __Pyx_GIVEREF(__pyx_n_s_Number_2);
-    __Pyx_INCREF(__pyx_v_nmb);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nmb);
-    __Pyx_GIVEREF(__pyx_v_nmb);
-    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":436
- *                 raise ValueError("Unknown number type encountered: %s" % fmt.numbertype)
- *             values.append( ('Number',nmb) )
- *             values.append( ('Type', fmt.type) )             # <<<<<<<<<<<<<<
- *         values.append( ('Description', '"' + fmt.description + '"') )
- *         if self._version == 33:
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __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 = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_n_s_Type_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Type_2);
-    __Pyx_GIVEREF(__pyx_n_s_Type_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":437
- *             values.append( ('Number',nmb) )
- *             values.append( ('Type', fmt.type) )
- *         values.append( ('Description', '"' + fmt.description + '"') )             # <<<<<<<<<<<<<<
- *         if self._version == 33:
- *             format = ",".join([v for k,v in values])
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_description); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyNumber_Add(__pyx_kp_s__29, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__29); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_n_s_Description_2);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Description_2);
-  __Pyx_GIVEREF(__pyx_n_s_Description_2);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":438
- *             values.append( ('Type', fmt.type) )
- *         values.append( ('Description', '"' + fmt.description + '"') )
- *         if self._version == 33:             # <<<<<<<<<<<<<<
- *             format = ",".join([v for k,v in values])
- *         else:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_33, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_4) {
-
-    /* "pysam/cvcf.pyx":439
- *         values.append( ('Description', '"' + fmt.description + '"') )
- *         if self._version == 33:
- *             format = ",".join([v for k,v in values])             # <<<<<<<<<<<<<<
- *         else:
- *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"
- */
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
-    for (;;) {
-      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
-        PyObject* sequence = __pyx_t_6;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        Py_ssize_t size = Py_SIZE(sequence);
-        #else
-        Py_ssize_t size = PySequence_Size(sequence);
-        #endif
-        if (unlikely(size != 2)) {
-          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        #if CYTHON_COMPILING_IN_CPYTHON
-        if (likely(PyTuple_CheckExact(sequence))) {
-          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
-          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
-        } else {
-          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
-          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
-        }
-        __Pyx_INCREF(__pyx_t_9);
-        __Pyx_INCREF(__pyx_t_10);
-        #else
-        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        #endif
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      } else {
-        Py_ssize_t index = -1;
-        __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
-        index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_9);
-        index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_10);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_12 = NULL;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        goto __pyx_L9_unpacking_done;
-        __pyx_L8_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __pyx_t_12 = NULL;
-        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L9_unpacking_done:;
-      }
-      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_9);
-      __pyx_t_9 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_10);
-      __pyx_t_10 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_v_v))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_format = ((PyObject*)__pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L5;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":441
- *             format = ",".join([v for k,v in values])
- *         else:
- *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"             # <<<<<<<<<<<<<<
- *         return format
- * 
- */
-    __pyx_t_1 = PyList_New(0); 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_2 = __pyx_v_values; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
-    for (;;) {
-      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
-        PyObject* sequence = __pyx_t_6;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        Py_ssize_t size = Py_SIZE(sequence);
-        #else
-        Py_ssize_t size = PySequence_Size(sequence);
-        #endif
-        if (unlikely(size != 2)) {
-          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        #if CYTHON_COMPILING_IN_CPYTHON
-        if (likely(PyTuple_CheckExact(sequence))) {
-          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
-          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
-        } else {
-          __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
-          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
-        }
-        __Pyx_INCREF(__pyx_t_10);
-        __Pyx_INCREF(__pyx_t_9);
-        #else
-        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        #endif
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      } else {
-        Py_ssize_t index = -1;
-        __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
-        index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_10);
-        index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed;
-        __Pyx_GOTREF(__pyx_t_9);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_12 = NULL;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        goto __pyx_L13_unpacking_done;
-        __pyx_L12_unpacking_failed:;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __pyx_t_12 = NULL;
-        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_L13_unpacking_done:;
-      }
-      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_10);
-      __pyx_t_10 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9);
-      __pyx_t_9 = 0;
-      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_INCREF(__pyx_v_k);
-      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_k);
-      __Pyx_GIVEREF(__pyx_v_k);
-      __Pyx_INCREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_v);
-      __Pyx_GIVEREF(__pyx_v_v);
-      __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __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_Add(__pyx_kp_s__21, __pyx_t_2); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_format = ((PyObject*)__pyx_t_2);
-    __pyx_t_2 = 0;
-  }
-  __pyx_L5:;
-
-  /* "pysam/cvcf.pyx":442
- *         else:
- *             format = "<" + (",".join( ["%s=%s" % (k,v) for (k,v) in values] )) + ">"
- *         return format             # <<<<<<<<<<<<<<
- * 
- *     def get_expected(self, format, formatdict, alt):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_format);
-  __pyx_r = __pyx_v_format;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":424
- *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])
- * 
- *     def format_format( self, fmt, filter=False ):             # <<<<<<<<<<<<<<
- *         values = [('ID',fmt.id)]
- *         if fmt.number != None and not filter:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.format_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_values);
-  __Pyx_XDECREF(__pyx_v_nmb);
-  __Pyx_XDECREF(__pyx_v_format);
-  __Pyx_XDECREF(__pyx_v_k);
-  __Pyx_XDECREF(__pyx_v_v);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":444
- *         return format
- * 
- *     def get_expected(self, format, formatdict, alt):             # <<<<<<<<<<<<<<
- *         fmt = formatdict[format]
- *         if fmt.numbertype == self.NT_UNKNOWN: return -1
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_9get_expected(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_9get_expected = {__Pyx_NAMESTR("get_expected"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_9get_expected, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_9get_expected(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_format = 0;
-  PyObject *__pyx_v_formatdict = 0;
-  PyObject *__pyx_v_alt = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("get_expected (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,&__pyx_n_s_formatdict,&__pyx_n_s_alt,0};
-    PyObject* values[4] = {0,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  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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_formatdict)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alt)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_expected") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
-      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);
-      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
-    }
-    __pyx_v_self = values[0];
-    __pyx_v_format = values[1];
-    __pyx_v_formatdict = values[2];
-    __pyx_v_alt = values[3];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get_expected", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.get_expected", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_8get_expected(__pyx_self, __pyx_v_self, __pyx_v_format, __pyx_v_formatdict, __pyx_v_alt);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_8get_expected(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_alt) {
-  PyObject *__pyx_v_fmt = 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;
-  Py_ssize_t __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("get_expected", 0);
-
-  /* "pysam/cvcf.pyx":445
- * 
- *     def get_expected(self, format, formatdict, alt):
- *         fmt = formatdict[format]             # <<<<<<<<<<<<<<
- *         if fmt.numbertype == self.NT_UNKNOWN: return -1
- *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
- */
-  __pyx_t_1 = PyObject_GetItem(__pyx_v_formatdict, __pyx_v_format); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_v_fmt = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":446
- *     def get_expected(self, format, formatdict, alt):
- *         fmt = formatdict[format]
- *         if fmt.numbertype == self.NT_UNKNOWN: return -1             # <<<<<<<<<<<<<<
- *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
- *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); 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);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_4) {
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_int_neg_1);
-    __pyx_r = __pyx_int_neg_1;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":447
- *         fmt = formatdict[format]
- *         if fmt.numbertype == self.NT_UNKNOWN: return -1
- *         if fmt.numbertype == self.NT_NUMBER: return fmt.number             # <<<<<<<<<<<<<<
- *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
- *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_4) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_number); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":448
- *         if fmt.numbertype == self.NT_UNKNOWN: return -1
- *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
- *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1             # <<<<<<<<<<<<<<
- *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
- *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_4) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_5 + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":449
- *         if fmt.numbertype == self.NT_NUMBER: return fmt.number
- *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
- *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)             # <<<<<<<<<<<<<<
- *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
- *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NR_ALLELES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_4) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":450
- *         if fmt.numbertype == self.NT_ALLELES: return len(alt)+1
- *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
- *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2             # <<<<<<<<<<<<<<
- *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
- *         return 0
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_4) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t(((__pyx_t_5 + 1) * (__pyx_t_6 + 2)), 2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_r = __pyx_t_3;
-    __pyx_t_3 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":451
- *         if fmt.numbertype == self.NT_NR_ALLELES: return len(alt)
- *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
- *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)             # <<<<<<<<<<<<<<
- *         return 0
- * 
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fmt, __pyx_n_s_numbertype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_PHASED_GENOTYPES); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_4) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_6 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = PyObject_Length(__pyx_v_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_1 = PyInt_FromSsize_t(((__pyx_t_6 + 1) * (__pyx_t_5 + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_r = __pyx_t_1;
-    __pyx_t_1 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":452
- *         if fmt.numbertype == self.NT_GENOTYPES: return ((len(alt)+1)*(len(alt)+2)) // 2
- *         if fmt.numbertype == self.NT_PHASED_GENOTYPES: return (len(alt)+1)*(len(alt)+1)
- *         return 0             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_int_0);
-  __pyx_r = __pyx_int_0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":444
- *         return format
- * 
- *     def get_expected(self, format, formatdict, alt):             # <<<<<<<<<<<<<<
- *         fmt = formatdict[format]
- *         if fmt.numbertype == self.NT_UNKNOWN: return -1
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.get_expected", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_fmt);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":455
- * 
- * 
- *     def _add_definition(self, formatdict, key, data, line ):             # <<<<<<<<<<<<<<
- *         if key in formatdict: return
- *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_11_add_definition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_11_add_definition = {__Pyx_NAMESTR("_add_definition"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_11_add_definition, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_11_add_definition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_formatdict = 0;
-  PyObject *__pyx_v_key = 0;
-  PyObject *__pyx_v_data = 0;
-  PyObject *__pyx_v_line = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_add_definition (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_formatdict,&__pyx_n_s_key,&__pyx_n_s_data,&__pyx_n_s_line,0};
-    PyObject* values[5] = {0,0,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  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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_formatdict)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  4:
-        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_add_definition") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
-      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);
-      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
-      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
-    }
-    __pyx_v_self = values[0];
-    __pyx_v_formatdict = values[1];
-    __pyx_v_key = values[2];
-    __pyx_v_data = values[3];
-    __pyx_v_line = values[4];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_add_definition", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF._add_definition", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_10_add_definition(__pyx_self, __pyx_v_self, __pyx_v_formatdict, __pyx_v_key, __pyx_v_data, __pyx_v_line);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_10_add_definition(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_key, PyObject *__pyx_v_data, PyObject *__pyx_v_line) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  int __pyx_t_2;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_add_definition", 0);
-  __Pyx_INCREF(__pyx_v_data);
-
-  /* "pysam/cvcf.pyx":456
- * 
- *     def _add_definition(self, formatdict, key, data, line ):
- *         if key in formatdict: return             # <<<<<<<<<<<<<<
- *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
- *         if data == None:
- */
-  __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_formatdict, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = (__pyx_t_1 != 0);
-  if (__pyx_t_2) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":457
- *     def _add_definition(self, formatdict, key, data, line ):
- *         if key in formatdict: return
- *         self.error(line,self.ERROR_UNKNOWN_KEY,key)             # <<<<<<<<<<<<<<
- *         if data == None:
- *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_UNKNOWN_KEY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_INCREF(__pyx_v_line);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
-  __Pyx_GIVEREF(__pyx_v_line);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_key);
-  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_key);
-  __Pyx_GIVEREF(__pyx_v_key);
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/cvcf.pyx":458
- *         if key in formatdict: return
- *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
- *         if data == None:             # <<<<<<<<<<<<<<
- *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
- *             return
- */
-  __pyx_t_4 = PyObject_RichCompare(__pyx_v_data, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/cvcf.pyx":459
- *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
- *         if data == None:
- *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")             # <<<<<<<<<<<<<<
- *             return
- *         if data == []: data = [""]             # unsure what type -- say string
- */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __Pyx_INCREF(__pyx_int_0);
-    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
-    __Pyx_GIVEREF(__pyx_int_0);
-    __Pyx_INCREF(__pyx_n_s_Flag);
-    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Flag);
-    __Pyx_GIVEREF(__pyx_n_s_Flag);
-    __Pyx_INCREF(__pyx_kp_s_Undefined_tag);
-    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_s_Undefined_tag);
-    __Pyx_GIVEREF(__pyx_kp_s_Undefined_tag);
-    __Pyx_INCREF(__pyx_kp_s__8);
-    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_kp_s__8);
-    __Pyx_GIVEREF(__pyx_kp_s__8);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (unlikely(PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":460
- *         if data == None:
- *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
- *             return             # <<<<<<<<<<<<<<
- *         if data == []: data = [""]             # unsure what type -- say string
- *         if type(data[0]) == type(0.0):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":461
- *             formatdict[key] = FORMAT(key,self.NT_NUMBER,0,"Flag","(Undefined tag)",".")
- *             return
- *         if data == []: data = [""]             # unsure what type -- say string             # <<<<<<<<<<<<<<
- *         if type(data[0]) == type(0.0):
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
- */
-  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_v_data, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_2) {
-    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_kp_s_);
-    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_);
-    __Pyx_GIVEREF(__pyx_kp_s_);
-    __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_3);
-    __pyx_t_3 = 0;
-    goto __pyx_L5;
-  }
-  __pyx_L5:;
-
-  /* "pysam/cvcf.pyx":462
- *             return
- *         if data == []: data = [""]             # unsure what type -- say string
- *         if type(data[0]) == type(0.0):             # <<<<<<<<<<<<<<
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
- *             return
- */
-  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_3)), ((PyObject *)Py_TYPE(__pyx_float_0_0)), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/cvcf.pyx":463
- *         if data == []: data = [""]             # unsure what type -- say string
- *         if type(data[0]) == type(0.0):
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)             # <<<<<<<<<<<<<<
- *             return
- *         if type(data[0]) == type(0):
- */
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_int_neg_1);
-    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_neg_1);
-    __Pyx_GIVEREF(__pyx_int_neg_1);
-    __Pyx_INCREF(__pyx_n_s_Float);
-    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_n_s_Float);
-    __Pyx_GIVEREF(__pyx_n_s_Float);
-    __Pyx_INCREF(__pyx_kp_s_Undefined_tag);
-    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_s_Undefined_tag);
-    __Pyx_GIVEREF(__pyx_kp_s_Undefined_tag);
-    __Pyx_INCREF(Py_None);
-    PyTuple_SET_ITEM(__pyx_t_4, 5, Py_None);
-    __Pyx_GIVEREF(Py_None);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/cvcf.pyx":464
- *         if type(data[0]) == type(0.0):
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
- *             return             # <<<<<<<<<<<<<<
- *         if type(data[0]) == type(0):
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":465
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Float","(Undefined tag)",None)
- *             return
- *         if type(data[0]) == type(0):             # <<<<<<<<<<<<<<
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
- *             return
- */
-  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_t_3)), ((PyObject *)Py_TYPE(__pyx_int_0)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_2) {
-
-    /* "pysam/cvcf.pyx":466
- *             return
- *         if type(data[0]) == type(0):
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)             # <<<<<<<<<<<<<<
- *             return
- *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")
- */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_int_neg_1);
-    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_neg_1);
-    __Pyx_GIVEREF(__pyx_int_neg_1);
-    __Pyx_INCREF(__pyx_n_s_Integer);
-    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_n_s_Integer);
-    __Pyx_GIVEREF(__pyx_n_s_Integer);
-    __Pyx_INCREF(__pyx_kp_s_Undefined_tag);
-    PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_s_Undefined_tag);
-    __Pyx_GIVEREF(__pyx_kp_s_Undefined_tag);
-    __Pyx_INCREF(Py_None);
-    PyTuple_SET_ITEM(__pyx_t_5, 5, Py_None);
-    __Pyx_GIVEREF(Py_None);
-    __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-    /* "pysam/cvcf.pyx":467
- *         if type(data[0]) == type(0):
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
- *             return             # <<<<<<<<<<<<<<
- *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")
- * 
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":468
- *             formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"Integer","(Undefined tag)",None)
- *             return
- *         formatdict[key] = FORMAT(key,self.NT_UNKNOWN,-1,"String","(Undefined tag)",".")             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_key);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
-  __Pyx_GIVEREF(__pyx_v_key);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __Pyx_INCREF(__pyx_n_s_String);
-  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_n_s_String);
-  __Pyx_GIVEREF(__pyx_n_s_String);
-  __Pyx_INCREF(__pyx_kp_s_Undefined_tag);
-  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_s_Undefined_tag);
-  __Pyx_GIVEREF(__pyx_kp_s_Undefined_tag);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (unlikely(PyObject_SetItem(__pyx_v_formatdict, __pyx_v_key, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":455
- * 
- * 
- *     def _add_definition(self, formatdict, key, data, line ):             # <<<<<<<<<<<<<<
- *         if key in formatdict: return
- *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.cvcf.VCF._add_definition", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_data);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":472
- * 
- *     # todo: trim trailing missing values
- *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):             # <<<<<<<<<<<<<<
- *         output, sdata = [], []
- *         if type(data) == type([]): # for FORMAT field, make data with dummy values
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_13format_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_13format_formatdata = {__Pyx_NAMESTR("format_formatdata"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_13format_formatdata, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_13format_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_data = 0;
-  PyObject *__pyx_v_format = 0;
-  PyObject *__pyx_v_key = 0;
-  PyObject *__pyx_v_value = 0;
-  PyObject *__pyx_v_separator = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("format_formatdata (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,&__pyx_n_s_format,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_separator,0};
-    PyObject* values[6] = {0,0,0,0,0,0};
-    values[3] = ((PyObject *)((PyObject *)Py_True));
-    values[4] = ((PyObject *)((PyObject *)Py_True));
-    values[5] = ((PyObject *)((PyObject*)__pyx_kp_s__4));
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value);
-          if (value) { values[4] = value; kw_args--; }
-        }
-        case  5:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_separator);
-          if (value) { values[5] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "format_formatdata") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else {
-      switch (PyTuple_GET_SIZE(__pyx_args)) {
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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);
-        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_self = values[0];
-    __pyx_v_data = values[1];
-    __pyx_v_format = values[2];
-    __pyx_v_key = values[3];
-    __pyx_v_value = values[4];
-    __pyx_v_separator = values[5];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("format_formatdata", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.format_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_12format_formatdata(__pyx_self, __pyx_v_self, __pyx_v_data, __pyx_v_format, __pyx_v_key, __pyx_v_value, __pyx_v_separator);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_12format_formatdata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_format, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_separator) {
-  PyObject *__pyx_v_output = NULL;
-  PyObject *__pyx_v_sdata = NULL;
-  PyObject *__pyx_v_d = NULL;
-  PyObject *__pyx_v_k = NULL;
-  PyObject *__pyx_v_idx = NULL;
-  PyObject *__pyx_v_v = NULL;
-  PyObject *__pyx_v_last = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  Py_ssize_t __pyx_t_4;
-  PyObject *(*__pyx_t_5)(PyObject *);
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  Py_ssize_t __pyx_t_8;
-  PyObject *(*__pyx_t_9)(PyObject *);
-  PyObject *__pyx_t_10 = NULL;
-  int __pyx_t_11;
-  int __pyx_t_12;
-  PyObject *(*__pyx_t_13)(PyObject *);
-  int __pyx_t_14;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("format_formatdata", 0);
-  __Pyx_INCREF(__pyx_v_data);
-
-  /* "pysam/cvcf.pyx":473
- *     # todo: trim trailing missing values
- *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):
- *         output, sdata = [], []             # <<<<<<<<<<<<<<
- *         if type(data) == type([]): # for FORMAT field, make data with dummy values
- *             d = {}
- */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __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 = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_output = ((PyObject*)__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_v_sdata = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":474
- *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):
- *         output, sdata = [], []
- *         if type(data) == type([]): # for FORMAT field, make data with dummy values             # <<<<<<<<<<<<<<
- *             d = {}
- *             for k in data: d[k] = []
- */
-  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_v_data)), ((PyObject *)Py_TYPE(__pyx_t_2)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_3) {
-
-    /* "pysam/cvcf.pyx":475
- *         output, sdata = [], []
- *         if type(data) == type([]): # for FORMAT field, make data with dummy values
- *             d = {}             # <<<<<<<<<<<<<<
- *             for k in data: d[k] = []
- *             data = d
- */
-    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_v_d = ((PyObject*)__pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":476
- *         if type(data) == type([]): # for FORMAT field, make data with dummy values
- *             d = {}
- *             for k in data: d[k] = []             # <<<<<<<<<<<<<<
- *             data = d
- *         # convert missing values; and silently add definitions if required
- */
-    if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
-      __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
-      __pyx_t_5 = NULL;
-    } else {
-      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_2 = __pyx_t_5(__pyx_t_1);
-        if (unlikely(!__pyx_t_2)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_2);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_v_k, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":477
- *             d = {}
- *             for k in data: d[k] = []
- *             data = d             # <<<<<<<<<<<<<<
- *         # convert missing values; and silently add definitions if required
- *         for k in data:
- */
-    __Pyx_INCREF(__pyx_v_d);
-    __Pyx_DECREF_SET(__pyx_v_data, __pyx_v_d);
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":479
- *             data = d
- *         # convert missing values; and silently add definitions if required
- *         for k in data:             # <<<<<<<<<<<<<<
- *             self._add_definition( format, k, data[k], "(output)" )
- *             for idx,v in enumerate(data[k]):
- */
-  if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
-    __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
-      if (unlikely(!__pyx_t_2)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_2);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":480
- *         # convert missing values; and silently add definitions if required
- *         for k in data:
- *             self._add_definition( format, k, data[k], "(output)" )             # <<<<<<<<<<<<<<
- *             for idx,v in enumerate(data[k]):
- *                 if v == format[k].missingvalue: data[k][idx] = "."
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_definition); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_format);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_format);
-    __Pyx_GIVEREF(__pyx_v_format);
-    __Pyx_INCREF(__pyx_v_k);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_k);
-    __Pyx_GIVEREF(__pyx_v_k);
-    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __Pyx_INCREF(__pyx_kp_s_output);
-    PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_kp_s_output);
-    __Pyx_GIVEREF(__pyx_kp_s_output);
-    __pyx_t_6 = 0;
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-    /* "pysam/cvcf.pyx":481
- *         for k in data:
- *             self._add_definition( format, k, data[k], "(output)" )
- *             for idx,v in enumerate(data[k]):             # <<<<<<<<<<<<<<
- *                 if v == format[k].missingvalue: data[k][idx] = "."
- *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
- */
-    __Pyx_INCREF(__pyx_int_0);
-    __pyx_t_6 = __pyx_int_0;
-    __pyx_t_7 = PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_7);
-    if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
-      __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
-      __pyx_t_9 = NULL;
-    } else {
-      __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext;
-    }
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    for (;;) {
-      if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_2)) {
-        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_2)) {
-        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_7 = __pyx_t_9(__pyx_t_2);
-        if (unlikely(!__pyx_t_7)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_7);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
-      __pyx_t_7 = 0;
-      __Pyx_INCREF(__pyx_t_6);
-      __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_6);
-      __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_6);
-      __pyx_t_6 = __pyx_t_7;
-      __pyx_t_7 = 0;
-
-      /* "pysam/cvcf.pyx":482
- *             self._add_definition( format, k, data[k], "(output)" )
- *             for idx,v in enumerate(data[k]):
- *                 if v == format[k].missingvalue: data[k][idx] = "."             # <<<<<<<<<<<<<<
- *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
- *         for k in data:
- */
-      __pyx_t_7 = PyObject_GetItem(__pyx_v_format, __pyx_v_k); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_missingvalue); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = PyObject_RichCompare(__pyx_v_v, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      if (__pyx_t_3) {
-        __pyx_t_7 = PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        if (unlikely(PyObject_SetItem(__pyx_t_7, __pyx_v_idx, __pyx_kp_s__8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        goto __pyx_L10;
-      }
-      __pyx_L10:;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":484
- *                 if v == format[k].missingvalue: data[k][idx] = "."
- *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
- *         for k in data:             # <<<<<<<<<<<<<<
- *             if k != 'GT': sdata.append( (k,data[k]) )
- *         sdata.sort()
- */
-  if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) {
-    __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_6 = __pyx_t_5(__pyx_t_1);
-      if (unlikely(!__pyx_t_6)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_6);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
-    __pyx_t_6 = 0;
-
-    /* "pysam/cvcf.pyx":485
- *         # make sure GT comes first; and ensure fixed ordering; also convert GT data back to string
- *         for k in data:
- *             if k != 'GT': sdata.append( (k,data[k]) )             # <<<<<<<<<<<<<<
- *         sdata.sort()
- *         if 'GT' in data:
- */
-    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_k, __pyx_n_s_GT, Py_NE)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_3) {
-      __pyx_t_6 = PyObject_GetItem(__pyx_v_data, __pyx_v_k); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_k);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k);
-      __Pyx_GIVEREF(__pyx_v_k);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_sdata, __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L13;
-    }
-    __pyx_L13:;
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":486
- *         for k in data:
- *             if k != 'GT': sdata.append( (k,data[k]) )
- *         sdata.sort()             # <<<<<<<<<<<<<<
- *         if 'GT' in data:
- *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
- */
-  __pyx_t_11 = PyList_Sort(__pyx_v_sdata); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":487
- *             if k != 'GT': sdata.append( (k,data[k]) )
- *         sdata.sort()
- *         if 'GT' in data:             # <<<<<<<<<<<<<<
- *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
- *         for k,v in sdata:
- */
-  __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_n_s_GT, __pyx_v_data, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_12 = (__pyx_t_3 != 0);
-  if (__pyx_t_12) {
-
-    /* "pysam/cvcf.pyx":488
- *         sdata.sort()
- *         if 'GT' in data:
- *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata             # <<<<<<<<<<<<<<
- *         for k,v in sdata:
- *             if v == []: v = None
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_convertGTback); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_GT); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_1 = 0;
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_INCREF(__pyx_n_s_GT);
-    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_GT);
-    __Pyx_GIVEREF(__pyx_n_s_GT);
-    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
-    __Pyx_GIVEREF(__pyx_t_6);
-    __pyx_t_6 = 0;
-    __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_v_sdata); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF_SET(__pyx_v_sdata, ((PyObject*)__pyx_t_6));
-    __pyx_t_6 = 0;
-    goto __pyx_L14;
-  }
-  __pyx_L14:;
-
-  /* "pysam/cvcf.pyx":489
- *         if 'GT' in data:
- *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
- *         for k,v in sdata:             # <<<<<<<<<<<<<<
- *             if v == []: v = None
- *             if key and value:
- */
-  __pyx_t_6 = __pyx_v_sdata; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0;
-  for (;;) {
-    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #else
-    __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #endif
-    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
-      PyObject* sequence = __pyx_t_2;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 2)) {
-        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
-      } else {
-        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
-      }
-      __Pyx_INCREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_t_7);
-      #else
-      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      #endif
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
-      index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L17_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_1);
-      index = 1; __pyx_t_7 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_7);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_13 = NULL;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      goto __pyx_L18_unpacking_done;
-      __pyx_L17_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_t_13 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L18_unpacking_done:;
-    }
-    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1);
-    __pyx_t_1 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7);
-    __pyx_t_7 = 0;
-
-    /* "pysam/cvcf.pyx":490
- *             sdata = [('GT',map(self.convertGTback,data['GT']))] + sdata
- *         for k,v in sdata:
- *             if v == []: v = None             # <<<<<<<<<<<<<<
- *             if key and value:
- *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
- */
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = PyObject_RichCompare(__pyx_v_v, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (__pyx_t_12) {
-      __Pyx_INCREF(Py_None);
-      __Pyx_DECREF_SET(__pyx_v_v, Py_None);
-      goto __pyx_L19;
-    }
-    __pyx_L19:;
-
-    /* "pysam/cvcf.pyx":491
- *         for k,v in sdata:
- *             if v == []: v = None
- *             if key and value:             # <<<<<<<<<<<<<<
- *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
- *                 else: output.append( k )
- */
-    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_12) {
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_14 = __pyx_t_3;
-    } else {
-      __pyx_t_14 = __pyx_t_12;
-    }
-    if (__pyx_t_14) {
-
-      /* "pysam/cvcf.pyx":492
- *             if v == []: v = None
- *             if key and value:
- *                 if v != None: output.append( k+"="+','.join(map(str,v)) )             # <<<<<<<<<<<<<<
- *                 else: output.append( k )
- *             elif key: output.append(k)
- */
-      __pyx_t_7 = PyObject_RichCompare(__pyx_v_v, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      if (__pyx_t_14) {
-        __pyx_t_7 = PyNumber_Add(__pyx_v_k, __pyx_kp_s__13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
-        __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-        __Pyx_INCREF(__pyx_v_v);
-        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_v);
-        __Pyx_GIVEREF(__pyx_v_v);
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __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_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_output, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L21;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":493
- *             if key and value:
- *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
- *                 else: output.append( k )             # <<<<<<<<<<<<<<
- *             elif key: output.append(k)
- *             elif value:
- */
-        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_output, __pyx_v_k); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      __pyx_L21:;
-      goto __pyx_L20;
-    }
-
-    /* "pysam/cvcf.pyx":494
- *                 if v != None: output.append( k+"="+','.join(map(str,v)) )
- *                 else: output.append( k )
- *             elif key: output.append(k)             # <<<<<<<<<<<<<<
- *             elif value:
- *                 if v != None: output.append( ','.join(map(str,v)) )
- */
-    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_14) {
-      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_output, __pyx_v_k); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L20;
-    }
-
-    /* "pysam/cvcf.pyx":495
- *                 else: output.append( k )
- *             elif key: output.append(k)
- *             elif value:             # <<<<<<<<<<<<<<
- *                 if v != None: output.append( ','.join(map(str,v)) )
- *                 else: output.append( "." )                    # should not happen
- */
-    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_14) {
-
-      /* "pysam/cvcf.pyx":496
- *             elif key: output.append(k)
- *             elif value:
- *                 if v != None: output.append( ','.join(map(str,v)) )             # <<<<<<<<<<<<<<
- *                 else: output.append( "." )                    # should not happen
- *         # snip off trailing missing data
- */
-      __pyx_t_1 = PyObject_RichCompare(__pyx_v_v, Py_None, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (__pyx_t_14) {
-        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
-        __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-        __Pyx_INCREF(__pyx_v_v);
-        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_v);
-        __Pyx_GIVEREF(__pyx_v_v);
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_output, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        goto __pyx_L22;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":497
- *             elif value:
- *                 if v != None: output.append( ','.join(map(str,v)) )
- *                 else: output.append( "." )                    # should not happen             # <<<<<<<<<<<<<<
- *         # snip off trailing missing data
- *         while len(output) > 1:
- */
-        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_output, __pyx_kp_s__8); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      __pyx_L22:;
-      goto __pyx_L20;
-    }
-    __pyx_L20:;
-  }
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "pysam/cvcf.pyx":499
- *                 else: output.append( "." )                    # should not happen
- *         # snip off trailing missing data
- *         while len(output) > 1:             # <<<<<<<<<<<<<<
- *             last = output[-1].replace(',','').replace('.','')
- *             if len(last)>0: break
- */
-  while (1) {
-    __pyx_t_4 = PyList_GET_SIZE(__pyx_v_output); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_14 = ((__pyx_t_4 > 1) != 0);
-    if (!__pyx_t_14) break;
-
-    /* "pysam/cvcf.pyx":500
- *         # snip off trailing missing data
- *         while len(output) > 1:
- *             last = output[-1].replace(',','').replace('.','')             # <<<<<<<<<<<<<<
- *             if len(last)>0: break
- *             output = output[:-1]
- */
-    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_output, -1, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_last, __pyx_t_6);
-    __pyx_t_6 = 0;
-
-    /* "pysam/cvcf.pyx":501
- *         while len(output) > 1:
- *             last = output[-1].replace(',','').replace('.','')
- *             if len(last)>0: break             # <<<<<<<<<<<<<<
- *             output = output[:-1]
- *         return separator.join(output)
- */
-    __pyx_t_4 = PyObject_Length(__pyx_v_last); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_14 = ((__pyx_t_4 > 0) != 0);
-    if (__pyx_t_14) {
-      goto __pyx_L24_break;
-    }
-
-    /* "pysam/cvcf.pyx":502
- *             last = output[-1].replace(',','').replace('.','')
- *             if len(last)>0: break
- *             output = output[:-1]             # <<<<<<<<<<<<<<
- *         return separator.join(output)
- * 
- */
-    __pyx_t_6 = __Pyx_PyList_GetSlice(__pyx_v_output, 0, -1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF_SET(__pyx_v_output, ((PyObject*)__pyx_t_6));
-    __pyx_t_6 = 0;
-  }
-  __pyx_L24_break:;
-
-  /* "pysam/cvcf.pyx":503
- *             if len(last)>0: break
- *             output = output[:-1]
- *         return separator.join(output)             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_separator, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_output);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_output);
-  __Pyx_GIVEREF(__pyx_v_output);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_r = __pyx_t_2;
-  __pyx_t_2 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":472
- * 
- *     # todo: trim trailing missing values
- *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):             # <<<<<<<<<<<<<<
- *         output, sdata = [], []
- *         if type(data) == type([]): # for FORMAT field, make data with dummy values
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.format_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_output);
-  __Pyx_XDECREF(__pyx_v_sdata);
-  __Pyx_XDECREF(__pyx_v_d);
-  __Pyx_XDECREF(__pyx_v_k);
-  __Pyx_XDECREF(__pyx_v_idx);
-  __Pyx_XDECREF(__pyx_v_v);
-  __Pyx_XDECREF(__pyx_v_last);
-  __Pyx_XDECREF(__pyx_v_data);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":506
- * 
- * 
- *     def enter_default_format(self):             # <<<<<<<<<<<<<<
- *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_15enter_default_format(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_15enter_default_format = {__Pyx_NAMESTR("enter_default_format"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_15enter_default_format, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_15enter_default_format(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("enter_default_format (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_14enter_default_format(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_14enter_default_format(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_v_f = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  PyObject *__pyx_t_14 = NULL;
-  PyObject *__pyx_t_15 = NULL;
-  PyObject *__pyx_t_16 = NULL;
-  Py_ssize_t __pyx_t_17;
-  int __pyx_t_18;
-  int __pyx_t_19;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("enter_default_format", 0);
-
-  /* "pysam/cvcf.pyx":507
- * 
- *     def enter_default_format(self):
- *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
- *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'),
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_n_s_GT);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_GT);
-  __Pyx_GIVEREF(__pyx_n_s_GT);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_n_s_String);
-  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_String);
-  __Pyx_GIVEREF(__pyx_n_s_String);
-  __Pyx_INCREF(__pyx_n_s_Genotype);
-  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_n_s_Genotype);
-  __Pyx_GIVEREF(__pyx_n_s_Genotype);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":508
- *     def enter_default_format(self):
- *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),             # <<<<<<<<<<<<<<
- *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'),
- *                   FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),
- */
-  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_n_s_DP);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_DP);
-  __Pyx_GIVEREF(__pyx_n_s_DP);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_Read_depth_at_this_position_for);
-  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_s_Read_depth_at_this_position_for);
-  __Pyx_GIVEREF(__pyx_kp_s_Read_depth_at_this_position_for);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/cvcf.pyx":509
- *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
- *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),
- *                   FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),
- */
-  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_INCREF(__pyx_n_s_FT);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_FT);
-  __Pyx_GIVEREF(__pyx_n_s_FT);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_n_s_String);
-  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_n_s_String);
-  __Pyx_GIVEREF(__pyx_n_s_String);
-  __Pyx_INCREF(__pyx_kp_s_Sample_Genotype_Filter);
-  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_s_Sample_Genotype_Filter);
-  __Pyx_GIVEREF(__pyx_kp_s_Sample_Genotype_Filter);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":510
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
- *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'),
- *                   FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),
- *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
- */
-  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_INCREF(__pyx_n_s_GL);
-  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_GL);
-  __Pyx_GIVEREF(__pyx_n_s_GL);
-  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __Pyx_INCREF(__pyx_n_s_Float);
-  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_n_s_Float);
-  __Pyx_GIVEREF(__pyx_n_s_Float);
-  __Pyx_INCREF(__pyx_kp_s_Genotype_likelihoods);
-  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_kp_s_Genotype_likelihoods);
-  __Pyx_GIVEREF(__pyx_kp_s_Genotype_likelihoods);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-  /* "pysam/cvcf.pyx":511
- *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'),
- *                   FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),
- *                   FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
- *                   FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'),
- */
-  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_INCREF(__pyx_n_s_GLE);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_GLE);
-  __Pyx_GIVEREF(__pyx_n_s_GLE);
-  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __Pyx_INCREF(__pyx_n_s_Float);
-  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_n_s_Float);
-  __Pyx_GIVEREF(__pyx_n_s_Float);
-  __Pyx_INCREF(__pyx_kp_s_Genotype_likelihoods);
-  PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_kp_s_Genotype_likelihoods);
-  __Pyx_GIVEREF(__pyx_kp_s_Genotype_likelihoods);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
-  /* "pysam/cvcf.pyx":512
- *                   FORMAT('GL',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),
- *                   FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),
- *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),             # <<<<<<<<<<<<<<
- *                   FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'),
- *                   FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'),
- */
-  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_INCREF(__pyx_n_s_GQ);
-  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_GQ);
-  __Pyx_GIVEREF(__pyx_n_s_GQ);
-  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_Genotype_Quality);
-  PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_kp_s_Genotype_Quality);
-  __Pyx_GIVEREF(__pyx_kp_s_Genotype_Quality);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_6);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-  /* "pysam/cvcf.pyx":513
- *                   FORMAT('GLE',self.NT_UNKNOWN,-1,'Float','Genotype likelihoods','.'),
- *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
- *                   FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'),
- *                   FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'),
- */
-  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_INCREF(__pyx_n_s_PL);
-  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_PL);
-  __Pyx_GIVEREF(__pyx_n_s_PL);
-  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_Phred_scaled_genotype_likelihood);
-  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_kp_s_Phred_scaled_genotype_likelihood);
-  __Pyx_GIVEREF(__pyx_kp_s_Phred_scaled_genotype_likelihood);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-  /* "pysam/cvcf.pyx":514
- *                   FORMAT('GQ',self.NT_NUMBER,1,'Integer','Genotype Quality',-1),
- *                   FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'),
- *                   FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'),
- *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
- */
-  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __pyx_t_10 = PyTuple_New(6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_INCREF(__pyx_n_s_GP);
-  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_GP);
-  __Pyx_GIVEREF(__pyx_n_s_GP);
-  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __Pyx_INCREF(__pyx_n_s_Float);
-  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_n_s_Float);
-  __Pyx_GIVEREF(__pyx_n_s_Float);
-  __Pyx_INCREF(__pyx_kp_s_Genotype_posterior_probabilities);
-  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_kp_s_Genotype_posterior_probabilities);
-  __Pyx_GIVEREF(__pyx_kp_s_Genotype_posterior_probabilities);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
-  /* "pysam/cvcf.pyx":515
- *                   FORMAT('PL',self.NT_GENOTYPES,-1,'Integer','Phred-scaled genotype likelihoods', '.'),
- *                   FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'),
- *                   FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
- *                   FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'),
- */
-  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_GENOTYPES); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_11 = PyTuple_New(6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __Pyx_INCREF(__pyx_n_s_GQ);
-  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_s_GQ);
-  __Pyx_GIVEREF(__pyx_n_s_GQ);
-  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_9);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_Conditional_genotype_quality);
-  PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_kp_s_Conditional_genotype_quality);
-  __Pyx_GIVEREF(__pyx_kp_s_Conditional_genotype_quality);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_9 = 0;
-  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
-  /* "pysam/cvcf.pyx":516
- *                   FORMAT('GP',self.NT_GENOTYPES,-1,'Float','Genotype posterior probabilities','.'),
- *                   FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'),
- *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid             # <<<<<<<<<<<<<<
- *                   FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'),
- *                   FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1),
- */
-  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_12 = PyTuple_New(6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_INCREF(__pyx_n_s_HQ);
-  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_s_HQ);
-  __Pyx_GIVEREF(__pyx_n_s_HQ);
-  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10);
-  __Pyx_GIVEREF(__pyx_t_10);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_Haplotype_Quality);
-  PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_kp_s_Haplotype_Quality);
-  __Pyx_GIVEREF(__pyx_kp_s_Haplotype_Quality);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __pyx_t_10 = 0;
-  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-
-  /* "pysam/cvcf.pyx":517
- *                   FORMAT('GQ',self.NT_GENOTYPES,-1,'Integer','Conditional genotype quality','.'),
- *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
- *                   FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1),
- *                   FORMAT('EC',self.NT_ALLELES,1,'Integer','Expected alternate allel counts',-1),
- */
-  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_UNKNOWN); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_13 = PyTuple_New(6); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_13);
-  __Pyx_INCREF(__pyx_n_s_PS);
-  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_n_s_PS);
-  __Pyx_GIVEREF(__pyx_n_s_PS);
-  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_11);
-  __Pyx_GIVEREF(__pyx_t_11);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_Phase_set);
-  PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_kp_s_Phase_set);
-  __Pyx_GIVEREF(__pyx_kp_s_Phase_set);
-  __Pyx_INCREF(__pyx_kp_s__8);
-  PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_kp_s__8);
-  __Pyx_GIVEREF(__pyx_kp_s__8);
-  __pyx_t_11 = 0;
-  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-
-  /* "pysam/cvcf.pyx":518
- *                   FORMAT('HQ',self.NT_UNKNOWN,-1,'Integer','Haplotype Quality',-1),    # unknown number, since may be haploid
- *                   FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'),
- *                   FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1),             # <<<<<<<<<<<<<<
- *                   FORMAT('EC',self.NT_ALLELES,1,'Integer','Expected alternate allel counts',-1),
- *                   FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1),
- */
-  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  __pyx_t_14 = PyTuple_New(6); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_14);
-  __Pyx_INCREF(__pyx_n_s_PQ);
-  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_n_s_PQ);
-  __Pyx_GIVEREF(__pyx_n_s_PQ);
-  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_12);
-  __Pyx_GIVEREF(__pyx_t_12);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_Phasing_quality);
-  PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_kp_s_Phasing_quality);
-  __Pyx_GIVEREF(__pyx_kp_s_Phasing_quality);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __pyx_t_12 = 0;
-  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-
-  /* "pysam/cvcf.pyx":519
- *                   FORMAT('PS',self.NT_UNKNOWN,-1,'Integer','Phase set','.'),
- *                   FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1),
- *                   FORMAT('EC',self.NT_ALLELES,1,'Integer','Expected alternate allel counts',-1),             # <<<<<<<<<<<<<<
- *                   FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1),
- *                   ]:
- */
-  __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_14);
-  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_ALLELES); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_15 = PyTuple_New(6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_15);
-  __Pyx_INCREF(__pyx_n_s_EC);
-  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_n_s_EC);
-  __Pyx_GIVEREF(__pyx_n_s_EC);
-  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_13);
-  __Pyx_GIVEREF(__pyx_t_13);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_Expected_alternate_allel_counts);
-  PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_kp_s_Expected_alternate_allel_counts);
-  __Pyx_GIVEREF(__pyx_kp_s_Expected_alternate_allel_counts);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __pyx_t_13 = 0;
-  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_15, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_13);
-  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-
-  /* "pysam/cvcf.pyx":520
- *                   FORMAT('PQ',self.NT_NUMBER,1,'Integer','Phasing quality',-1),
- *                   FORMAT('EC',self.NT_ALLELES,1,'Integer','Expected alternate allel counts',-1),
- *                   FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1),             # <<<<<<<<<<<<<<
- *                   ]:
- *             if f.id not in self._format:
- */
-  __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_FORMAT); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_15);
-  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_NT_NUMBER); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_14);
-  __pyx_t_16 = PyTuple_New(6); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_16);
-  __Pyx_INCREF(__pyx_n_s_MQ);
-  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_n_s_MQ);
-  __Pyx_GIVEREF(__pyx_n_s_MQ);
-  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_14);
-  __Pyx_GIVEREF(__pyx_t_14);
-  __Pyx_INCREF(__pyx_int_1);
-  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_int_1);
-  __Pyx_GIVEREF(__pyx_int_1);
-  __Pyx_INCREF(__pyx_n_s_Integer);
-  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_n_s_Integer);
-  __Pyx_GIVEREF(__pyx_n_s_Integer);
-  __Pyx_INCREF(__pyx_kp_s_RMS_mapping_quality);
-  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_kp_s_RMS_mapping_quality);
-  __Pyx_GIVEREF(__pyx_kp_s_RMS_mapping_quality);
-  __Pyx_INCREF(__pyx_int_neg_1);
-  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_int_neg_1);
-  __Pyx_GIVEREF(__pyx_int_neg_1);
-  __pyx_t_14 = 0;
-  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_16, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_14);
-  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-
-  /* "pysam/cvcf.pyx":507
- * 
- *     def enter_default_format(self):
- *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),             # <<<<<<<<<<<<<<
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
- *                   FORMAT('FT',self.NT_NUMBER,1,'String','Sample Genotype Filter','.'),
- */
-  __pyx_t_16 = PyTuple_New(14); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_16);
-  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_5);
-  __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_6);
-  __Pyx_GIVEREF(__pyx_t_6);
-  PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_7);
-  PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_9);
-  PyTuple_SET_ITEM(__pyx_t_16, 9, __pyx_t_10);
-  __Pyx_GIVEREF(__pyx_t_10);
-  PyTuple_SET_ITEM(__pyx_t_16, 10, __pyx_t_11);
-  __Pyx_GIVEREF(__pyx_t_11);
-  PyTuple_SET_ITEM(__pyx_t_16, 11, __pyx_t_12);
-  __Pyx_GIVEREF(__pyx_t_12);
-  PyTuple_SET_ITEM(__pyx_t_16, 12, __pyx_t_13);
-  __Pyx_GIVEREF(__pyx_t_13);
-  PyTuple_SET_ITEM(__pyx_t_16, 13, __pyx_t_14);
-  __Pyx_GIVEREF(__pyx_t_14);
-  __pyx_t_2 = 0;
-  __pyx_t_1 = 0;
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_5 = 0;
-  __pyx_t_6 = 0;
-  __pyx_t_7 = 0;
-  __pyx_t_8 = 0;
-  __pyx_t_9 = 0;
-  __pyx_t_10 = 0;
-  __pyx_t_11 = 0;
-  __pyx_t_12 = 0;
-  __pyx_t_13 = 0;
-  __pyx_t_14 = 0;
-  __pyx_t_14 = __pyx_t_16; __Pyx_INCREF(__pyx_t_14); __pyx_t_17 = 0;
-  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-  for (;;) {
-    if (__pyx_t_17 >= 14) break;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_17); __Pyx_INCREF(__pyx_t_16); __pyx_t_17++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #else
-    __pyx_t_16 = PySequence_ITEM(__pyx_t_14, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #endif
-    __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_16);
-    __pyx_t_16 = 0;
-
-    /* "pysam/cvcf.pyx":522
- *                   FORMAT('MQ',self.NT_NUMBER,1,'Integer','RMS mapping quality',-1),
- *                   ]:
- *             if f.id not in self._format:             # <<<<<<<<<<<<<<
- *                 self._format[f.id] = f
- * 
- */
-    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_16);
-    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_13);
-    __pyx_t_18 = (__Pyx_PySequence_Contains(__pyx_t_16, __pyx_t_13, Py_NE)); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-    __pyx_t_19 = (__pyx_t_18 != 0);
-    if (__pyx_t_19) {
-
-      /* "pysam/cvcf.pyx":523
- *                   ]:
- *             if f.id not in self._format:
- *                 self._format[f.id] = f             # <<<<<<<<<<<<<<
- * 
- *     def parse_header(self, line):
- */
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_13);
-      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_16);
-      if (unlikely(PyObject_SetItem(__pyx_t_13, __pyx_t_16, __pyx_v_f) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-      goto __pyx_L5;
-    }
-    __pyx_L5:;
-  }
-  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-
-  /* "pysam/cvcf.pyx":506
- * 
- * 
- *     def enter_default_format(self):             # <<<<<<<<<<<<<<
- *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
- */
-
-  /* function exit code */
-  __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_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_XDECREF(__pyx_t_13);
-  __Pyx_XDECREF(__pyx_t_14);
-  __Pyx_XDECREF(__pyx_t_15);
-  __Pyx_XDECREF(__pyx_t_16);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.enter_default_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":525
- *                 self._format[f.id] = f
- * 
- *     def parse_header(self, line):             # <<<<<<<<<<<<<<
- * 
- *         assert line.startswith('##')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_17parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_17parse_header = {__Pyx_NAMESTR("parse_header"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_17parse_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_17parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_line = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("parse_header (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __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_self = values[0];
-    __pyx_v_line = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parse_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_16parse_header(__pyx_self, __pyx_v_self, __pyx_v_line);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_16parse_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line) {
-  PyObject *__pyx_v_elts = NULL;
-  PyObject *__pyx_v_key = NULL;
-  PyObject *__pyx_v_value = NULL;
-  PyObject *__pyx_v_f = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_t_6;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse_header", 0);
-
-  /* "pysam/cvcf.pyx":527
- *     def parse_header(self, line):
- * 
- *         assert line.startswith('##')             # <<<<<<<<<<<<<<
- *         elts = line[2:].split('=')
- *         key = elts[0].strip()
- */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) {
-      PyErr_SetNone(PyExc_AssertionError);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-
-  /* "pysam/cvcf.pyx":528
- * 
- *         assert line.startswith('##')
- *         elts = line[2:].split('=')             # <<<<<<<<<<<<<<
- *         key = elts[0].strip()
- *         value = '='.join(elts[1:]).strip()
- */
-  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_line, 2, 0, NULL, NULL, &__pyx_slice__48, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_elts = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":529
- *         assert line.startswith('##')
- *         elts = line[2:].split('=')
- *         key = elts[0].strip()             # <<<<<<<<<<<<<<
- *         value = '='.join(elts[1:]).strip()
- *         if key == "fileformat":
- */
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_key = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":530
- *         elts = line[2:].split('=')
- *         key = elts[0].strip()
- *         value = '='.join(elts[1:]).strip()             # <<<<<<<<<<<<<<
- *         if key == "fileformat":
- *             if value == "VCFv3.3":
- */
-  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_elts, 1, 0, NULL, NULL, &__pyx_slice__50, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__13, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_value = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":531
- *         key = elts[0].strip()
- *         value = '='.join(elts[1:]).strip()
- *         if key == "fileformat":             # <<<<<<<<<<<<<<
- *             if value == "VCFv3.3":
- *                 self._version = 33
- */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_fileformat, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
-
-    /* "pysam/cvcf.pyx":532
- *         value = '='.join(elts[1:]).strip()
- *         if key == "fileformat":
- *             if value == "VCFv3.3":             # <<<<<<<<<<<<<<
- *                 self._version = 33
- *             elif value == "VCFv4.0":
- */
-    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_kp_s_VCFv3_3, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_3) {
-
-      /* "pysam/cvcf.pyx":533
- *         if key == "fileformat":
- *             if value == "VCFv3.3":
- *                 self._version = 33             # <<<<<<<<<<<<<<
- *             elif value == "VCFv4.0":
- *                 self._version = 40
- */
-      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_int_33) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L4;
-    }
-
-    /* "pysam/cvcf.pyx":534
- *             if value == "VCFv3.3":
- *                 self._version = 33
- *             elif value == "VCFv4.0":             # <<<<<<<<<<<<<<
- *                 self._version = 40
- *             elif value == "VCFv4.1":
- */
-    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_kp_s_VCFv4_0, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_3) {
-
-      /* "pysam/cvcf.pyx":535
- *                 self._version = 33
- *             elif value == "VCFv4.0":
- *                 self._version = 40             # <<<<<<<<<<<<<<
- *             elif value == "VCFv4.1":
- *                 # AH - for testing
- */
-      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_int_40) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L4;
-    }
-
-    /* "pysam/cvcf.pyx":536
- *             elif value == "VCFv4.0":
- *                 self._version = 40
- *             elif value == "VCFv4.1":             # <<<<<<<<<<<<<<
- *                 # AH - for testing
- *                 self._version = 40
- */
-    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_kp_s_VCFv4_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_3) {
-
-      /* "pysam/cvcf.pyx":538
- *             elif value == "VCFv4.1":
- *                 # AH - for testing
- *                 self._version = 40             # <<<<<<<<<<<<<<
- *             else:
- *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
- */
-      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_int_40) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L4;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":540
- *                 self._version = 40
- *             else:
- *                 self.error(line,self.UNKNOWN_FORMAT_STRING)             # <<<<<<<<<<<<<<
- *         elif key == "INFO":
- *             f = self.parse_format(line, value)
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_UNKNOWN_FORMAT_STRING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    }
-    __pyx_L4:;
-    goto __pyx_L3;
-  }
-
-  /* "pysam/cvcf.pyx":541
- *             else:
- *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
- *         elif key == "INFO":             # <<<<<<<<<<<<<<
- *             f = self.parse_format(line, value)
- *             self._info[ f.id ] = f
- */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_INFO, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
-
-    /* "pysam/cvcf.pyx":542
- *                 self.error(line,self.UNKNOWN_FORMAT_STRING)
- *         elif key == "INFO":
- *             f = self.parse_format(line, value)             # <<<<<<<<<<<<<<
- *             self._info[ f.id ] = f
- *         elif key == "FILTER":
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_v_f = __pyx_t_1;
-    __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":543
- *         elif key == "INFO":
- *             f = self.parse_format(line, value)
- *             self._info[ f.id ] = f             # <<<<<<<<<<<<<<
- *         elif key == "FILTER":
- *             f = self.parse_format(line, value, filter=True)
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_4, __pyx_v_f) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    goto __pyx_L3;
-  }
-
-  /* "pysam/cvcf.pyx":544
- *             f = self.parse_format(line, value)
- *             self._info[ f.id ] = f
- *         elif key == "FILTER":             # <<<<<<<<<<<<<<
- *             f = self.parse_format(line, value, filter=True)
- *             self._filter[ f.id ] = f
- */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_FILTER, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
-
-    /* "pysam/cvcf.pyx":545
- *             self._info[ f.id ] = f
- *         elif key == "FILTER":
- *             f = self.parse_format(line, value, filter=True)             # <<<<<<<<<<<<<<
- *             self._filter[ f.id ] = f
- *         elif key == "FORMAT":
- */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_filter_2, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_f = __pyx_t_5;
-    __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":546
- *         elif key == "FILTER":
- *             f = self.parse_format(line, value, filter=True)
- *             self._filter[ f.id ] = f             # <<<<<<<<<<<<<<
- *         elif key == "FORMAT":
- *             f = self.parse_format(line, value)
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filter); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_t_2, __pyx_v_f) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    goto __pyx_L3;
-  }
-
-  /* "pysam/cvcf.pyx":547
- *             f = self.parse_format(line, value, filter=True)
- *             self._filter[ f.id ] = f
- *         elif key == "FORMAT":             # <<<<<<<<<<<<<<
- *             f = self.parse_format(line, value)
- *             self._format[ f.id ] = f
- */
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_key, __pyx_n_s_FORMAT, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_3) {
-
-    /* "pysam/cvcf.pyx":548
- *             self._filter[ f.id ] = f
- *         elif key == "FORMAT":
- *             f = self.parse_format(line, value)             # <<<<<<<<<<<<<<
- *             self._format[ f.id ] = f
- *         else:
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_v_f = __pyx_t_1;
-    __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":549
- *         elif key == "FORMAT":
- *             f = self.parse_format(line, value)
- *             self._format[ f.id ] = f             # <<<<<<<<<<<<<<
- *         else:
- *             # keep other keys in the header field
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_5, __pyx_v_f) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    goto __pyx_L3;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":552
- *         else:
- *             # keep other keys in the header field
- *             self._header.append( (key,value) )             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_5, __pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":525
- *                 self._format[f.id] = f
- * 
- *     def parse_header(self, line):             # <<<<<<<<<<<<<<
- * 
- *         assert line.startswith('##')
- */
-
-  /* function exit code */
-  __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_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_elts);
-  __Pyx_XDECREF(__pyx_v_key);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":555
- * 
- * 
- *     def write_header( self, stream ):             # <<<<<<<<<<<<<<
- *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
- *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_19write_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_19write_header = {__Pyx_NAMESTR("write_header"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_19write_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_19write_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_stream = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("write_header (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("write_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __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_self = values[0];
-    __pyx_v_stream = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.write_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_18write_header(__pyx_self, __pyx_v_self, __pyx_v_stream);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_18write_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) {
-  PyObject *__pyx_v_key = NULL;
-  PyObject *__pyx_v_value = NULL;
-  PyObject *__pyx_v_var = NULL;
-  PyObject *__pyx_v_label = NULL;
-  PyObject *__pyx_v_f = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  Py_ssize_t __pyx_t_5;
-  PyObject *(*__pyx_t_6)(PyObject *);
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *(*__pyx_t_8)(PyObject *);
-  Py_ssize_t __pyx_t_9;
-  Py_ssize_t __pyx_t_10;
-  int __pyx_t_11;
-  int __pyx_t_12;
-  PyObject *__pyx_t_13 = NULL;
-  PyObject *__pyx_t_14 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("write_header", 0);
-
-  /* "pysam/cvcf.pyx":556
- * 
- *     def write_header( self, stream ):
- *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))             # <<<<<<<<<<<<<<
- *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
- *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_FloorDivide(__pyx_t_2, __pyx_int_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyNumber_Remainder(__pyx_t_2, __pyx_int_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __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);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_fileformat_VCFv_s_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/cvcf.pyx":557
- *     def write_header( self, stream ):
- *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
- *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))             # <<<<<<<<<<<<<<
- *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
- *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
-    __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
-    __pyx_t_6 = NULL;
-  } else {
-    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  for (;;) {
-    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_4 = __pyx_t_6(__pyx_t_2);
-      if (unlikely(!__pyx_t_4)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_4);
-    }
-    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
-      PyObject* sequence = __pyx_t_4;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 2)) {
-        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
-      } else {
-        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
-      }
-      __Pyx_INCREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_t_3);
-      #else
-      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      #endif
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
-      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_1);
-      index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_3);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_8 = NULL;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      goto __pyx_L6_unpacking_done;
-      __pyx_L5_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_8 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L6_unpacking_done:;
-    }
-    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
-    __pyx_t_1 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":558
- *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
- *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
- *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:             # <<<<<<<<<<<<<<
- *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))
- * 
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_n_s_INFO);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_INFO);
-  __Pyx_GIVEREF(__pyx_n_s_INFO);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_n_s_FILTER);
-  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_FILTER);
-  __Pyx_GIVEREF(__pyx_n_s_FILTER);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_n_s_FORMAT);
-  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_FORMAT);
-  __Pyx_GIVEREF(__pyx_n_s_FORMAT);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
-  __Pyx_GIVEREF(__pyx_t_4);
-  __pyx_t_1 = 0;
-  __pyx_t_3 = 0;
-  __pyx_t_4 = 0;
-  __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  for (;;) {
-    if (__pyx_t_5 >= 3) break;
-    #if CYTHON_COMPILING_IN_CPYTHON
-    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #else
-    __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    #endif
-    if (likely(__pyx_t_2 != Py_None)) {
-      PyObject* sequence = __pyx_t_2;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 2)) {
-        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
-      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
-      __Pyx_INCREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_t_1);
-      #else
-      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      #endif
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    } else {
-      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __Pyx_XDECREF_SET(__pyx_v_var, __pyx_t_3);
-    __pyx_t_3 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":559
- *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
- *         for var,label in [(self._info,"INFO"),(self._filter,"FILTER"),(self._format,"FORMAT")]:
- *             for f in var.itervalues(): stream.write("##%s=%s\n" % (label,self.format_format(f,filter=(label=="FILTER"))))             # <<<<<<<<<<<<<<
- * 
- * 
- */
-    __pyx_t_9 = 0;
-    if (unlikely(__pyx_v_var == Py_None)) {
-      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "itervalues");
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_var, 0, __pyx_n_s_itervalues, (&__pyx_t_10), (&__pyx_t_11)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_XDECREF(__pyx_t_2);
-    __pyx_t_2 = __pyx_t_1;
-    __pyx_t_1 = 0;
-    while (1) {
-      __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_10, &__pyx_t_9, NULL, &__pyx_t_1, NULL, __pyx_t_11);
-      if (unlikely(__pyx_t_12 == 0)) break;
-      if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_INCREF(__pyx_v_f);
-      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_f);
-      __Pyx_GIVEREF(__pyx_v_f);
-      __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_13);
-      __pyx_t_14 = PyObject_RichCompare(__pyx_v_label, __pyx_n_s_FILTER, Py_EQ); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_filter_2, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_14);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_13);
-      __Pyx_INCREF(__pyx_v_label);
-      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_label);
-      __Pyx_GIVEREF(__pyx_v_label);
-      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14);
-      __Pyx_GIVEREF(__pyx_t_14);
-      __pyx_t_14 = 0;
-      __pyx_t_14 = __Pyx_PyString_Format(__pyx_kp_s_s_s_2, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_14);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_13);
-      PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
-      __Pyx_GIVEREF(__pyx_t_14);
-      __pyx_t_14 = 0;
-      __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_14);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/cvcf.pyx":555
- * 
- * 
- *     def write_header( self, stream ):             # <<<<<<<<<<<<<<
- *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
- *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
- */
-
-  /* function exit code */
-  __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_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_13);
-  __Pyx_XDECREF(__pyx_t_14);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.write_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_key);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XDECREF(__pyx_v_var);
-  __Pyx_XDECREF(__pyx_v_label);
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":562
- * 
- * 
- *     def parse_heading( self, line ):             # <<<<<<<<<<<<<<
- *         assert line.startswith('#')
- *         assert not line.startswith('##')
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_21parse_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_21parse_heading = {__Pyx_NAMESTR("parse_heading"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_21parse_heading, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_21parse_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_line = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("parse_heading (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_heading", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse_heading") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __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_self = values[0];
-    __pyx_v_line = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parse_heading", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_heading", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_20parse_heading(__pyx_self, __pyx_v_self, __pyx_v_line);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_20parse_heading(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line) {
-  PyObject *__pyx_v_headings = NULL;
-  PyObject *__pyx_v_i = NULL;
-  PyObject *__pyx_v_s = NULL;
-  PyObject *__pyx_v_err = NULL;
-  PyObject *__pyx_v_x = NULL;
-  PyObject *__pyx_v_y = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  Py_ssize_t __pyx_t_4;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *(*__pyx_t_8)(PyObject *);
-  Py_ssize_t __pyx_t_9;
-  PyObject *__pyx_t_10 = NULL;
-  int __pyx_t_11;
-  PyObject *__pyx_t_12 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse_heading", 0);
-
-  /* "pysam/cvcf.pyx":563
- * 
- *     def parse_heading( self, line ):
- *         assert line.startswith('#')             # <<<<<<<<<<<<<<
- *         assert not line.startswith('##')
- *         headings = line[1:].split('\t')
- */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) {
-      PyErr_SetNone(PyExc_AssertionError);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-
-  /* "pysam/cvcf.pyx":564
- *     def parse_heading( self, line ):
- *         assert line.startswith('#')
- *         assert not line.startswith('##')             # <<<<<<<<<<<<<<
- *         headings = line[1:].split('\t')
- *         # test for 8, as FORMAT field might be missing
- */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (unlikely(!((!__pyx_t_3) != 0))) {
-      PyErr_SetNone(PyExc_AssertionError);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-
-  /* "pysam/cvcf.pyx":565
- *         assert line.startswith('#')
- *         assert not line.startswith('##')
- *         headings = line[1:].split('\t')             # <<<<<<<<<<<<<<
- *         # test for 8, as FORMAT field might be missing
- *         if len(headings)==1 and len(line[1:].split()) >= 8:
- */
-  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_line, 1, 0, NULL, NULL, &__pyx_slice__54, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_headings = __pyx_t_1;
-  __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":567
- *         headings = line[1:].split('\t')
- *         # test for 8, as FORMAT field might be missing
- *         if len(headings)==1 and len(line[1:].split()) >= 8:             # <<<<<<<<<<<<<<
- *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
- *             headings = line[1:].split()
- */
-  __pyx_t_4 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_3 = ((__pyx_t_4 == 1) != 0);
-  if (__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_line, 1, 0, NULL, NULL, &__pyx_slice__57, 1, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_5 = ((__pyx_t_4 >= 8) != 0);
-    __pyx_t_6 = __pyx_t_5;
-  } else {
-    __pyx_t_6 = __pyx_t_3;
-  }
-  if (__pyx_t_6) {
-
-    /* "pysam/cvcf.pyx":568
- *         # test for 8, as FORMAT field might be missing
- *         if len(headings)==1 and len(line[1:].split()) >= 8:
- *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)             # <<<<<<<<<<<<<<
- *             headings = line[1:].split()
- * 
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":569
- *         if len(headings)==1 and len(line[1:].split()) >= 8:
- *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
- *             headings = line[1:].split()             # <<<<<<<<<<<<<<
- * 
- *         for i,s in enumerate(self._required):
- */
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_line, 1, 0, NULL, NULL, &__pyx_slice__58, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF_SET(__pyx_v_headings, __pyx_t_2);
-    __pyx_t_2 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":571
- *             headings = line[1:].split()
- * 
- *         for i,s in enumerate(self._required):             # <<<<<<<<<<<<<<
- * 
- *             if len(headings)<=i or headings[i] != s:
- */
-  __Pyx_INCREF(__pyx_int_0);
-  __pyx_t_2 = __pyx_int_0;
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_required); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_7);
-  if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
-    __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
-    __pyx_t_8 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  for (;;) {
-    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_7 = __pyx_t_8(__pyx_t_1);
-      if (unlikely(!__pyx_t_7)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_7);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_7);
-    __pyx_t_7 = 0;
-    __Pyx_INCREF(__pyx_t_2);
-    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
-    __pyx_t_7 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_DECREF(__pyx_t_2);
-    __pyx_t_2 = __pyx_t_7;
-    __pyx_t_7 = 0;
-
-    /* "pysam/cvcf.pyx":573
- *         for i,s in enumerate(self._required):
- * 
- *             if len(headings)<=i or headings[i] != s:             # <<<<<<<<<<<<<<
- * 
- *                 if len(headings) <= i:
- */
-    __pyx_t_9 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    if (!__pyx_t_6) {
-      __pyx_t_10 = PyObject_GetItem(__pyx_v_headings, __pyx_v_i); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_10);
-      __pyx_t_7 = PyObject_RichCompare(__pyx_t_10, __pyx_v_s, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_5 = __pyx_t_3;
-    } else {
-      __pyx_t_5 = __pyx_t_6;
-    }
-    if (__pyx_t_5) {
-
-      /* "pysam/cvcf.pyx":575
- *             if len(headings)<=i or headings[i] != s:
- * 
- *                 if len(headings) <= i:             # <<<<<<<<<<<<<<
- *                     err = "(%sth entry not found)" % (i+1)
- *                 else:
- */
-      __pyx_t_9 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      if (__pyx_t_5) {
-
-        /* "pysam/cvcf.pyx":576
- * 
- *                 if len(headings) <= i:
- *                     err = "(%sth entry not found)" % (i+1)             # <<<<<<<<<<<<<<
- *                 else:
- *                     err = "(found %s, expected %s)" % (headings[i],s)
- */
-        __pyx_t_10 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_sth_entry_not_found, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_XDECREF_SET(__pyx_v_err, ((PyObject*)__pyx_t_7));
-        __pyx_t_7 = 0;
-        goto __pyx_L7;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":578
- *                     err = "(%sth entry not found)" % (i+1)
- *                 else:
- *                     err = "(found %s, expected %s)" % (headings[i],s)             # <<<<<<<<<<<<<<
- * 
- *                 #self.error(line,self.BADLY_FORMATTED_HEADING,err)
- */
-        __pyx_t_7 = PyObject_GetItem(__pyx_v_headings, __pyx_v_i); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
-        __Pyx_GIVEREF(__pyx_t_7);
-        __Pyx_INCREF(__pyx_v_s);
-        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_s);
-        __Pyx_GIVEREF(__pyx_v_s);
-        __pyx_t_7 = 0;
-        __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_found_s_expected_s, __pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_XDECREF_SET(__pyx_v_err, ((PyObject*)__pyx_t_7));
-        __pyx_t_7 = 0;
-      }
-      __pyx_L7:;
-
-      /* "pysam/cvcf.pyx":582
- *                 #self.error(line,self.BADLY_FORMATTED_HEADING,err)
- *                 # allow FORMAT column to be absent
- *                 if len(headings) == 8:             # <<<<<<<<<<<<<<
- *                     headings.append("FORMAT")
- *                 else:
- */
-      __pyx_t_9 = PyObject_Length(__pyx_v_headings); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = ((__pyx_t_9 == 8) != 0);
-      if (__pyx_t_5) {
-
-        /* "pysam/cvcf.pyx":583
- *                 # allow FORMAT column to be absent
- *                 if len(headings) == 8:
- *                     headings.append("FORMAT")             # <<<<<<<<<<<<<<
- *                 else:
- *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)
- */
-        __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_headings, __pyx_n_s_FORMAT); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        goto __pyx_L8;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":585
- *                     headings.append("FORMAT")
- *                 else:
- *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)             # <<<<<<<<<<<<<<
- * 
- *         self._samples = headings[9:]
- */
-        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BADLY_FORMATTED_HEADING); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_12);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10);
-        __Pyx_GIVEREF(__pyx_t_10);
-        __Pyx_INCREF(__pyx_v_err);
-        PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_err);
-        __Pyx_GIVEREF(__pyx_v_err);
-        __pyx_t_10 = 0;
-        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      }
-      __pyx_L8:;
-      goto __pyx_L6;
-    }
-    __pyx_L6:;
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":587
- *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)
- * 
- *         self._samples = headings[9:]             # <<<<<<<<<<<<<<
- *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
- * 
- */
-  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_headings, 9, 0, NULL, NULL, &__pyx_slice__59, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_samples, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":588
- * 
- *         self._samples = headings[9:]
- *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )             # <<<<<<<<<<<<<<
- * 
- *     def write_heading( self, stream ):
- */
-  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_int_0);
-  __pyx_t_1 = __pyx_int_0;
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  if (PyList_CheckExact(__pyx_t_10) || PyTuple_CheckExact(__pyx_t_10)) {
-    __pyx_t_12 = __pyx_t_10; __Pyx_INCREF(__pyx_t_12); __pyx_t_4 = 0;
-    __pyx_t_8 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_12);
-    __pyx_t_8 = Py_TYPE(__pyx_t_12)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  for (;;) {
-    if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_12)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_10 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_10 = PySequence_ITEM(__pyx_t_12, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_12)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_10 = PySequence_ITEM(__pyx_t_12, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_10 = __pyx_t_8(__pyx_t_12);
-      if (unlikely(!__pyx_t_10)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_10);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_10);
-    __pyx_t_10 = 0;
-    __Pyx_INCREF(__pyx_t_1);
-    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
-    __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_1);
-    __pyx_t_1 = __pyx_t_10;
-    __pyx_t_10 = 0;
-    __pyx_t_10 = PyNumber_Add(__pyx_v_x, __pyx_int_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __Pyx_INCREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_y);
-    __Pyx_GIVEREF(__pyx_v_y);
-    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10);
-    __Pyx_GIVEREF(__pyx_t_10);
-    __pyx_t_10 = 0;
-    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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 = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sample2column, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":562
- * 
- * 
- *     def parse_heading( self, line ):             # <<<<<<<<<<<<<<
- *         assert line.startswith('#')
- *         assert not line.startswith('##')
- */
-
-  /* function exit code */
-  __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_7);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_heading", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_headings);
-  __Pyx_XDECREF(__pyx_v_i);
-  __Pyx_XDECREF(__pyx_v_s);
-  __Pyx_XDECREF(__pyx_v_err);
-  __Pyx_XDECREF(__pyx_v_x);
-  __Pyx_XDECREF(__pyx_v_y);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":590
- *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
- * 
- *     def write_heading( self, stream ):             # <<<<<<<<<<<<<<
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_23write_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_23write_heading = {__Pyx_NAMESTR("write_heading"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_23write_heading, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_23write_heading(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_stream = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("write_heading (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("write_heading", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_heading") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __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_self = values[0];
-    __pyx_v_stream = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write_heading", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.write_heading", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_22write_heading(__pyx_self, __pyx_v_self, __pyx_v_stream);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_22write_heading(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) {
-  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_RefNannySetupContext("write_heading", 0);
-
-  /* "pysam/cvcf.pyx":591
- * 
- *     def write_heading( self, stream ):
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")             # <<<<<<<<<<<<<<
- * 
- *     def convertGT(self, GTstring):
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_required); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__55, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyNumber_Add(__pyx_kp_s__51, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_kp_s__60); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __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 = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":590
- *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
- * 
- *     def write_heading( self, stream ):             # <<<<<<<<<<<<<<
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
- * 
- */
-
-  /* function exit code */
-  __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("pysam.cvcf.VCF.write_heading", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":593
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
- * 
- *     def convertGT(self, GTstring):             # <<<<<<<<<<<<<<
- *         if GTstring == ".": return ["."]
- *         try:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_25convertGT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_25convertGT = {__Pyx_NAMESTR("convertGT"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_25convertGT, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_25convertGT(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_GTstring = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("convertGT (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_GTstring,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_GTstring)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("convertGT", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convertGT") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __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_self = values[0];
-    __pyx_v_GTstring = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("convertGT", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.convertGT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_24convertGT(__pyx_self, __pyx_v_self, __pyx_v_GTstring);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_24convertGT(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_GTstring) {
-  PyObject *__pyx_v_gts = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_t_1;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  PyObject *__pyx_t_7 = NULL;
-  Py_ssize_t __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_t_10;
-  Py_ssize_t __pyx_t_11;
-  PyObject *__pyx_t_12 = NULL;
-  int __pyx_t_13;
-  PyObject *__pyx_t_14 = NULL;
-  PyObject *__pyx_t_15 = NULL;
-  PyObject *__pyx_t_16 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("convertGT", 0);
-
-  /* "pysam/cvcf.pyx":594
- * 
- *     def convertGT(self, GTstring):
- *         if GTstring == ".": return ["."]             # <<<<<<<<<<<<<<
- *         try:
- *             gts = gtsRegEx.split(GTstring)
- */
-  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_GTstring, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_1) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_kp_s__8);
-    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s__8);
-    __Pyx_GIVEREF(__pyx_kp_s__8);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":595
- *     def convertGT(self, GTstring):
- *         if GTstring == ".": return ["."]
- *         try:             # <<<<<<<<<<<<<<
- *             gts = gtsRegEx.split(GTstring)
- *             if len(gts) == 1: return [int(gts[0])]
- */
-  {
-    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
-    __Pyx_XGOTREF(__pyx_t_3);
-    __Pyx_XGOTREF(__pyx_t_4);
-    __Pyx_XGOTREF(__pyx_t_5);
-    /*try:*/ {
-
-      /* "pysam/cvcf.pyx":596
- *         if GTstring == ".": return ["."]
- *         try:
- *             gts = gtsRegEx.split(GTstring)             # <<<<<<<<<<<<<<
- *             if len(gts) == 1: return [int(gts[0])]
- *             if len(gts) != 2: raise ValueError()
- */
-      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gtsRegEx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_GTstring);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_GTstring);
-      __Pyx_GIVEREF(__pyx_v_GTstring);
-      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_v_gts = __pyx_t_7;
-      __pyx_t_7 = 0;
-
-      /* "pysam/cvcf.pyx":597
- *         try:
- *             gts = gtsRegEx.split(GTstring)
- *             if len(gts) == 1: return [int(gts[0])]             # <<<<<<<<<<<<<<
- *             if len(gts) != 2: raise ValueError()
- *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
- */
-      __pyx_t_8 = PyObject_Length(__pyx_v_gts); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __pyx_t_1 = ((__pyx_t_8 == 1) != 0);
-      if (__pyx_t_1) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_2 = PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_r = __pyx_t_7;
-        __pyx_t_7 = 0;
-        goto __pyx_L8_try_return;
-      }
-
-      /* "pysam/cvcf.pyx":598
- *             gts = gtsRegEx.split(GTstring)
- *             if len(gts) == 1: return [int(gts[0])]
- *             if len(gts) != 2: raise ValueError()             # <<<<<<<<<<<<<<
- *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
- *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
- */
-      __pyx_t_8 = PyObject_Length(__pyx_v_gts); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __pyx_t_1 = ((__pyx_t_8 != 2) != 0);
-      if (__pyx_t_1) {
-        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_7);
-        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      }
-
-      /* "pysam/cvcf.pyx":599
- *             if len(gts) == 1: return [int(gts[0])]
- *             if len(gts) != 2: raise ValueError()
- *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]             # <<<<<<<<<<<<<<
- *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
- *         except ValueError:
- */
-      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      if (__pyx_t_1) {
-        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_7, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-        __pyx_t_10 = __pyx_t_9;
-      } else {
-        __pyx_t_10 = __pyx_t_1;
-      }
-      if (__pyx_t_10) {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-        __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_8 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_11 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_GTstring, __pyx_t_8, (-__pyx_t_11), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_12 = PyList_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-        __Pyx_GOTREF(__pyx_t_12);
-        PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
-        __Pyx_GIVEREF(__pyx_t_7);
-        PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_6);
-        __Pyx_GIVEREF(__pyx_t_6);
-        __pyx_t_7 = 0;
-        __pyx_t_2 = 0;
-        __pyx_t_6 = 0;
-        __pyx_r = __pyx_t_12;
-        __pyx_t_12 = 0;
-        goto __pyx_L8_try_return;
-      }
-
-      /* "pysam/cvcf.pyx":600
- *             if len(gts) != 2: raise ValueError()
- *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
- *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]             # <<<<<<<<<<<<<<
- *         except ValueError:
- *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
- */
-      __Pyx_XDECREF(__pyx_r);
-      __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-      __Pyx_GOTREF(__pyx_t_12);
-      __pyx_t_6 = PyNumber_Int(__pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_gts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-      __Pyx_GOTREF(__pyx_t_12);
-      __pyx_t_11 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-      __Pyx_GOTREF(__pyx_t_12);
-      __pyx_t_8 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_GTstring, __pyx_t_11, (-__pyx_t_8), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_12);
-      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_gts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;};
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_7 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
-      __Pyx_GIVEREF(__pyx_t_12);
-      PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      __pyx_t_6 = 0;
-      __pyx_t_12 = 0;
-      __pyx_t_7 = 0;
-      __pyx_r = __pyx_t_2;
-      __pyx_t_2 = 0;
-      goto __pyx_L8_try_return;
-    }
-    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    goto __pyx_L11_try_end;
-    __pyx_L4_error:;
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":601
- *             if gts[0] == "." and gts[1] == ".": return [gts[0],GTstring[len(gts[0]):-len(gts[1])],gts[1]]
- *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
- *         except ValueError:             # <<<<<<<<<<<<<<
- *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
- *             return [".","|","."]
- */
-    __pyx_t_13 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-    if (__pyx_t_13) {
-      __Pyx_AddTraceback("pysam.cvcf.VCF.convertGT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_GOTREF(__pyx_t_7);
-      __Pyx_GOTREF(__pyx_t_12);
-
-      /* "pysam/cvcf.pyx":602
- *             return [int(gts[0]),GTstring[len(gts[0]):-len(gts[1])],int(gts[1])]
- *         except ValueError:
- *             self.error(self._line,self.BAD_GENOTYPE,GTstring)             # <<<<<<<<<<<<<<
- *             return [".","|","."]
- * 
- */
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_line_2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-      __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BAD_GENOTYPE); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-      __Pyx_GOTREF(__pyx_t_15);
-      __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-      __Pyx_GOTREF(__pyx_t_16);
-      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14);
-      __Pyx_GIVEREF(__pyx_t_14);
-      PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15);
-      __Pyx_GIVEREF(__pyx_t_15);
-      __Pyx_INCREF(__pyx_v_GTstring);
-      PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_v_GTstring);
-      __Pyx_GIVEREF(__pyx_v_GTstring);
-      __pyx_t_14 = 0;
-      __pyx_t_15 = 0;
-      __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_16, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-      __Pyx_GOTREF(__pyx_t_15);
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
-      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-
-      /* "pysam/cvcf.pyx":603
- *         except ValueError:
- *             self.error(self._line,self.BAD_GENOTYPE,GTstring)
- *             return [".","|","."]             # <<<<<<<<<<<<<<
- * 
- *     def convertGTback(self, GTdata):
- */
-      __Pyx_XDECREF(__pyx_r);
-      __pyx_t_15 = PyList_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
-      __Pyx_GOTREF(__pyx_t_15);
-      __Pyx_INCREF(__pyx_kp_s__8);
-      PyList_SET_ITEM(__pyx_t_15, 0, __pyx_kp_s__8);
-      __Pyx_GIVEREF(__pyx_kp_s__8);
-      __Pyx_INCREF(__pyx_kp_s__61);
-      PyList_SET_ITEM(__pyx_t_15, 1, __pyx_kp_s__61);
-      __Pyx_GIVEREF(__pyx_kp_s__61);
-      __Pyx_INCREF(__pyx_kp_s__8);
-      PyList_SET_ITEM(__pyx_t_15, 2, __pyx_kp_s__8);
-      __Pyx_GIVEREF(__pyx_kp_s__8);
-      __pyx_r = __pyx_t_15;
-      __pyx_t_15 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L7_except_return;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L5_exception_handled;
-    }
-    goto __pyx_L6_except_error;
-    __pyx_L6_except_error:;
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_XGIVEREF(__pyx_t_4);
-    __Pyx_XGIVEREF(__pyx_t_5);
-    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-    goto __pyx_L1_error;
-    __pyx_L8_try_return:;
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_XGIVEREF(__pyx_t_4);
-    __Pyx_XGIVEREF(__pyx_t_5);
-    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-    goto __pyx_L0;
-    __pyx_L7_except_return:;
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_XGIVEREF(__pyx_t_4);
-    __Pyx_XGIVEREF(__pyx_t_5);
-    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-    goto __pyx_L0;
-    __pyx_L5_exception_handled:;
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_XGIVEREF(__pyx_t_4);
-    __Pyx_XGIVEREF(__pyx_t_5);
-    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
-    __pyx_L11_try_end:;
-  }
-
-  /* "pysam/cvcf.pyx":593
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
- * 
- *     def convertGT(self, GTstring):             # <<<<<<<<<<<<<<
- *         if GTstring == ".": return ["."]
- *         try:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_XDECREF(__pyx_t_14);
-  __Pyx_XDECREF(__pyx_t_15);
-  __Pyx_XDECREF(__pyx_t_16);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.convertGT", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_gts);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":605
- *             return [".","|","."]
- * 
- *     def convertGTback(self, GTdata):             # <<<<<<<<<<<<<<
- *         return ''.join(map(str,GTdata))
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_27convertGTback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_27convertGTback = {__Pyx_NAMESTR("convertGTback"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_27convertGTback, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_27convertGTback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_GTdata = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("convertGTback (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_GTdata,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_GTdata)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("convertGTback", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convertGTback") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __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_self = values[0];
-    __pyx_v_GTdata = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("convertGTback", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.convertGTback", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_26convertGTback(__pyx_self, __pyx_v_self, __pyx_v_GTdata);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_26convertGTback(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_GTdata) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("convertGTback", 0);
-
-  /* "pysam/cvcf.pyx":606
- * 
- *     def convertGTback(self, GTdata):
- *         return ''.join(map(str,GTdata))             # <<<<<<<<<<<<<<
- * 
- *     def parse_formatdata( self, key, value, formatdict, line ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
-  __Pyx_INCREF(__pyx_v_GTdata);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_GTdata);
-  __Pyx_GIVEREF(__pyx_v_GTdata);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":605
- *             return [".","|","."]
- * 
- *     def convertGTback(self, GTdata):             # <<<<<<<<<<<<<<
- *         return ''.join(map(str,GTdata))
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.convertGTback", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":608
- *         return ''.join(map(str,GTdata))
- * 
- *     def parse_formatdata( self, key, value, formatdict, line ):             # <<<<<<<<<<<<<<
- *         # To do: check that the right number of values is present
- *         f = formatdict.get(key,None)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_29parse_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_29parse_formatdata = {__Pyx_NAMESTR("parse_formatdata"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_29parse_formatdata, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_29parse_formatdata(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_key = 0;
-  PyObject *__pyx_v_value = 0;
-  PyObject *__pyx_v_formatdict = 0;
-  PyObject *__pyx_v_line = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("parse_formatdata (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_formatdict,&__pyx_n_s_line,0};
-    PyObject* values[5] = {0,0,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  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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_formatdict)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  4:
-        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse_formatdata") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
-      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);
-      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
-      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
-    }
-    __pyx_v_self = values[0];
-    __pyx_v_key = values[1];
-    __pyx_v_value = values[2];
-    __pyx_v_formatdict = values[3];
-    __pyx_v_line = values[4];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parse_formatdata", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_28parse_formatdata(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_value, __pyx_v_formatdict, __pyx_v_line);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_28parse_formatdata(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_formatdict, PyObject *__pyx_v_line) {
-  PyObject *__pyx_v_f = NULL;
-  PyObject *__pyx_v_values = NULL;
-  PyObject *__pyx_v_idx = NULL;
-  PyObject *__pyx_v_v = 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;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  Py_ssize_t __pyx_t_7;
-  int __pyx_t_8;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *(*__pyx_t_10)(PyObject *);
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  PyObject *__pyx_t_14 = NULL;
-  PyObject *__pyx_t_15 = NULL;
-  PyObject *__pyx_t_16 = NULL;
-  PyObject *__pyx_t_17 = NULL;
-  PyObject *__pyx_t_18 = NULL;
-  Py_ssize_t __pyx_t_19;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse_formatdata", 0);
-
-  /* "pysam/cvcf.pyx":610
- *     def parse_formatdata( self, key, value, formatdict, line ):
- *         # To do: check that the right number of values is present
- *         f = formatdict.get(key,None)             # <<<<<<<<<<<<<<
- *         if f == None:
- *             self._add_definition(formatdict, key, value, line )
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_formatdict, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __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 = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_key);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
-  __Pyx_GIVEREF(__pyx_v_key);
-  __Pyx_INCREF(Py_None);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
-  __Pyx_GIVEREF(Py_None);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_f = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":611
- *         # To do: check that the right number of values is present
- *         f = formatdict.get(key,None)
- *         if f == None:             # <<<<<<<<<<<<<<
- *             self._add_definition(formatdict, key, value, line )
- *             f = formatdict[key]
- */
-  __pyx_t_3 = PyObject_RichCompare(__pyx_v_f, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_4) {
-
-    /* "pysam/cvcf.pyx":612
- *         f = formatdict.get(key,None)
- *         if f == None:
- *             self._add_definition(formatdict, key, value, line )             # <<<<<<<<<<<<<<
- *             f = formatdict[key]
- *         if f.type == "Flag":
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_definition); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_formatdict);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_formatdict);
-    __Pyx_GIVEREF(__pyx_v_formatdict);
-    __Pyx_INCREF(__pyx_v_key);
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_key);
-    __Pyx_GIVEREF(__pyx_v_key);
-    __Pyx_INCREF(__pyx_v_value);
-    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value);
-    __Pyx_GIVEREF(__pyx_v_value);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":613
- *         if f == None:
- *             self._add_definition(formatdict, key, value, line )
- *             f = formatdict[key]             # <<<<<<<<<<<<<<
- *         if f.type == "Flag":
- *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
- */
-    __pyx_t_1 = PyObject_GetItem(__pyx_v_formatdict, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_1);
-    __pyx_t_1 = 0;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":614
- *             self._add_definition(formatdict, key, value, line )
- *             f = formatdict[key]
- *         if f.type == "Flag":             # <<<<<<<<<<<<<<
- *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
- *             return []
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_Flag, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_4) {
-
-    /* "pysam/cvcf.pyx":615
- *             f = formatdict[key]
- *         if f.type == "Flag":
- *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)             # <<<<<<<<<<<<<<
- *             return []
- *         values = value.split(',')
- */
-    __pyx_t_4 = (__pyx_v_value != Py_None);
-    __pyx_t_5 = (__pyx_t_4 != 0);
-    if (__pyx_t_5) {
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_FLAG_HAS_VALUE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L5;
-    }
-    __pyx_L5:;
-
-    /* "pysam/cvcf.pyx":616
- *         if f.type == "Flag":
- *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
- *             return []             # <<<<<<<<<<<<<<
- *         values = value.split(',')
- *         # deal with trailing data in some early VCF files
- */
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":617
- *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
- *             return []
- *         values = value.split(',')             # <<<<<<<<<<<<<<
- *         # deal with trailing data in some early VCF files
- *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_values = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":619
- *         values = value.split(',')
- *         # deal with trailing data in some early VCF files
- *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:             # <<<<<<<<<<<<<<
- *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
- *             values[-1] = values[-1].split(';')[0]
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Float, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (!__pyx_t_5) {
-    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_Integer, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = __pyx_t_4;
-  } else {
-    __pyx_t_6 = __pyx_t_5;
-  }
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_5 = __pyx_t_6;
-  if (__pyx_t_5) {
-    __pyx_t_7 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_6 = (__pyx_t_7 > 0);
-    if (__pyx_t_6) {
-      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_values, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_find); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_neg_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_8 = __pyx_t_4;
-    } else {
-      __pyx_t_8 = __pyx_t_6;
-    }
-    __pyx_t_6 = __pyx_t_8;
-  } else {
-    __pyx_t_6 = __pyx_t_5;
-  }
-  if (__pyx_t_6) {
-
-    /* "pysam/cvcf.pyx":620
- *         # deal with trailing data in some early VCF files
- *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
- *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])             # <<<<<<<<<<<<<<
- *             values[-1] = values[-1].split(';')[0]
- *         if f.type == "Integer":
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_TRAILING_DATA); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_values, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
-    __Pyx_GIVEREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_3 = 0;
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":621
- *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
- *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
- *             values[-1] = values[-1].split(';')[0]             # <<<<<<<<<<<<<<
- *         if f.type == "Integer":
- *             for idx,v in enumerate(values):
- */
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_values, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (unlikely(__Pyx_SetItemInt(__pyx_v_values, -1, __pyx_t_9, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    goto __pyx_L6;
-  }
-  __pyx_L6:;
-
-  /* "pysam/cvcf.pyx":622
- *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
- *             values[-1] = values[-1].split(';')[0]
- *         if f.type == "Integer":             # <<<<<<<<<<<<<<
- *             for idx,v in enumerate(values):
- *                 try:
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_Integer, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_6) {
-
-    /* "pysam/cvcf.pyx":623
- *             values[-1] = values[-1].split(';')[0]
- *         if f.type == "Integer":
- *             for idx,v in enumerate(values):             # <<<<<<<<<<<<<<
- *                 try:
- *                     if v == ".": values[idx] = f.missingvalue
- */
-    __Pyx_INCREF(__pyx_int_0);
-    __pyx_t_9 = __pyx_int_0;
-    if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
-      __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
-      __pyx_t_10 = NULL;
-    } else {
-      __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_1)) {
-        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_2 = __pyx_t_10(__pyx_t_1);
-        if (unlikely(!__pyx_t_2)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_2);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2);
-      __pyx_t_2 = 0;
-      __Pyx_INCREF(__pyx_t_9);
-      __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_9);
-      __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_9);
-      __pyx_t_9 = __pyx_t_2;
-      __pyx_t_2 = 0;
-
-      /* "pysam/cvcf.pyx":624
- *         if f.type == "Integer":
- *             for idx,v in enumerate(values):
- *                 try:             # <<<<<<<<<<<<<<
- *                     if v == ".": values[idx] = f.missingvalue
- *                     else:        values[idx] = int(v)
- */
-      {
-        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
-        __Pyx_XGOTREF(__pyx_t_11);
-        __Pyx_XGOTREF(__pyx_t_12);
-        __Pyx_XGOTREF(__pyx_t_13);
-        /*try:*/ {
-
-          /* "pysam/cvcf.pyx":625
- *             for idx,v in enumerate(values):
- *                 try:
- *                     if v == ".": values[idx] = f.missingvalue             # <<<<<<<<<<<<<<
- *                     else:        values[idx] = int(v)
- *                 except:
- */
-          __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_v, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-          if (__pyx_t_6) {
-            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_missingvalue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-            __Pyx_GOTREF(__pyx_t_2);
-            if (unlikely(PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            goto __pyx_L18;
-          }
-          /*else*/ {
-
-            /* "pysam/cvcf.pyx":626
- *                 try:
- *                     if v == ".": values[idx] = f.missingvalue
- *                     else:        values[idx] = int(v)             # <<<<<<<<<<<<<<
- *                 except:
- *                     self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values)))
- */
-            __pyx_t_2 = PyNumber_Int(__pyx_v_v); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-            __Pyx_GOTREF(__pyx_t_2);
-            if (unlikely(PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          }
-          __pyx_L18:;
-        }
-        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-        goto __pyx_L17_try_end;
-        __pyx_L10_error:;
-        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-        /* "pysam/cvcf.pyx":627
- *                     if v == ".": values[idx] = f.missingvalue
- *                     else:        values[idx] = int(v)
- *                 except:             # <<<<<<<<<<<<<<
- *                     self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values)))
- *                     return [0] * len(values)
- */
-        /*except:*/ {
-          __Pyx_AddTraceback("pysam.cvcf.VCF.parse_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_14) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_GOTREF(__pyx_t_3);
-          __Pyx_GOTREF(__pyx_t_14);
-
-          /* "pysam/cvcf.pyx":628
- *                     else:        values[idx] = int(v)
- *                 except:
- *                     self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values)))             # <<<<<<<<<<<<<<
- *                     return [0] * len(values)
- *             return values
- */
-          __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_15);
-          __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_FORMAT_NOT_INTEGER); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_16);
-          __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_17);
-          __Pyx_INCREF(__pyx_v_values);
-          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_values);
-          __Pyx_GIVEREF(__pyx_v_values);
-          __pyx_t_18 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_18);
-          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
-          __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_17);
-          __Pyx_INCREF(__pyx_v_key);
-          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_key);
-          __Pyx_GIVEREF(__pyx_v_key);
-          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_18);
-          __Pyx_GIVEREF(__pyx_t_18);
-          __pyx_t_18 = 0;
-          __pyx_t_18 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_17); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_18);
-          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
-          __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_17);
-          __Pyx_INCREF(__pyx_v_line);
-          PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_line);
-          __Pyx_GIVEREF(__pyx_v_line);
-          PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
-          __Pyx_GIVEREF(__pyx_t_16);
-          PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_18);
-          __Pyx_GIVEREF(__pyx_t_18);
-          __pyx_t_16 = 0;
-          __pyx_t_18 = 0;
-          __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_17, NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_18);
-          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
-          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
-
-          /* "pysam/cvcf.pyx":629
- *                 except:
- *                     self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values)))
- *                     return [0] * len(values)             # <<<<<<<<<<<<<<
- *             return values
- *         elif f.type == "String":
- */
-          __Pyx_XDECREF(__pyx_r);
-          __pyx_t_19 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __pyx_t_18 = PyList_New(1 * ((__pyx_t_19<0) ? 0:__pyx_t_19)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
-          __Pyx_GOTREF(__pyx_t_18);
-          { Py_ssize_t __pyx_temp;
-            for (__pyx_temp=0; __pyx_temp < __pyx_t_19; __pyx_temp++) {
-              __Pyx_INCREF(__pyx_int_0);
-              PyList_SET_ITEM(__pyx_t_18, __pyx_temp, __pyx_int_0);
-              __Pyx_GIVEREF(__pyx_int_0);
-            }
-          }
-          __pyx_r = __pyx_t_18;
-          __pyx_t_18 = 0;
-          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-          goto __pyx_L13_except_return;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-          goto __pyx_L11_exception_handled;
-        }
-        __pyx_L12_except_error:;
-        __Pyx_XGIVEREF(__pyx_t_11);
-        __Pyx_XGIVEREF(__pyx_t_12);
-        __Pyx_XGIVEREF(__pyx_t_13);
-        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
-        goto __pyx_L1_error;
-        __pyx_L13_except_return:;
-        __Pyx_XGIVEREF(__pyx_t_11);
-        __Pyx_XGIVEREF(__pyx_t_12);
-        __Pyx_XGIVEREF(__pyx_t_13);
-        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
-        goto __pyx_L0;
-        __pyx_L11_exception_handled:;
-        __Pyx_XGIVEREF(__pyx_t_11);
-        __Pyx_XGIVEREF(__pyx_t_12);
-        __Pyx_XGIVEREF(__pyx_t_13);
-        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
-        __pyx_L17_try_end:;
-      }
-    }
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":630
- *                     self.error(line,self.ERROR_FORMAT_NOT_INTEGER,"%s=%s" % (key, str(values)))
- *                     return [0] * len(values)
- *             return values             # <<<<<<<<<<<<<<
- *         elif f.type == "String":
- *             self._line = line
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_values);
-    __pyx_r = __pyx_v_values;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":631
- *                     return [0] * len(values)
- *             return values
- *         elif f.type == "String":             # <<<<<<<<<<<<<<
- *             self._line = line
- *             if f.id == "GT": values = list(map( self.convertGT, values ))
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_String, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_6) {
-
-    /* "pysam/cvcf.pyx":632
- *             return values
- *         elif f.type == "String":
- *             self._line = line             # <<<<<<<<<<<<<<
- *             if f.id == "GT": values = list(map( self.convertGT, values ))
- *             return values
- */
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_line_2, __pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/cvcf.pyx":633
- *         elif f.type == "String":
- *             self._line = line
- *             if f.id == "GT": values = list(map( self.convertGT, values ))             # <<<<<<<<<<<<<<
- *             return values
- *         elif f.type == "Character":
- */
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_id); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_GT, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    if (__pyx_t_6) {
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_convertGT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_v_values);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_values);
-      __Pyx_GIVEREF(__pyx_v_values);
-      __pyx_t_9 = 0;
-      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __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 = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      __pyx_t_9 = 0;
-      __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_9);
-      __pyx_t_9 = 0;
-      goto __pyx_L21;
-    }
-    __pyx_L21:;
-
-    /* "pysam/cvcf.pyx":634
- *             self._line = line
- *             if f.id == "GT": values = list(map( self.convertGT, values ))
- *             return values             # <<<<<<<<<<<<<<
- *         elif f.type == "Character":
- *             for v in values:
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_values);
-    __pyx_r = __pyx_v_values;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":635
- *             if f.id == "GT": values = list(map( self.convertGT, values ))
- *             return values
- *         elif f.type == "Character":             # <<<<<<<<<<<<<<
- *             for v in values:
- *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_Character, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_6) {
-
-    /* "pysam/cvcf.pyx":636
- *             return values
- *         elif f.type == "Character":
- *             for v in values:             # <<<<<<<<<<<<<<
- *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
- *             return values
- */
-    if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
-      __pyx_t_9 = __pyx_v_values; __Pyx_INCREF(__pyx_t_9); __pyx_t_7 = 0;
-      __pyx_t_10 = NULL;
-    } else {
-      __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_9)) {
-        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_9)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_9)) {
-        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_1 = __pyx_t_10(__pyx_t_9);
-        if (unlikely(!__pyx_t_1)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_1);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
-      __pyx_t_1 = 0;
-
-      /* "pysam/cvcf.pyx":637
- *         elif f.type == "Character":
- *             for v in values:
- *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)             # <<<<<<<<<<<<<<
- *             return values
- *         elif f.type == "Float":
- */
-      __pyx_t_19 = PyObject_Length(__pyx_v_v); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_6 = ((__pyx_t_19 != 1) != 0);
-      if (__pyx_t_6) {
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_FORMAT_NOT_CHAR); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_14);
-        __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_14);
-        __Pyx_GIVEREF(__pyx_t_14);
-        __pyx_t_14 = 0;
-        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-        goto __pyx_L24;
-      }
-      __pyx_L24:;
-    }
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":638
- *             for v in values:
- *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
- *             return values             # <<<<<<<<<<<<<<
- *         elif f.type == "Float":
- *             for idx,v in enumerate(values):
- */
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(__pyx_v_values);
-    __pyx_r = __pyx_v_values;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":639
- *                 if len(v) != 1: self.error(line,self.ERROR_FORMAT_NOT_CHAR)
- *             return values
- *         elif f.type == "Float":             # <<<<<<<<<<<<<<
- *             for idx,v in enumerate(values):
- *                 if v == ".": values[idx] = f.missingvalue
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_Float, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__pyx_t_6) {
-
-    /* "pysam/cvcf.pyx":640
- *             return values
- *         elif f.type == "Float":
- *             for idx,v in enumerate(values):             # <<<<<<<<<<<<<<
- *                 if v == ".": values[idx] = f.missingvalue
- *             try: return list(map(float,values))
- */
-    __Pyx_INCREF(__pyx_int_0);
-    __pyx_t_9 = __pyx_int_0;
-    if (PyList_CheckExact(__pyx_v_values) || PyTuple_CheckExact(__pyx_v_values)) {
-      __pyx_t_14 = __pyx_v_values; __Pyx_INCREF(__pyx_t_14); __pyx_t_7 = 0;
-      __pyx_t_10 = NULL;
-    } else {
-      __pyx_t_7 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_14);
-      __pyx_t_10 = Py_TYPE(__pyx_t_14)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_14)) {
-        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_14)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_14)) {
-        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_3 = __pyx_t_10(__pyx_t_14);
-        if (unlikely(!__pyx_t_3)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_3);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3);
-      __pyx_t_3 = 0;
-      __Pyx_INCREF(__pyx_t_9);
-      __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_9);
-      __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_3);
-      __Pyx_DECREF(__pyx_t_9);
-      __pyx_t_9 = __pyx_t_3;
-      __pyx_t_3 = 0;
-
-      /* "pysam/cvcf.pyx":641
- *         elif f.type == "Float":
- *             for idx,v in enumerate(values):
- *                 if v == ".": values[idx] = f.missingvalue             # <<<<<<<<<<<<<<
- *             try: return list(map(float,values))
- *             except:
- */
-      __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_v, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (__pyx_t_6) {
-        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_missingvalue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_3);
-        if (unlikely(PyObject_SetItem(__pyx_v_values, __pyx_v_idx, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        goto __pyx_L27;
-      }
-      __pyx_L27:;
-    }
-    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":642
- *             for idx,v in enumerate(values):
- *                 if v == ".": values[idx] = f.missingvalue
- *             try: return list(map(float,values))             # <<<<<<<<<<<<<<
- *             except:
- *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values)))
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
-      __Pyx_XGOTREF(__pyx_t_13);
-      __Pyx_XGOTREF(__pyx_t_12);
-      __Pyx_XGOTREF(__pyx_t_11);
-      /*try:*/ {
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
-        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)((PyObject*)(&PyFloat_Type))));
-        __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
-        __Pyx_INCREF(__pyx_v_values);
-        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_values);
-        __Pyx_GIVEREF(__pyx_v_values);
-        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_9, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-        __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_14);
-        __Pyx_GIVEREF(__pyx_t_14);
-        __pyx_t_14 = 0;
-        __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-        __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_r = __pyx_t_14;
-        __pyx_t_14 = 0;
-        goto __pyx_L32_try_return;
-      }
-      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      goto __pyx_L35_try_end;
-      __pyx_L28_error:;
-      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
-      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
-      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
-      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
-
-      /* "pysam/cvcf.pyx":643
- *                 if v == ".": values[idx] = f.missingvalue
- *             try: return list(map(float,values))
- *             except:             # <<<<<<<<<<<<<<
- *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values)))
- *                 return [0.0] * len(values)
- */
-      /*except:*/ {
-        __Pyx_AddTraceback("pysam.cvcf.VCF.parse_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_9, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_14);
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_GOTREF(__pyx_t_3);
-
-        /* "pysam/cvcf.pyx":644
- *             try: return list(map(float,values))
- *             except:
- *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values)))             # <<<<<<<<<<<<<<
- *                 return [0.0] * len(values)
- *         else:
- */
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_18);
-        __Pyx_INCREF(__pyx_v_values);
-        PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_values);
-        __Pyx_GIVEREF(__pyx_v_values);
-        __pyx_t_17 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_17);
-        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
-        __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_18);
-        __Pyx_INCREF(__pyx_v_key);
-        PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_key);
-        __Pyx_GIVEREF(__pyx_v_key);
-        PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_17);
-        __Pyx_GIVEREF(__pyx_t_17);
-        __pyx_t_17 = 0;
-        __pyx_t_17 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_18); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_17);
-        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
-        __pyx_t_18 = PyTuple_New(3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_18);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_17);
-        __Pyx_GIVEREF(__pyx_t_17);
-        __pyx_t_2 = 0;
-        __pyx_t_17 = 0;
-        __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_18, NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_17);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
-        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
-
-        /* "pysam/cvcf.pyx":645
- *             except:
- *                 self.error(line,self.ERROR_FORMAT_NOT_NUMERICAL,"%s=%s" % (key, str(values)))
- *                 return [0.0] * len(values)             # <<<<<<<<<<<<<<
- *         else:
- *             # can't happen
- */
-        __Pyx_XDECREF(__pyx_r);
-        __pyx_t_7 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __pyx_t_17 = PyList_New(1 * ((__pyx_t_7<0) ? 0:__pyx_t_7)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_17);
-        { Py_ssize_t __pyx_temp;
-          for (__pyx_temp=0; __pyx_temp < __pyx_t_7; __pyx_temp++) {
-            __Pyx_INCREF(__pyx_float_0_0);
-            PyList_SET_ITEM(__pyx_t_17, __pyx_temp, __pyx_float_0_0);
-            __Pyx_GIVEREF(__pyx_float_0_0);
-          }
-        }
-        __pyx_r = __pyx_t_17;
-        __pyx_t_17 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-        goto __pyx_L31_except_return;
-        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        goto __pyx_L29_exception_handled;
-      }
-      __pyx_L30_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_13);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
-      goto __pyx_L1_error;
-      __pyx_L32_try_return:;
-      __Pyx_XGIVEREF(__pyx_t_13);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
-      goto __pyx_L0;
-      __pyx_L31_except_return:;
-      __Pyx_XGIVEREF(__pyx_t_13);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
-      goto __pyx_L0;
-      __pyx_L29_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_13);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_XGIVEREF(__pyx_t_11);
-      __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
-      __pyx_L35_try_end:;
-    }
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":648
- *         else:
- *             # can't happen
- *             self.error(line,self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
- * 
- *     def inregion(self, chrom, pos):
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_INFO_STRING); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_14);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  }
-
-  /* "pysam/cvcf.pyx":608
- *         return ''.join(map(str,GTdata))
- * 
- *     def parse_formatdata( self, key, value, formatdict, line ):             # <<<<<<<<<<<<<<
- *         # To do: check that the right number of values is present
- *         f = formatdict.get(key,None)
- */
-
-  /* function exit code */
-  __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_9);
-  __Pyx_XDECREF(__pyx_t_14);
-  __Pyx_XDECREF(__pyx_t_15);
-  __Pyx_XDECREF(__pyx_t_16);
-  __Pyx_XDECREF(__pyx_t_17);
-  __Pyx_XDECREF(__pyx_t_18);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_formatdata", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_XDECREF(__pyx_v_values);
-  __Pyx_XDECREF(__pyx_v_idx);
-  __Pyx_XDECREF(__pyx_v_v);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":650
- *             self.error(line,self.ERROR_INFO_STRING)
- * 
- *     def inregion(self, chrom, pos):             # <<<<<<<<<<<<<<
- *         if not self._regions: return True
- *         for r in self._regions:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_31inregion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_31inregion = {__Pyx_NAMESTR("inregion"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_31inregion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_31inregion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_chrom = 0;
-  PyObject *__pyx_v_pos = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("inregion (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_chrom,&__pyx_n_s_pos,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_chrom)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inregion") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __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_self = values[0];
-    __pyx_v_chrom = values[1];
-    __pyx_v_pos = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("inregion", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.inregion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_30inregion(__pyx_self, __pyx_v_self, __pyx_v_chrom, __pyx_v_pos);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_30inregion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_chrom, PyObject *__pyx_v_pos) {
-  PyObject *__pyx_v_r = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  PyObject *__pyx_t_4 = NULL;
-  Py_ssize_t __pyx_t_5;
-  PyObject *(*__pyx_t_6)(PyObject *);
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  int __pyx_t_9;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("inregion", 0);
-
-  /* "pysam/cvcf.pyx":651
- * 
- *     def inregion(self, chrom, pos):
- *         if not self._regions: return True             # <<<<<<<<<<<<<<
- *         for r in self._regions:
- *             if r[0] == chrom and r[1] <= pos < r[2]: return True
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_regions_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = ((!__pyx_t_2) != 0);
-  if (__pyx_t_3) {
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_True);
-    __pyx_r = Py_True;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":652
- *     def inregion(self, chrom, pos):
- *         if not self._regions: return True
- *         for r in self._regions:             # <<<<<<<<<<<<<<
- *             if r[0] == chrom and r[1] <= pos < r[2]: return True
- *         return False
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_regions_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
-    __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
-    __pyx_t_6 = NULL;
-  } else {
-    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  for (;;) {
-    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
-      if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_1 = __pyx_t_6(__pyx_t_4);
-      if (unlikely(!__pyx_t_1)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_1);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":653
- *         if not self._regions: return True
- *         for r in self._regions:
- *             if r[0] == chrom and r[1] <= pos < r[2]: return True             # <<<<<<<<<<<<<<
- *         return False
- * 
- */
-    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_r, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_v_chrom, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (__pyx_t_3) {
-      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_r, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_1 = PyObject_RichCompare(__pyx_t_7, __pyx_v_pos, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
-        __Pyx_DECREF(__pyx_t_1);
-        __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_r, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_1 = PyObject_RichCompare(__pyx_v_pos, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      }
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_9 = __pyx_t_2;
-    } else {
-      __pyx_t_9 = __pyx_t_3;
-    }
-    if (__pyx_t_9) {
-      __Pyx_XDECREF(__pyx_r);
-      __Pyx_INCREF(Py_True);
-      __pyx_r = Py_True;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      goto __pyx_L0;
-    }
-  }
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/cvcf.pyx":654
- *         for r in self._regions:
- *             if r[0] == chrom and r[1] <= pos < r[2]: return True
- *         return False             # <<<<<<<<<<<<<<
- * 
- *     def parse_data( self, line, lineparse=False ):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(Py_False);
-  __pyx_r = Py_False;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":650
- *             self.error(line,self.ERROR_INFO_STRING)
- * 
- *     def inregion(self, chrom, pos):             # <<<<<<<<<<<<<<
- *         if not self._regions: return True
- *         for r in self._regions:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.inregion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_r);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":656
- *         return False
- * 
- *     def parse_data( self, line, lineparse=False ):             # <<<<<<<<<<<<<<
- *         cols = line.split('\t')
- *         if len(cols) != len(self._samples)+9:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_33parse_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_33parse_data = {__Pyx_NAMESTR("parse_data"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_33parse_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_33parse_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_line = 0;
-  PyObject *__pyx_v_lineparse = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("parse_data (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,&__pyx_n_s_lineparse,0};
-    PyObject* values[3] = {0,0,0};
-    values[2] = ((PyObject *)((PyObject *)Py_False));
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse_data", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lineparse);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse_data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_self = values[0];
-    __pyx_v_line = values[1];
-    __pyx_v_lineparse = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parse_data", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_32parse_data(__pyx_self, __pyx_v_self, __pyx_v_line, __pyx_v_lineparse);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_32parse_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_lineparse) {
-  PyObject *__pyx_v_cols = NULL;
-  PyObject *__pyx_v_chrom = NULL;
-  PyObject *__pyx_v_pos = NULL;
-  PyObject *__pyx_v_id = NULL;
-  PyObject *__pyx_v_ref = NULL;
-  PyObject *__pyx_v_c = NULL;
-  PyObject *__pyx_v_left = NULL;
-  PyObject *__pyx_v_faref_leftflank = NULL;
-  PyObject *__pyx_v_faref = NULL;
-  PyObject *__pyx_v_alt = NULL;
-  double __pyx_v_qual;
-  PyObject *__pyx_v_filter = NULL;
-  PyObject *__pyx_v_info = NULL;
-  PyObject *__pyx_v_blurp = NULL;
-  PyObject *__pyx_v_elts = NULL;
-  PyObject *__pyx_v_v = NULL;
-  PyObject *__pyx_v_format = NULL;
-  PyObject *__pyx_v_f = NULL;
-  PyObject *__pyx_v_newalts = NULL;
-  int __pyx_v_have_deletions;
-  PyObject *__pyx_v_a = NULL;
-  PyObject *__pyx_v_l = NULL;
-  PyObject *__pyx_v_addns = NULL;
-  PyObject *__pyx_v_i = NULL;
-  PyObject *__pyx_v_na = NULL;
-  PyObject *__pyx_v_s = NULL;
-  PyObject *__pyx_v_addn = NULL;
-  PyObject *__pyx_v_allele = NULL;
-  int __pyx_v_movable;
-  PyObject *__pyx_v_longest = NULL;
-  PyObject *__pyx_v_shortest = NULL;
-  PyObject *__pyx_v_samples = NULL;
-  PyObject *__pyx_v_sample = NULL;
-  PyObject *__pyx_v_dict = NULL;
-  PyObject *__pyx_v_values = NULL;
-  Py_ssize_t __pyx_v_idx;
-  PyObject *__pyx_v_expected = NULL;
-  PyObject *__pyx_v_value = NULL;
-  PyObject *__pyx_v_d = NULL;
-  PyObject *__pyx_v_key = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  Py_ssize_t __pyx_t_3;
-  Py_ssize_t __pyx_t_4;
-  int __pyx_t_5;
-  int __pyx_t_6;
-  PyObject *__pyx_t_7 = NULL;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  PyObject *__pyx_t_14 = NULL;
-  int __pyx_t_15;
-  PyObject *(*__pyx_t_16)(PyObject *);
-  long __pyx_t_17;
-  double __pyx_t_18;
-  int __pyx_t_19;
-  int __pyx_t_20;
-  int __pyx_t_21;
-  Py_ssize_t __pyx_t_22;
-  PyObject *__pyx_t_23 = NULL;
-  PyObject *__pyx_t_24 = NULL;
-  PyObject *__pyx_t_25 = NULL;
-  Py_ssize_t __pyx_t_26;
-  PyObject *(*__pyx_t_27)(PyObject *);
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("parse_data", 0);
-
-  /* "pysam/cvcf.pyx":657
- * 
- *     def parse_data( self, line, lineparse=False ):
- *         cols = line.split('\t')             # <<<<<<<<<<<<<<
- *         if len(cols) != len(self._samples)+9:
- *             # gracefully deal with absent FORMAT column
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_v_cols = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":658
- *     def parse_data( self, line, lineparse=False ):
- *         cols = line.split('\t')
- *         if len(cols) != len(self._samples)+9:             # <<<<<<<<<<<<<<
- *             # gracefully deal with absent FORMAT column
- *             # and those missing samples
- */
-  __pyx_t_3 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_5 = ((__pyx_t_3 != (__pyx_t_4 + 9)) != 0);
-  if (__pyx_t_5) {
-
-    /* "pysam/cvcf.pyx":661
- *             # gracefully deal with absent FORMAT column
- *             # and those missing samples
- *             if len(cols) == 8:             # <<<<<<<<<<<<<<
- *                 cols.append("")
- *             else:
- */
-    __pyx_t_4 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = ((__pyx_t_4 == 8) != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/cvcf.pyx":662
- *             # and those missing samples
- *             if len(cols) == 8:
- *                 cols.append("")             # <<<<<<<<<<<<<<
- *             else:
- *                 self.error(line,
- */
-      __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_cols, __pyx_kp_s_); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L4;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":664
- *                 cols.append("")
- *             else:
- *                 self.error(line,             # <<<<<<<<<<<<<<
- *                            self.BAD_NUMBER_OF_COLUMNS,
- *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-
-      /* "pysam/cvcf.pyx":665
- *             else:
- *                 self.error(line,
- *                            self.BAD_NUMBER_OF_COLUMNS,             # <<<<<<<<<<<<<<
- *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
- * 
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BAD_NUMBER_OF_COLUMNS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-
-      /* "pysam/cvcf.pyx":666
- *                 self.error(line,
- *                            self.BAD_NUMBER_OF_COLUMNS,
- *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))             # <<<<<<<<<<<<<<
- * 
- *         chrom = cols[0]
- */
-      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_4 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_7 = PyInt_FromSsize_t((__pyx_t_4 + 9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_4 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_4 = PyObject_Length(__pyx_v_cols); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
-      __Pyx_GIVEREF(__pyx_t_7);
-      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_10);
-      __Pyx_GIVEREF(__pyx_t_10);
-      __pyx_t_7 = 0;
-      __pyx_t_8 = 0;
-      __pyx_t_9 = 0;
-      __pyx_t_10 = 0;
-      __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_expected_s_for_s_samples_s_got_s, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
-      /* "pysam/cvcf.pyx":664
- *                 cols.append("")
- *             else:
- *                 self.error(line,             # <<<<<<<<<<<<<<
- *                            self.BAD_NUMBER_OF_COLUMNS,
- *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
- */
-      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
-      __Pyx_GIVEREF(__pyx_t_10);
-      __pyx_t_1 = 0;
-      __pyx_t_10 = 0;
-      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    }
-    __pyx_L4:;
-    goto __pyx_L3;
-  }
-  __pyx_L3:;
-
-  /* "pysam/cvcf.pyx":668
- *                            "expected %s for %s samples (%s), got %s" % (len(self._samples)+9, len(self._samples), self._samples, len(cols)))
- * 
- *         chrom = cols[0]             # <<<<<<<<<<<<<<
- * 
- *         # get 0-based position
- */
-  __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_v_chrom = __pyx_t_10;
-  __pyx_t_10 = 0;
-
-  /* "pysam/cvcf.pyx":671
- * 
- *         # get 0-based position
- *         try:    pos = int(cols[1])-1             # <<<<<<<<<<<<<<
- *         except: self.error(line,self.POS_NOT_NUMERICAL)
- *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)
- */
-  {
-    __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
-    __Pyx_XGOTREF(__pyx_t_12);
-    __Pyx_XGOTREF(__pyx_t_13);
-    __Pyx_XGOTREF(__pyx_t_14);
-    /*try:*/ {
-      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
-      __Pyx_GOTREF(__pyx_t_10);
-      __pyx_t_11 = PyNumber_Int(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_t_10 = PyNumber_Subtract(__pyx_t_11, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __pyx_v_pos = __pyx_t_10;
-      __pyx_t_10 = 0;
-    }
-    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
-    goto __pyx_L12_try_end;
-    __pyx_L5_error:;
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-
-    /* "pysam/cvcf.pyx":672
- *         # get 0-based position
- *         try:    pos = int(cols[1])-1
- *         except: self.error(line,self.POS_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
- *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)
- * 
- */
-    /*except:*/ {
-      __Pyx_AddTraceback("pysam.cvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_POS_NOT_NUMERICAL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      __pyx_t_9 = 0;
-      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 672; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      goto __pyx_L6_exception_handled;
-    }
-    __pyx_L7_except_error:;
-    __Pyx_XGIVEREF(__pyx_t_12);
-    __Pyx_XGIVEREF(__pyx_t_13);
-    __Pyx_XGIVEREF(__pyx_t_14);
-    __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
-    goto __pyx_L1_error;
-    __pyx_L6_exception_handled:;
-    __Pyx_XGIVEREF(__pyx_t_12);
-    __Pyx_XGIVEREF(__pyx_t_13);
-    __Pyx_XGIVEREF(__pyx_t_14);
-    __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
-    __pyx_L12_try_end:;
-  }
-
-  /* "pysam/cvcf.pyx":673
- *         try:    pos = int(cols[1])-1
- *         except: self.error(line,self.POS_NOT_NUMERICAL)
- *         if pos < 0: self.error(line,self.POS_NOT_POSITIVE)             # <<<<<<<<<<<<<<
- * 
- *         # implement filtering
- */
-  if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  __pyx_t_2 = PyObject_RichCompare(__pyx_v_pos, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_5) {
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_POS_NOT_POSITIVE); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
-    __Pyx_GIVEREF(__pyx_t_11);
-    __pyx_t_11 = 0;
-    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    goto __pyx_L15;
-  }
-  __pyx_L15:;
-
-  /* "pysam/cvcf.pyx":676
- * 
- *         # implement filtering
- *         if not self.inregion(chrom,pos): return None             # <<<<<<<<<<<<<<
- * 
- *         # end of first-pass parse for sortedVCF
- */
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inregion); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_INCREF(__pyx_v_chrom);
-  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_chrom);
-  __Pyx_GIVEREF(__pyx_v_chrom);
-  __Pyx_INCREF(__pyx_v_pos);
-  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_pos);
-  __Pyx_GIVEREF(__pyx_v_pos);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_15 = ((!__pyx_t_5) != 0);
-  if (__pyx_t_15) {
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_None);
-    __pyx_r = Py_None;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":679
- * 
- *         # end of first-pass parse for sortedVCF
- *         if lineparse: return chrom, pos, line             # <<<<<<<<<<<<<<
- * 
- *         id = cols[2]
- */
-  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_lineparse); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_15) {
-    __Pyx_XDECREF(__pyx_r);
-    if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_chrom);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
-    __Pyx_GIVEREF(__pyx_v_chrom);
-    __Pyx_INCREF(__pyx_v_pos);
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_pos);
-    __Pyx_GIVEREF(__pyx_v_pos);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    __pyx_r = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":681
- *         if lineparse: return chrom, pos, line
- * 
- *         id = cols[2]             # <<<<<<<<<<<<<<
- * 
- *         ref = cols[3].upper()
- */
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_id = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":683
- *         id = cols[2]
- * 
- *         ref = cols[3].upper()             # <<<<<<<<<<<<<<
- *         if ref == ".":
- *             self.error(line,self.MISSING_REF)
- */
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_upper); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __pyx_v_ref = __pyx_t_2;
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":684
- * 
- *         ref = cols[3].upper()
- *         if ref == ".":             # <<<<<<<<<<<<<<
- *             self.error(line,self.MISSING_REF)
- *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
- */
-  __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_ref, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__pyx_t_15) {
-
-    /* "pysam/cvcf.pyx":685
- *         ref = cols[3].upper()
- *         if ref == ".":
- *             self.error(line,self.MISSING_REF)             # <<<<<<<<<<<<<<
- *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
- *             else:                   ref = ""
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MISSING_REF); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __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 = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_INCREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_line);
-    __Pyx_GIVEREF(__pyx_v_line);
-    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
-    __Pyx_GIVEREF(__pyx_t_10);
-    __pyx_t_10 = 0;
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
-    /* "pysam/cvcf.pyx":686
- *         if ref == ".":
- *             self.error(line,self.MISSING_REF)
- *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)             # <<<<<<<<<<<<<<
- *             else:                   ref = ""
- *         else:
- */
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_11 = PyObject_RichCompare(__pyx_t_10, __pyx_int_33, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    if (__pyx_t_15) {
-      __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-      if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-      __pyx_t_10 = PyNumber_Add(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_v_chrom);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_chrom);
-      __Pyx_GIVEREF(__pyx_v_chrom);
-      __Pyx_INCREF(__pyx_v_pos);
-      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_pos);
-      __Pyx_GIVEREF(__pyx_v_pos);
-      PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_10);
-      __Pyx_GIVEREF(__pyx_t_10);
-      PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_10 = 0;
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_2);
-      __pyx_t_2 = 0;
-      goto __pyx_L19;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":687
- *             self.error(line,self.MISSING_REF)
- *             if self._version == 33: ref = get_sequence(chrom,pos,pos+1,self._reference)
- *             else:                   ref = ""             # <<<<<<<<<<<<<<
- *         else:
- *             for c in ref:
- */
-      __Pyx_INCREF(__pyx_kp_s_);
-      __Pyx_DECREF_SET(__pyx_v_ref, __pyx_kp_s_);
-    }
-    __pyx_L19:;
-    goto __pyx_L18;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":689
- *             else:                   ref = ""
- *         else:
- *             for c in ref:             # <<<<<<<<<<<<<<
- *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)
- *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)
- */
-    if (PyList_CheckExact(__pyx_v_ref) || PyTuple_CheckExact(__pyx_v_ref)) {
-      __pyx_t_2 = __pyx_v_ref; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
-      __pyx_t_16 = NULL;
-    } else {
-      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_16 = Py_TYPE(__pyx_t_2)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_2)) {
-        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_2)) {
-        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_9 = __pyx_t_16(__pyx_t_2);
-        if (unlikely(!__pyx_t_9)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_9);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_9);
-      __pyx_t_9 = 0;
-
-      /* "pysam/cvcf.pyx":690
- *         else:
- *             for c in ref:
- *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)             # <<<<<<<<<<<<<<
- *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)
- * 
- */
-      __pyx_t_15 = (__Pyx_PySequence_Contains(__pyx_v_c, __pyx_n_s_ACGTN, Py_NE)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = (__pyx_t_15 != 0);
-      if (__pyx_t_5) {
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_UNKNOWN_CHAR_IN_REF); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
-        __Pyx_GIVEREF(__pyx_t_11);
-        __pyx_t_11 = 0;
-        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        goto __pyx_L22;
-      }
-      __pyx_L22:;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":691
- *             for c in ref:
- *                 if c not in "ACGTN": self.error(line,self.UNKNOWN_CHAR_IN_REF)
- *             if "N" in ref: ref = get_sequence(chrom,pos,pos+len(ref),self._reference)             # <<<<<<<<<<<<<<
- * 
- *         # make sure reference is sane
- */
-    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_n_s_N, __pyx_v_ref, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_15 = (__pyx_t_5 != 0);
-    if (__pyx_t_15) {
-      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-      if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-      __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_10 = PyNumber_Add(__pyx_v_pos, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_v_chrom);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_chrom);
-      __Pyx_GIVEREF(__pyx_v_chrom);
-      __Pyx_INCREF(__pyx_v_pos);
-      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_pos);
-      __Pyx_GIVEREF(__pyx_v_pos);
-      PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_10);
-      __Pyx_GIVEREF(__pyx_t_10);
-      PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11);
-      __Pyx_GIVEREF(__pyx_t_11);
-      __pyx_t_10 = 0;
-      __pyx_t_11 = 0;
-      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_11);
-      __pyx_t_11 = 0;
-      goto __pyx_L23;
-    }
-    __pyx_L23:;
-  }
-  __pyx_L18:;
-
-  /* "pysam/cvcf.pyx":694
- * 
- *         # make sure reference is sane
- *         if self._reference:             # <<<<<<<<<<<<<<
- *             left = max(0,pos-100)
- *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
- */
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  if (__pyx_t_15) {
-
-    /* "pysam/cvcf.pyx":695
- *         # make sure reference is sane
- *         if self._reference:
- *             left = max(0,pos-100)             # <<<<<<<<<<<<<<
- *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
- *             faref = faref_leftflank[pos-left:]
- */
-    if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __pyx_t_11 = PyNumber_Subtract(__pyx_v_pos, __pyx_int_100); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_17 = 0;
-    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_10 = PyObject_RichCompare(__pyx_t_11, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    if (__pyx_t_15) {
-      __Pyx_INCREF(__pyx_t_11);
-      __pyx_t_9 = __pyx_t_11;
-    } else {
-      __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_t_17); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __pyx_t_9 = __pyx_t_10;
-      __pyx_t_10 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_t_11 = __pyx_t_9;
-    __Pyx_INCREF(__pyx_t_11);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_v_left = __pyx_t_11;
-    __pyx_t_11 = 0;
-
-    /* "pysam/cvcf.pyx":696
- *         if self._reference:
- *             left = max(0,pos-100)
- *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)             # <<<<<<<<<<<<<<
- *             faref = faref_leftflank[pos-left:]
- *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
- */
-    __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_10 = PyNumber_Add(__pyx_v_pos, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_INCREF(__pyx_v_chrom);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
-    __Pyx_GIVEREF(__pyx_v_chrom);
-    __Pyx_INCREF(__pyx_v_left);
-    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_left);
-    __Pyx_GIVEREF(__pyx_v_left);
-    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_10);
-    __Pyx_GIVEREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_9);
-    __Pyx_GIVEREF(__pyx_t_9);
-    __pyx_t_10 = 0;
-    __pyx_t_9 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_faref_leftflank = __pyx_t_9;
-    __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":697
- *             left = max(0,pos-100)
- *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
- *             faref = faref_leftflank[pos-left:]             # <<<<<<<<<<<<<<
- *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
- *             ref = faref
- */
-    if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-    __pyx_t_9 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_faref_leftflank, 0, 0, &__pyx_t_9, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __pyx_v_faref = __pyx_t_2;
-    __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":698
- *             faref_leftflank = get_sequence(chrom,left,pos+len(ref),self._reference)
- *             faref = faref_leftflank[pos-left:]
- *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))             # <<<<<<<<<<<<<<
- *             ref = faref
- * 
- */
-    __pyx_t_2 = PyObject_RichCompare(__pyx_v_faref, __pyx_v_ref, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_15) {
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_WRONG_REF); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_INCREF(__pyx_v_faref);
-      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_faref);
-      __Pyx_GIVEREF(__pyx_v_faref);
-      __Pyx_INCREF(__pyx_v_ref);
-      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_ref);
-      __Pyx_GIVEREF(__pyx_v_ref);
-      __pyx_t_10 = __Pyx_PyString_Format(__pyx_kp_s_reference_is_s_VCF_says_s, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
-      __Pyx_GIVEREF(__pyx_t_10);
-      __pyx_t_9 = 0;
-      __pyx_t_10 = 0;
-      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      goto __pyx_L25;
-    }
-    __pyx_L25:;
-
-    /* "pysam/cvcf.pyx":699
- *             faref = faref_leftflank[pos-left:]
- *             if faref != ref: self.error(line,self.WRONG_REF,"(reference is %s, VCF says %s)" % (faref,ref))
- *             ref = faref             # <<<<<<<<<<<<<<
- * 
- *         # convert v3.3 to v4.0 alleles below
- */
-    __Pyx_INCREF(__pyx_v_faref);
-    __Pyx_DECREF_SET(__pyx_v_ref, __pyx_v_faref);
-    goto __pyx_L24;
-  }
-  __pyx_L24:;
-
-  /* "pysam/cvcf.pyx":702
- * 
- *         # convert v3.3 to v4.0 alleles below
- *         if cols[4] == ".": alt = []             # <<<<<<<<<<<<<<
- *         else: alt = cols[4].upper().split(',')
- * 
- */
-  __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  if (__pyx_t_15) {
-    __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_v_alt = __pyx_t_10;
-    __pyx_t_10 = 0;
-    goto __pyx_L26;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":703
- *         # convert v3.3 to v4.0 alleles below
- *         if cols[4] == ".": alt = []
- *         else: alt = cols[4].upper().split(',')             # <<<<<<<<<<<<<<
- * 
- *         if cols[5] == ".": qual = -1
- */
-    __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_upper); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_split); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_v_alt = __pyx_t_10;
-    __pyx_t_10 = 0;
-  }
-  __pyx_L26:;
-
-  /* "pysam/cvcf.pyx":705
- *         else: alt = cols[4].upper().split(',')
- * 
- *         if cols[5] == ".": qual = -1             # <<<<<<<<<<<<<<
- *         else:
- *             try:    qual = float(cols[5])
- */
-  __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_t_10, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  if (__pyx_t_15) {
-    __pyx_v_qual = -1.0;
-    goto __pyx_L27;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":707
- *         if cols[5] == ".": qual = -1
- *         else:
- *             try:    qual = float(cols[5])             # <<<<<<<<<<<<<<
- *             except: self.error(line,self.QUAL_NOT_NUMERICAL)
- * 
- */
-    {
-      __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
-      __Pyx_XGOTREF(__pyx_t_14);
-      __Pyx_XGOTREF(__pyx_t_13);
-      __Pyx_XGOTREF(__pyx_t_12);
-      /*try:*/ {
-        __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cols, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L28_error;};
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_18 = __Pyx_PyObject_AsDouble(__pyx_t_10); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __pyx_v_qual = __pyx_t_18;
-      }
-      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-      goto __pyx_L35_try_end;
-      __pyx_L28_error:;
-      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-
-      /* "pysam/cvcf.pyx":708
- *         else:
- *             try:    qual = float(cols[5])
- *             except: self.error(line,self.QUAL_NOT_NUMERICAL)             # <<<<<<<<<<<<<<
- * 
- *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- */
-      /*except:*/ {
-        __Pyx_AddTraceback("pysam.cvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_QUAL_NOT_NUMERICAL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8);
-        __Pyx_GIVEREF(__pyx_t_8);
-        __pyx_t_8 = 0;
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L29_exception_handled;
-      }
-      __pyx_L30_except_error:;
-      __Pyx_XGIVEREF(__pyx_t_14);
-      __Pyx_XGIVEREF(__pyx_t_13);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
-      goto __pyx_L1_error;
-      __pyx_L29_exception_handled:;
-      __Pyx_XGIVEREF(__pyx_t_14);
-      __Pyx_XGIVEREF(__pyx_t_13);
-      __Pyx_XGIVEREF(__pyx_t_12);
-      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
-      __pyx_L35_try_end:;
-    }
-  }
-  __pyx_L27:;
-
-  /* "pysam/cvcf.pyx":711
- * 
- *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- *         if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = []             # <<<<<<<<<<<<<<
- *         else: filter = cols[6].split(';')
- * 
- */
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__8, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!__pyx_t_15) {
-    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_PASS, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!__pyx_t_5) {
-      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_19 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s_0, Py_EQ)); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_20 = __pyx_t_19;
-    } else {
-      __pyx_t_20 = __pyx_t_5;
-    }
-    __pyx_t_5 = __pyx_t_20;
-  } else {
-    __pyx_t_5 = __pyx_t_15;
-  }
-  if (__pyx_t_5) {
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_v_filter = __pyx_t_2;
-    __pyx_t_2 = 0;
-    goto __pyx_L38;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":712
- *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- *         if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = []
- *         else: filter = cols[6].split(';')             # <<<<<<<<<<<<<<
- * 
- *         # dictionary of keys, and list of values
- */
-    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_v_filter = __pyx_t_2;
-    __pyx_t_2 = 0;
-  }
-  __pyx_L38:;
-
-  /* "pysam/cvcf.pyx":715
- * 
- *         # dictionary of keys, and list of values
- *         info = {}             # <<<<<<<<<<<<<<
- *         if cols[7] != ".":
- *             for blurp in cols[7].split(';'):
- */
-  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_v_info = ((PyObject*)__pyx_t_2);
-  __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":716
- *         # dictionary of keys, and list of values
- *         info = {}
- *         if cols[7] != ".":             # <<<<<<<<<<<<<<
- *             for blurp in cols[7].split(';'):
- *                 elts = blurp.split('=')
- */
-  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__8, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_5) {
-
-    /* "pysam/cvcf.pyx":717
- *         info = {}
- *         if cols[7] != ".":
- *             for blurp in cols[7].split(';'):             # <<<<<<<<<<<<<<
- *                 elts = blurp.split('=')
- *                 if len(elts) == 1: v = None
- */
-    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cols, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
-      __pyx_t_11 = __pyx_t_2; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
-      __pyx_t_16 = NULL;
-    } else {
-      __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_16 = Py_TYPE(__pyx_t_11)->tp_iternext;
-    }
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    for (;;) {
-      if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_11)) {
-        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_11)) {
-        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_2 = __pyx_t_16(__pyx_t_11);
-        if (unlikely(!__pyx_t_2)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_2);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_blurp, __pyx_t_2);
-      __pyx_t_2 = 0;
-
-      /* "pysam/cvcf.pyx":718
- *         if cols[7] != ".":
- *             for blurp in cols[7].split(';'):
- *                 elts = blurp.split('=')             # <<<<<<<<<<<<<<
- *                 if len(elts) == 1: v = None
- *                 elif len(elts) == 2: v = elts[1]
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_blurp, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_elts, __pyx_t_10);
-      __pyx_t_10 = 0;
-
-      /* "pysam/cvcf.pyx":719
- *             for blurp in cols[7].split(';'):
- *                 elts = blurp.split('=')
- *                 if len(elts) == 1: v = None             # <<<<<<<<<<<<<<
- *                 elif len(elts) == 2: v = elts[1]
- *                 else: self.error(line,self.ERROR_INFO_STRING)
- */
-      __pyx_t_3 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = ((__pyx_t_3 == 1) != 0);
-      if (__pyx_t_5) {
-        __Pyx_INCREF(Py_None);
-        __Pyx_XDECREF_SET(__pyx_v_v, Py_None);
-        goto __pyx_L42;
-      }
-
-      /* "pysam/cvcf.pyx":720
- *                 elts = blurp.split('=')
- *                 if len(elts) == 1: v = None
- *                 elif len(elts) == 2: v = elts[1]             # <<<<<<<<<<<<<<
- *                 else: self.error(line,self.ERROR_INFO_STRING)
- *                 info[elts[0]] = self.parse_formatdata(elts[0],
- */
-      __pyx_t_3 = PyObject_Length(__pyx_v_elts); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = ((__pyx_t_3 == 2) != 0);
-      if (__pyx_t_5) {
-        __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_elts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_10);
-        __pyx_t_10 = 0;
-        goto __pyx_L42;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":721
- *                 if len(elts) == 1: v = None
- *                 elif len(elts) == 2: v = elts[1]
- *                 else: self.error(line,self.ERROR_INFO_STRING)             # <<<<<<<<<<<<<<
- *                 info[elts[0]] = self.parse_formatdata(elts[0],
- *                                                       v,
- */
-        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ERROR_INFO_STRING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      }
-      __pyx_L42:;
-
-      /* "pysam/cvcf.pyx":722
- *                 elif len(elts) == 2: v = elts[1]
- *                 else: self.error(line,self.ERROR_INFO_STRING)
- *                 info[elts[0]] = self.parse_formatdata(elts[0],             # <<<<<<<<<<<<<<
- *                                                       v,
- *                                                       self._info,
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_formatdata); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_8);
-
-      /* "pysam/cvcf.pyx":723
- *                 else: self.error(line,self.ERROR_INFO_STRING)
- *                 info[elts[0]] = self.parse_formatdata(elts[0],
- *                                                       v,             # <<<<<<<<<<<<<<
- *                                                       self._info,
- *                                                       line)
- */
-      if (unlikely(!__pyx_v_v)) { __Pyx_RaiseUnboundLocalError("v"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-
-      /* "pysam/cvcf.pyx":724
- *                 info[elts[0]] = self.parse_formatdata(elts[0],
- *                                                       v,
- *                                                       self._info,             # <<<<<<<<<<<<<<
- *                                                       line)
- * 
- */
-      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-
-      /* "pysam/cvcf.pyx":722
- *                 elif len(elts) == 2: v = elts[1]
- *                 else: self.error(line,self.ERROR_INFO_STRING)
- *                 info[elts[0]] = self.parse_formatdata(elts[0],             # <<<<<<<<<<<<<<
- *                                                       v,
- *                                                       self._info,
- */
-      __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_v);
-      __Pyx_GIVEREF(__pyx_v_v);
-      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_10);
-      __Pyx_GIVEREF(__pyx_t_10);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      __pyx_t_8 = 0;
-      __pyx_t_10 = 0;
-      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_elts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_1);
-      if (unlikely(PyDict_SetItem(__pyx_v_info, __pyx_t_1, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    }
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    goto __pyx_L39;
-  }
-  __pyx_L39:;
-
-  /* "pysam/cvcf.pyx":728
- * 
- *         # Gracefully deal with absent FORMAT column
- *         if cols[8] == "": format = []             # <<<<<<<<<<<<<<
- *         else: format = cols[8].split(':')
- * 
- */
-  __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_11, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  if (__pyx_t_5) {
-    __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_v_format = __pyx_t_11;
-    __pyx_t_11 = 0;
-    goto __pyx_L43;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":729
- *         # Gracefully deal with absent FORMAT column
- *         if cols[8] == "": format = []
- *         else: format = cols[8].split(':')             # <<<<<<<<<<<<<<
- * 
- *         # check: all filters are defined
- */
-    __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cols, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_split); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_v_format = __pyx_t_11;
-    __pyx_t_11 = 0;
-  }
-  __pyx_L43:;
-
-  /* "pysam/cvcf.pyx":732
- * 
- *         # check: all filters are defined
- *         for f in filter:             # <<<<<<<<<<<<<<
- *             if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f)
- * 
- */
-  if (PyList_CheckExact(__pyx_v_filter) || PyTuple_CheckExact(__pyx_v_filter)) {
-    __pyx_t_11 = __pyx_v_filter; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
-    __pyx_t_16 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_filter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_16 = Py_TYPE(__pyx_t_11)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_11)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_11)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_10 = __pyx_t_16(__pyx_t_11);
-      if (unlikely(!__pyx_t_10)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_10);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_10);
-    __pyx_t_10 = 0;
-
-    /* "pysam/cvcf.pyx":733
- *         # check: all filters are defined
- *         for f in filter:
- *             if f not in self._filter: self.error(line,self.FILTER_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
- * 
- *         # check: format fields are defined
- */
-    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_f, __pyx_t_10, Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-    __pyx_t_15 = (__pyx_t_5 != 0);
-    if (__pyx_t_15) {
-      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FILTER_NOT_DEFINED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __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 = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_v_f);
-      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_f);
-      __Pyx_GIVEREF(__pyx_v_f);
-      __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      goto __pyx_L46;
-    }
-    __pyx_L46:;
-  }
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
-  /* "pysam/cvcf.pyx":736
- * 
- *         # check: format fields are defined
- *         if self._format:             # <<<<<<<<<<<<<<
- *             for f in format:
- *                 if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f)
- */
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  if (__pyx_t_15) {
-
-    /* "pysam/cvcf.pyx":737
- *         # check: format fields are defined
- *         if self._format:
- *             for f in format:             # <<<<<<<<<<<<<<
- *                 if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f)
- * 
- */
-    if (PyList_CheckExact(__pyx_v_format) || PyTuple_CheckExact(__pyx_v_format)) {
-      __pyx_t_11 = __pyx_v_format; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
-      __pyx_t_16 = NULL;
-    } else {
-      __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_format); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_16 = Py_TYPE(__pyx_t_11)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_11)) {
-        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_11)) {
-        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_1 = __pyx_t_16(__pyx_t_11);
-        if (unlikely(!__pyx_t_1)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_1);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1);
-      __pyx_t_1 = 0;
-
-      /* "pysam/cvcf.pyx":738
- *         if self._format:
- *             for f in format:
- *                 if f not in self._format: self.error(line,self.FORMAT_NOT_DEFINED, f)             # <<<<<<<<<<<<<<
- * 
- *         # convert v3.3 alleles
- */
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_15 = (__Pyx_PySequence_Contains(__pyx_v_f, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = (__pyx_t_15 != 0);
-      if (__pyx_t_5) {
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FORMAT_NOT_DEFINED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_v_f);
-        PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_f);
-        __Pyx_GIVEREF(__pyx_v_f);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L50;
-      }
-      __pyx_L50:;
-    }
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    goto __pyx_L47;
-  }
-  __pyx_L47:;
-
-  /* "pysam/cvcf.pyx":741
- * 
- *         # convert v3.3 alleles
- *         if self._version == 33:             # <<<<<<<<<<<<<<
- *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
- *             newalts = []
- */
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_11, __pyx_int_33, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_5) {
-
-    /* "pysam/cvcf.pyx":742
- *         # convert v3.3 alleles
- *         if self._version == 33:
- *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)             # <<<<<<<<<<<<<<
- *             newalts = []
- *             have_deletions = False
- */
-    __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = ((__pyx_t_4 != 1) != 0);
-    if (__pyx_t_5) {
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V33_BAD_REF); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
-      __Pyx_GIVEREF(__pyx_t_11);
-      __pyx_t_11 = 0;
-      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      goto __pyx_L52;
-    }
-    __pyx_L52:;
-
-    /* "pysam/cvcf.pyx":743
- *         if self._version == 33:
- *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
- *             newalts = []             # <<<<<<<<<<<<<<
- *             have_deletions = False
- *             for a in alt:
- */
-    __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_v_newalts = ((PyObject*)__pyx_t_11);
-    __pyx_t_11 = 0;
-
-    /* "pysam/cvcf.pyx":744
- *             if len(ref) != 1: self.error(line,self.V33_BAD_REF)
- *             newalts = []
- *             have_deletions = False             # <<<<<<<<<<<<<<
- *             for a in alt:
- *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
- */
-    __pyx_v_have_deletions = 0;
-
-    /* "pysam/cvcf.pyx":745
- *             newalts = []
- *             have_deletions = False
- *             for a in alt:             # <<<<<<<<<<<<<<
- *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
- *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
- */
-    if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
-      __pyx_t_11 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
-      __pyx_t_16 = NULL;
-    } else {
-      __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_16 = Py_TYPE(__pyx_t_11)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_11)) {
-        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_11)) {
-        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_10 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_10 = __pyx_t_16(__pyx_t_11);
-        if (unlikely(!__pyx_t_10)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_10);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_a, __pyx_t_10);
-      __pyx_t_10 = 0;
-
-      /* "pysam/cvcf.pyx":746
- *             have_deletions = False
- *             for a in alt:
- *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference             # <<<<<<<<<<<<<<
- *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
- *                 elif a.startswith('D'): # allow D<seq> and D<num>
- */
-      __pyx_t_3 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = ((__pyx_t_3 == 1) != 0);
-      if (__pyx_t_5) {
-        __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 1, 0, NULL, NULL, &__pyx_slice__71, 1, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_2 = PyNumber_Add(__pyx_v_a, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_2);
-        __pyx_t_2 = 0;
-        goto __pyx_L55;
-      }
-
-      /* "pysam/cvcf.pyx":747
- *             for a in alt:
- *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
- *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference             # <<<<<<<<<<<<<<
- *                 elif a.startswith('D'): # allow D<seq> and D<num>
- *                     have_deletions = True
- */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      if (__pyx_t_5) {
-        __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ref, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_a, 1, 0, NULL, NULL, &__pyx_slice__73, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_1 = PyNumber_Add(__pyx_t_10, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_1);
-        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 1, 0, NULL, NULL, &__pyx_slice__74, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_10);
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_10);
-        __pyx_t_10 = 0;
-        goto __pyx_L55;
-      }
-
-      /* "pysam/cvcf.pyx":748
- *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
- *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
- *                 elif a.startswith('D'): # allow D<seq> and D<num>             # <<<<<<<<<<<<<<
- *                     have_deletions = True
- *                     try:
- */
-      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s_startswith); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_10);
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (__pyx_t_5) {
-
-        /* "pysam/cvcf.pyx":749
- *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
- *                 elif a.startswith('D'): # allow D<seq> and D<num>
- *                     have_deletions = True             # <<<<<<<<<<<<<<
- *                     try:
- *                         l = int(a[1:])          # throws ValueError if sequence
- */
-        __pyx_v_have_deletions = 1;
-
-        /* "pysam/cvcf.pyx":750
- *                 elif a.startswith('D'): # allow D<seq> and D<num>
- *                     have_deletions = True
- *                     try:             # <<<<<<<<<<<<<<
- *                         l = int(a[1:])          # throws ValueError if sequence
- *                         if len(ref) < l:        # add to reference if necessary
- */
-        {
-          __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
-          __Pyx_XGOTREF(__pyx_t_12);
-          __Pyx_XGOTREF(__pyx_t_13);
-          __Pyx_XGOTREF(__pyx_t_14);
-          /*try:*/ {
-
-            /* "pysam/cvcf.pyx":751
- *                     have_deletions = True
- *                     try:
- *                         l = int(a[1:])          # throws ValueError if sequence             # <<<<<<<<<<<<<<
- *                         if len(ref) < l:        # add to reference if necessary
- *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
- */
-            __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_a, 1, 0, NULL, NULL, &__pyx_slice__76, 1, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-            __Pyx_GOTREF(__pyx_t_2);
-            __pyx_t_10 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-            __Pyx_GOTREF(__pyx_t_10);
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_10);
-            __pyx_t_10 = 0;
-
-            /* "pysam/cvcf.pyx":752
- *                     try:
- *                         l = int(a[1:])          # throws ValueError if sequence
- *                         if len(ref) < l:        # add to reference if necessary             # <<<<<<<<<<<<<<
- *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
- *                             ref += addns
- */
-            __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-            __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-            __Pyx_GOTREF(__pyx_t_10);
-            __pyx_t_2 = PyObject_RichCompare(__pyx_t_10, __pyx_v_l, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-            __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            if (__pyx_t_5) {
-
-              /* "pysam/cvcf.pyx":753
- *                         l = int(a[1:])          # throws ValueError if sequence
- *                         if len(ref) < l:        # add to reference if necessary
- *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)             # <<<<<<<<<<<<<<
- *                             ref += addns
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns
- */
-              __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __Pyx_GOTREF(__pyx_t_2);
-              if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;} }
-              __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __Pyx_GOTREF(__pyx_t_10);
-              __pyx_t_1 = PyNumber_Add(__pyx_v_pos, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __Pyx_GOTREF(__pyx_t_1);
-              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-              if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;} }
-              __pyx_t_10 = PyNumber_Add(__pyx_v_pos, __pyx_v_l); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __Pyx_GOTREF(__pyx_t_10);
-              __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __Pyx_GOTREF(__pyx_t_8);
-              __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __Pyx_GOTREF(__pyx_t_9);
-              __Pyx_INCREF(__pyx_v_chrom);
-              PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_chrom);
-              __Pyx_GIVEREF(__pyx_v_chrom);
-              PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
-              __Pyx_GIVEREF(__pyx_t_1);
-              PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_10);
-              __Pyx_GIVEREF(__pyx_t_10);
-              PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8);
-              __Pyx_GIVEREF(__pyx_t_8);
-              __pyx_t_1 = 0;
-              __pyx_t_10 = 0;
-              __pyx_t_8 = 0;
-              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __Pyx_GOTREF(__pyx_t_8);
-              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-              __Pyx_XDECREF_SET(__pyx_v_addns, __pyx_t_8);
-              __pyx_t_8 = 0;
-
-              /* "pysam/cvcf.pyx":754
- *                         if len(ref) < l:        # add to reference if necessary
- *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
- *                             ref += addns             # <<<<<<<<<<<<<<
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns
- *                         a = ref[l:]             # new deletion, deleting pos...pos+l
- */
-              __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-              __Pyx_GOTREF(__pyx_t_8);
-              __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_8);
-              __pyx_t_8 = 0;
-
-              /* "pysam/cvcf.pyx":755
- *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
- *                             ref += addns
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
- *                         a = ref[l:]             # new deletion, deleting pos...pos+l
- *                     except ValueError:
- */
-              __Pyx_INCREF(__pyx_int_0);
-              __pyx_t_8 = __pyx_int_0;
-              __pyx_t_9 = __pyx_v_newalts; __Pyx_INCREF(__pyx_t_9); __pyx_t_3 = 0;
-              for (;;) {
-                if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_9)) break;
-                #if CYTHON_COMPILING_IN_CPYTHON
-                __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-                #else
-                __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-                #endif
-                __Pyx_XDECREF_SET(__pyx_v_na, __pyx_t_2);
-                __pyx_t_2 = 0;
-                __Pyx_INCREF(__pyx_t_8);
-                __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
-                __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-                __Pyx_GOTREF(__pyx_t_2);
-                __Pyx_DECREF(__pyx_t_8);
-                __pyx_t_8 = __pyx_t_2;
-                __pyx_t_2 = 0;
-                __pyx_t_2 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-                __Pyx_GOTREF(__pyx_t_2);
-                if (unlikely(PyObject_SetItem(__pyx_v_newalts, __pyx_v_i, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-              }
-              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-              goto __pyx_L64;
-            }
-            __pyx_L64:;
-
-            /* "pysam/cvcf.pyx":756
- *                             ref += addns
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns
- *                         a = ref[l:]             # new deletion, deleting pos...pos+l             # <<<<<<<<<<<<<<
- *                     except ValueError:
- *                         s = a[1:]
- */
-            __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 0, 0, &__pyx_v_l, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L56_error;}
-            __Pyx_GOTREF(__pyx_t_8);
-            __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_8);
-            __pyx_t_8 = 0;
-          }
-          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
-          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
-          goto __pyx_L63_try_end;
-          __pyx_L56_error:;
-          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-          /* "pysam/cvcf.pyx":757
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns
- *                         a = ref[l:]             # new deletion, deleting pos...pos+l
- *                     except ValueError:             # <<<<<<<<<<<<<<
- *                         s = a[1:]
- *                         if len(ref) < len(s):   # add Ns to reference if necessary
- */
-          __pyx_t_21 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
-          if (__pyx_t_21) {
-            __Pyx_AddTraceback("pysam.cvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
-            if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-            __Pyx_GOTREF(__pyx_t_8);
-            __Pyx_GOTREF(__pyx_t_9);
-            __Pyx_GOTREF(__pyx_t_2);
-
-            /* "pysam/cvcf.pyx":758
- *                         a = ref[l:]             # new deletion, deleting pos...pos+l
- *                     except ValueError:
- *                         s = a[1:]             # <<<<<<<<<<<<<<
- *                         if len(ref) < len(s):   # add Ns to reference if necessary
- *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
- */
-            __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_a, 1, 0, NULL, NULL, &__pyx_slice__77, 1, 0, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-            __Pyx_GOTREF(__pyx_t_10);
-            __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_10);
-            __pyx_t_10 = 0;
-
-            /* "pysam/cvcf.pyx":759
- *                     except ValueError:
- *                         s = a[1:]
- *                         if len(ref) < len(s):   # add Ns to reference if necessary             # <<<<<<<<<<<<<<
- *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
- *                             if not s.endswith(addns) and addns != 'N'*len(addns):
- */
-            __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-            __pyx_t_22 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-            __pyx_t_5 = ((__pyx_t_3 < __pyx_t_22) != 0);
-            if (__pyx_t_5) {
-
-              /* "pysam/cvcf.pyx":760
- *                         s = a[1:]
- *                         if len(ref) < len(s):   # add Ns to reference if necessary
- *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)             # <<<<<<<<<<<<<<
- *                             if not s.endswith(addns) and addns != 'N'*len(addns):
- *                                 self.error(line,self.V33_UNMATCHED_DELETION,
- */
-              __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_10);
-              if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;} }
-              __pyx_t_22 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_1);
-              __pyx_t_7 = PyNumber_Add(__pyx_v_pos, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_7);
-              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-              if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;} }
-              __pyx_t_22 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_1);
-              __pyx_t_23 = PyNumber_Add(__pyx_v_pos, __pyx_t_1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_23);
-              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_1);
-              __pyx_t_24 = PyTuple_New(4); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_24);
-              __Pyx_INCREF(__pyx_v_chrom);
-              PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_v_chrom);
-              __Pyx_GIVEREF(__pyx_v_chrom);
-              PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_7);
-              __Pyx_GIVEREF(__pyx_t_7);
-              PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_23);
-              __Pyx_GIVEREF(__pyx_t_23);
-              PyTuple_SET_ITEM(__pyx_t_24, 3, __pyx_t_1);
-              __Pyx_GIVEREF(__pyx_t_1);
-              __pyx_t_7 = 0;
-              __pyx_t_23 = 0;
-              __pyx_t_1 = 0;
-              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_24, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_1);
-              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
-              __Pyx_XDECREF_SET(__pyx_v_addns, __pyx_t_1);
-              __pyx_t_1 = 0;
-
-              /* "pysam/cvcf.pyx":761
- *                         if len(ref) < len(s):   # add Ns to reference if necessary
- *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
- *                             if not s.endswith(addns) and addns != 'N'*len(addns):             # <<<<<<<<<<<<<<
- *                                 self.error(line,self.V33_UNMATCHED_DELETION,
- *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
- */
-              __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_1);
-              __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_24);
-              __Pyx_INCREF(__pyx_v_addns);
-              PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_v_addns);
-              __Pyx_GIVEREF(__pyx_v_addns);
-              __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_24, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_10);
-              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
-              __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-              __pyx_t_15 = (!__pyx_t_5);
-              if (__pyx_t_15) {
-                __pyx_t_22 = PyObject_Length(__pyx_v_addns); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_10);
-                __pyx_t_24 = PyNumber_Multiply(__pyx_n_s_N, __pyx_t_10); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_24);
-                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-                __pyx_t_10 = PyObject_RichCompare(__pyx_v_addns, __pyx_t_24, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
-                __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-                __pyx_t_20 = __pyx_t_5;
-              } else {
-                __pyx_t_20 = __pyx_t_15;
-              }
-              if (__pyx_t_20) {
-
-                /* "pysam/cvcf.pyx":762
- *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
- *                             if not s.endswith(addns) and addns != 'N'*len(addns):
- *                                 self.error(line,self.V33_UNMATCHED_DELETION,             # <<<<<<<<<<<<<<
- *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
- *                             ref += addns
- */
-                __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_10);
-                __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V33_UNMATCHED_DELETION); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_24);
-
-                /* "pysam/cvcf.pyx":763
- *                             if not s.endswith(addns) and addns != 'N'*len(addns):
- *                                 self.error(line,self.V33_UNMATCHED_DELETION,
- *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))             # <<<<<<<<<<<<<<
- *                             ref += addns
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns
- */
-                __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_1);
-                if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;} }
-                if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;} }
-                __pyx_t_22 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __pyx_t_23 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_23);
-                __pyx_t_7 = PyNumber_Add(__pyx_v_pos, __pyx_t_23); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_7);
-                __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-                __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_23);
-                __pyx_t_25 = PyTuple_New(4); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_25);
-                __Pyx_INCREF(__pyx_v_chrom);
-                PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_v_chrom);
-                __Pyx_GIVEREF(__pyx_v_chrom);
-                __Pyx_INCREF(__pyx_v_pos);
-                PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_v_pos);
-                __Pyx_GIVEREF(__pyx_v_pos);
-                PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_7);
-                __Pyx_GIVEREF(__pyx_t_7);
-                PyTuple_SET_ITEM(__pyx_t_25, 3, __pyx_t_23);
-                __Pyx_GIVEREF(__pyx_t_23);
-                __pyx_t_7 = 0;
-                __pyx_t_23 = 0;
-                __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_25, NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_23);
-                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-                __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-                __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_25);
-                __Pyx_INCREF(__pyx_v_a);
-                PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_v_a);
-                __Pyx_GIVEREF(__pyx_v_a);
-                PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_23);
-                __Pyx_GIVEREF(__pyx_t_23);
-                __pyx_t_23 = 0;
-                __pyx_t_23 = __Pyx_PyString_Format(__pyx_kp_s_deletion_is_s_reference_is_s, __pyx_t_25); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_23);
-                __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-
-                /* "pysam/cvcf.pyx":762
- *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
- *                             if not s.endswith(addns) and addns != 'N'*len(addns):
- *                                 self.error(line,self.V33_UNMATCHED_DELETION,             # <<<<<<<<<<<<<<
- *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
- *                             ref += addns
- */
-                __pyx_t_25 = PyTuple_New(3); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_25);
-                __Pyx_INCREF(__pyx_v_line);
-                PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_v_line);
-                __Pyx_GIVEREF(__pyx_v_line);
-                PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_24);
-                __Pyx_GIVEREF(__pyx_t_24);
-                PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_23);
-                __Pyx_GIVEREF(__pyx_t_23);
-                __pyx_t_24 = 0;
-                __pyx_t_23 = 0;
-                __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_25, NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_23);
-                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-                __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-                __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-                goto __pyx_L70;
-              }
-              __pyx_L70:;
-
-              /* "pysam/cvcf.pyx":764
- *                                 self.error(line,self.V33_UNMATCHED_DELETION,
- *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
- *                             ref += addns             # <<<<<<<<<<<<<<
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns
- *                         a = ref[len(s):]        # new deletion, deleting from pos
- */
-              __pyx_t_23 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addns); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-              __Pyx_GOTREF(__pyx_t_23);
-              __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_23);
-              __pyx_t_23 = 0;
-
-              /* "pysam/cvcf.pyx":765
- *                                            "(deletion is %s, reference is %s)" % (a,get_sequence(chrom,pos,pos+len(s),self._reference)))
- *                             ref += addns
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns             # <<<<<<<<<<<<<<
- *                         a = ref[len(s):]        # new deletion, deleting from pos
- *                 else:
- */
-              __Pyx_INCREF(__pyx_int_0);
-              __pyx_t_23 = __pyx_int_0;
-              __pyx_t_25 = __pyx_v_newalts; __Pyx_INCREF(__pyx_t_25); __pyx_t_22 = 0;
-              for (;;) {
-                if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_25)) break;
-                #if CYTHON_COMPILING_IN_CPYTHON
-                __pyx_t_10 = PyList_GET_ITEM(__pyx_t_25, __pyx_t_22); __Pyx_INCREF(__pyx_t_10); __pyx_t_22++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                #else
-                __pyx_t_10 = PySequence_ITEM(__pyx_t_25, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                #endif
-                __Pyx_XDECREF_SET(__pyx_v_na, __pyx_t_10);
-                __pyx_t_10 = 0;
-                __Pyx_INCREF(__pyx_t_23);
-                __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_23);
-                __pyx_t_10 = PyNumber_Add(__pyx_t_23, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_10);
-                __Pyx_DECREF(__pyx_t_23);
-                __pyx_t_23 = __pyx_t_10;
-                __pyx_t_10 = 0;
-                __pyx_t_10 = PyNumber_Add(__pyx_v_na, __pyx_v_addns); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_GOTREF(__pyx_t_10);
-                if (unlikely(PyObject_SetItem(__pyx_v_newalts, __pyx_v_i, __pyx_t_10) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-              }
-              __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-              __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-              goto __pyx_L69;
-            }
-            __pyx_L69:;
-
-            /* "pysam/cvcf.pyx":766
- *                             ref += addns
- *                             for i,na in enumerate(newalts): newalts[i] = na+addns
- *                         a = ref[len(s):]        # new deletion, deleting from pos             # <<<<<<<<<<<<<<
- *                 else:
- *                     self.error(line,self.V33_BAD_ALLELE)
- */
-            __pyx_t_22 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-            __pyx_t_23 = __Pyx_PyObject_GetSlice(__pyx_v_ref, __pyx_t_22, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L58_except_error;}
-            __Pyx_GOTREF(__pyx_t_23);
-            __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_23);
-            __pyx_t_23 = 0;
-            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-            goto __pyx_L57_exception_handled;
-          }
-          goto __pyx_L58_except_error;
-          __pyx_L58_except_error:;
-          __Pyx_XGIVEREF(__pyx_t_12);
-          __Pyx_XGIVEREF(__pyx_t_13);
-          __Pyx_XGIVEREF(__pyx_t_14);
-          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
-          goto __pyx_L1_error;
-          __pyx_L57_exception_handled:;
-          __Pyx_XGIVEREF(__pyx_t_12);
-          __Pyx_XGIVEREF(__pyx_t_13);
-          __Pyx_XGIVEREF(__pyx_t_14);
-          __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
-          __pyx_L63_try_end:;
-        }
-        goto __pyx_L55;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":768
- *                         a = ref[len(s):]        # new deletion, deleting from pos
- *                 else:
- *                     self.error(line,self.V33_BAD_ALLELE)             # <<<<<<<<<<<<<<
- *                 newalts.append(a)
- *             alt = newalts
- */
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V33_BAD_ALLELE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9);
-        __Pyx_GIVEREF(__pyx_t_9);
-        __pyx_t_9 = 0;
-        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      }
-      __pyx_L55:;
-
-      /* "pysam/cvcf.pyx":769
- *                 else:
- *                     self.error(line,self.V33_BAD_ALLELE)
- *                 newalts.append(a)             # <<<<<<<<<<<<<<
- *             alt = newalts
- *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
- */
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_newalts, __pyx_v_a); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
-    /* "pysam/cvcf.pyx":770
- *                     self.error(line,self.V33_BAD_ALLELE)
- *                 newalts.append(a)
- *             alt = newalts             # <<<<<<<<<<<<<<
- *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
- *             if have_deletions:
- */
-    __Pyx_INCREF(__pyx_v_newalts);
-    __Pyx_DECREF_SET(__pyx_v_alt, __pyx_v_newalts);
-
-    /* "pysam/cvcf.pyx":772
- *             alt = newalts
- *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
- *             if have_deletions:             # <<<<<<<<<<<<<<
- *                 if pos == 0:
- *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
- */
-    __pyx_t_20 = (__pyx_v_have_deletions != 0);
-    if (__pyx_t_20) {
-
-      /* "pysam/cvcf.pyx":773
- *             # deletion alleles exist, add dummy 1st reference allele, and account for leading base
- *             if have_deletions:
- *                 if pos == 0:             # <<<<<<<<<<<<<<
- *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
- *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
- */
-      if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-      __pyx_t_11 = PyObject_RichCompare(__pyx_v_pos, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      if (__pyx_t_20) {
-
-        /* "pysam/cvcf.pyx":775
- *                 if pos == 0:
- *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
- *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)             # <<<<<<<<<<<<<<
- *                     ref += addn
- *                     alt = [allele+addn for allele in alt]
- */
-        __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_8 = PyNumber_Add(__pyx_v_pos, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_2 = PyNumber_Add(__pyx_v_pos, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_23 = PyTuple_New(4); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __Pyx_INCREF(__pyx_v_chrom);
-        PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_v_chrom);
-        __Pyx_GIVEREF(__pyx_v_chrom);
-        PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_8);
-        __Pyx_GIVEREF(__pyx_t_8);
-        PyTuple_SET_ITEM(__pyx_t_23, 2, __pyx_t_9);
-        __Pyx_GIVEREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_23, 3, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_8 = 0;
-        __pyx_t_9 = 0;
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_23, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __pyx_v_addn = __pyx_t_2;
-        __pyx_t_2 = 0;
-
-        /* "pysam/cvcf.pyx":776
- *                     # Petr Danacek's: we can't have a leading nucleotide at (1-based) position 1
- *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
- *                     ref += addn             # <<<<<<<<<<<<<<
- *                     alt = [allele+addn for allele in alt]
- *                 else:
- */
-        __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_ref, __pyx_v_addn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_2);
-        __pyx_t_2 = 0;
-
-        /* "pysam/cvcf.pyx":777
- *                     addn = get_sequence(chrom,pos+len(ref),pos+len(ref)+1,self._reference)
- *                     ref += addn
- *                     alt = [allele+addn for allele in alt]             # <<<<<<<<<<<<<<
- *                 else:
- *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
- */
-        __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_23 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_23); __pyx_t_4 = 0;
-        for (;;) {
-          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_23)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_11 = PyList_GET_ITEM(__pyx_t_23, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_11 = PySequence_ITEM(__pyx_t_23, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-          __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_11);
-          __pyx_t_11 = 0;
-          __pyx_t_11 = PyNumber_Add(__pyx_v_allele, __pyx_v_addn); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        }
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_2);
-        __pyx_t_2 = 0;
-        goto __pyx_L74;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":779
- *                     alt = [allele+addn for allele in alt]
- *                 else:
- *                     addn = get_sequence(chrom,pos-1,pos,self._reference)             # <<<<<<<<<<<<<<
- *                     ref = addn + ref
- *                     alt = [addn + allele for allele in alt]
- */
-        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_sequence); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        __pyx_t_23 = PyNumber_Subtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_INCREF(__pyx_v_chrom);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_chrom);
-        __Pyx_GIVEREF(__pyx_v_chrom);
-        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_23);
-        __Pyx_GIVEREF(__pyx_t_23);
-        __Pyx_INCREF(__pyx_v_pos);
-        PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_pos);
-        __Pyx_GIVEREF(__pyx_v_pos);
-        PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11);
-        __Pyx_GIVEREF(__pyx_t_11);
-        __pyx_t_23 = 0;
-        __pyx_t_11 = 0;
-        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_v_addn = __pyx_t_11;
-        __pyx_t_11 = 0;
-
-        /* "pysam/cvcf.pyx":780
- *                 else:
- *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
- *                     ref = addn + ref             # <<<<<<<<<<<<<<
- *                     alt = [addn + allele for allele in alt]
- *                     pos -= 1
- */
-        __pyx_t_11 = PyNumber_Add(__pyx_v_addn, __pyx_v_ref); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_11);
-        __pyx_t_11 = 0;
-
-        /* "pysam/cvcf.pyx":781
- *                     addn = get_sequence(chrom,pos-1,pos,self._reference)
- *                     ref = addn + ref
- *                     alt = [addn + allele for allele in alt]             # <<<<<<<<<<<<<<
- *                     pos -= 1
- *         else:
- */
-        __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __pyx_t_9 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_9); __pyx_t_4 = 0;
-        for (;;) {
-          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_9)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-          __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_2);
-          __pyx_t_2 = 0;
-          __pyx_t_2 = PyNumber_Add(__pyx_v_addn, __pyx_v_allele); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        }
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_11);
-        __pyx_t_11 = 0;
-
-        /* "pysam/cvcf.pyx":782
- *                     ref = addn + ref
- *                     alt = [addn + allele for allele in alt]
- *                     pos -= 1             # <<<<<<<<<<<<<<
- *         else:
- *             # format v4.0 -- just check for nucleotides
- */
-        if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        __pyx_t_11 = PyNumber_InPlaceSubtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_11);
-        __pyx_t_11 = 0;
-      }
-      __pyx_L74:;
-      goto __pyx_L73;
-    }
-    __pyx_L73:;
-    goto __pyx_L51;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":785
- *         else:
- *             # format v4.0 -- just check for nucleotides
- *             for allele in alt:             # <<<<<<<<<<<<<<
- *                 if not alleleRegEx.match(allele):
- *                     self.error(line,self.V40_BAD_ALLELE,allele)
- */
-    if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
-      __pyx_t_11 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
-      __pyx_t_16 = NULL;
-    } else {
-      __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_16 = Py_TYPE(__pyx_t_11)->tp_iternext;
-    }
-    for (;;) {
-      if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_11)) {
-        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_11)) {
-        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-      } else {
-        __pyx_t_9 = __pyx_t_16(__pyx_t_11);
-        if (unlikely(!__pyx_t_9)) {
-          PyObject* exc_type = PyErr_Occurred();
-          if (exc_type) {
-            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          }
-          break;
-        }
-        __Pyx_GOTREF(__pyx_t_9);
-      }
-      __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_9);
-      __pyx_t_9 = 0;
-
-      /* "pysam/cvcf.pyx":786
- *             # format v4.0 -- just check for nucleotides
- *             for allele in alt:
- *                 if not alleleRegEx.match(allele):             # <<<<<<<<<<<<<<
- *                     self.error(line,self.V40_BAD_ALLELE,allele)
- * 
- */
-      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_alleleRegEx); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_match); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_v_allele);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_allele);
-      __Pyx_GIVEREF(__pyx_v_allele);
-      __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_23);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_23); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      __pyx_t_15 = ((!__pyx_t_20) != 0);
-      if (__pyx_t_15) {
-
-        /* "pysam/cvcf.pyx":787
- *             for allele in alt:
- *                 if not alleleRegEx.match(allele):
- *                     self.error(line,self.V40_BAD_ALLELE,allele)             # <<<<<<<<<<<<<<
- * 
- *         # check for leading nucleotide in indel calls
- */
-        __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_V40_BAD_ALLELE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
-        __Pyx_GIVEREF(__pyx_t_9);
-        __Pyx_INCREF(__pyx_v_allele);
-        PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_allele);
-        __Pyx_GIVEREF(__pyx_v_allele);
-        __pyx_t_9 = 0;
-        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        goto __pyx_L81;
-      }
-      __pyx_L81:;
-    }
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  }
-  __pyx_L51:;
-
-  /* "pysam/cvcf.pyx":790
- * 
- *         # check for leading nucleotide in indel calls
- *         for allele in alt:             # <<<<<<<<<<<<<<
- *             if len(allele) != len(ref):
- *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
- */
-  if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
-    __pyx_t_11 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
-    __pyx_t_16 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_16 = Py_TYPE(__pyx_t_11)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_11)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_9 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_11)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_9 = __pyx_t_16(__pyx_t_11);
-      if (unlikely(!__pyx_t_9)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_9);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_9);
-    __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":791
- *         # check for leading nucleotide in indel calls
- *         for allele in alt:
- *             if len(allele) != len(ref):             # <<<<<<<<<<<<<<
- *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
- *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
- */
-    __pyx_t_22 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_15 = ((__pyx_t_22 != __pyx_t_3) != 0);
-    if (__pyx_t_15) {
-
-      /* "pysam/cvcf.pyx":792
- *         for allele in alt:
- *             if len(allele) != len(ref):
- *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)             # <<<<<<<<<<<<<<
- *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
- *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)
- */
-      __pyx_t_3 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_15 = ((__pyx_t_3 == 0) != 0);
-      if (__pyx_t_15) {
-        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ZERO_LENGTH_ALLELE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_23 = PyTuple_New(2); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_23, 1, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_23, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L85;
-      }
-      __pyx_L85:;
-
-      /* "pysam/cvcf.pyx":793
- *             if len(allele) != len(ref):
- *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
- *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():             # <<<<<<<<<<<<<<
- *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)
- * 
- */
-      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ref, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_upper); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_23);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      __pyx_t_23 = __Pyx_GetItemInt(__pyx_v_allele, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_23 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_23);
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_23);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_23, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (__pyx_t_15) {
-        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_ref, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_23 = __Pyx_GetItemInt(__pyx_v_allele, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_23 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_23);
-        __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_t_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_upper); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __pyx_t_20 = (__Pyx_PySequence_Contains(__pyx_n_s_N, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_5 = __pyx_t_20;
-      } else {
-        __pyx_t_5 = __pyx_t_15;
-      }
-      if (__pyx_t_5) {
-
-        /* "pysam/cvcf.pyx":794
- *                 if len(allele) == 0: self.error(line,self.ZERO_LENGTH_ALLELE)
- *                 if ref[0].upper() != allele[0].upper() and "N" not in (ref[0]+allele[0]).upper():
- *                     self.error(line,self.MISSING_INDEL_ALLELE_REF_BASE)             # <<<<<<<<<<<<<<
- * 
- *         # trim trailing bases in alleles
- */
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_23);
-        __Pyx_GIVEREF(__pyx_t_23);
-        __pyx_t_23 = 0;
-        __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        goto __pyx_L86;
-      }
-      __pyx_L86:;
-      goto __pyx_L84;
-    }
-    __pyx_L84:;
-  }
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
-  /* "pysam/cvcf.pyx":806
- * 
- *         # left-align alleles, if a reference is available
- *         if self._leftalign and self._reference:             # <<<<<<<<<<<<<<
- *             while left < pos:
- *                 movable = True
- */
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_leftalign_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  if (__pyx_t_5) {
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reference_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_t_20 = __pyx_t_15;
-  } else {
-    __pyx_t_20 = __pyx_t_5;
-  }
-  if (__pyx_t_20) {
-
-    /* "pysam/cvcf.pyx":807
- *         # left-align alleles, if a reference is available
- *         if self._leftalign and self._reference:
- *             while left < pos:             # <<<<<<<<<<<<<<
- *                 movable = True
- *                 for allele in alt:
- */
-    while (1) {
-      if (unlikely(!__pyx_v_left)) { __Pyx_RaiseUnboundLocalError("left"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-      if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-      __pyx_t_11 = PyObject_RichCompare(__pyx_v_left, __pyx_v_pos, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      if (!__pyx_t_20) break;
-
-      /* "pysam/cvcf.pyx":808
- *         if self._leftalign and self._reference:
- *             while left < pos:
- *                 movable = True             # <<<<<<<<<<<<<<
- *                 for allele in alt:
- *                     if len(allele) > len(ref):
- */
-      __pyx_v_movable = 1;
-
-      /* "pysam/cvcf.pyx":809
- *             while left < pos:
- *                 movable = True
- *                 for allele in alt:             # <<<<<<<<<<<<<<
- *                     if len(allele) > len(ref):
- *                         longest, shortest = allele, ref
- */
-      if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
-        __pyx_t_11 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
-        __pyx_t_16 = NULL;
-      } else {
-        __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __pyx_t_16 = Py_TYPE(__pyx_t_11)->tp_iternext;
-      }
-      for (;;) {
-        if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_11)) {
-          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_23 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_23); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_23 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_11)) {
-          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_23 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_23); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_23 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else {
-          __pyx_t_23 = __pyx_t_16(__pyx_t_11);
-          if (unlikely(!__pyx_t_23)) {
-            PyObject* exc_type = PyErr_Occurred();
-            if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            }
-            break;
-          }
-          __Pyx_GOTREF(__pyx_t_23);
-        }
-        __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_23);
-        __pyx_t_23 = 0;
-
-        /* "pysam/cvcf.pyx":810
- *                 movable = True
- *                 for allele in alt:
- *                     if len(allele) > len(ref):             # <<<<<<<<<<<<<<
- *                         longest, shortest = allele, ref
- *                     else:
- */
-        __pyx_t_3 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_22 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_20 = ((__pyx_t_3 > __pyx_t_22) != 0);
-        if (__pyx_t_20) {
-
-          /* "pysam/cvcf.pyx":811
- *                 for allele in alt:
- *                     if len(allele) > len(ref):
- *                         longest, shortest = allele, ref             # <<<<<<<<<<<<<<
- *                     else:
- *                         longest, shortest = ref, allele
- */
-          __pyx_t_23 = __pyx_v_allele;
-          __Pyx_INCREF(__pyx_t_23);
-          __pyx_t_9 = __pyx_v_ref;
-          __Pyx_INCREF(__pyx_t_9);
-          __Pyx_XDECREF_SET(__pyx_v_longest, __pyx_t_23);
-          __pyx_t_23 = 0;
-          __Pyx_XDECREF_SET(__pyx_v_shortest, __pyx_t_9);
-          __pyx_t_9 = 0;
-          goto __pyx_L92;
-        }
-        /*else*/ {
-
-          /* "pysam/cvcf.pyx":813
- *                         longest, shortest = allele, ref
- *                     else:
- *                         longest, shortest = ref, allele             # <<<<<<<<<<<<<<
- *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
- *                         movable = False
- */
-          __pyx_t_9 = __pyx_v_ref;
-          __Pyx_INCREF(__pyx_t_9);
-          __pyx_t_23 = __pyx_v_allele;
-          __Pyx_INCREF(__pyx_t_23);
-          __Pyx_XDECREF_SET(__pyx_v_longest, __pyx_t_9);
-          __pyx_t_9 = 0;
-          __Pyx_XDECREF_SET(__pyx_v_shortest, __pyx_t_23);
-          __pyx_t_23 = 0;
-        }
-        __pyx_L92:;
-
-        /* "pysam/cvcf.pyx":814
- *                     else:
- *                         longest, shortest = ref, allele
- *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():             # <<<<<<<<<<<<<<
- *                         movable = False
- *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
- */
-        __pyx_t_22 = PyObject_Length(__pyx_v_longest); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_3 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_20 = (__pyx_t_22 == __pyx_t_3);
-        if (!__pyx_t_20) {
-          __pyx_t_3 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __pyx_t_23 = __Pyx_PyObject_GetSlice(__pyx_v_longest, 0, __pyx_t_3, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_23);
-          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-          __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_23);
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_shortest, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __pyx_t_9 = PyObject_RichCompare(__pyx_t_23, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __pyx_t_15 = __pyx_t_5;
-        } else {
-          __pyx_t_15 = __pyx_t_20;
-        }
-        if (__pyx_t_15) {
-
-          /* "pysam/cvcf.pyx":815
- *                         longest, shortest = ref, allele
- *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
- *                         movable = False             # <<<<<<<<<<<<<<
- *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
- *                         movable = False
- */
-          __pyx_v_movable = 0;
-          goto __pyx_L93;
-        }
-        __pyx_L93:;
-
-        /* "pysam/cvcf.pyx":816
- *                     if len(longest) == len(shortest) or longest[:len(shortest)].upper() != shortest.upper():
- *                         movable = False
- *                     if longest[-1].upper() != longest[len(shortest)-1].upper():             # <<<<<<<<<<<<<<
- *                         movable = False
- *                 if not movable:
- */
-        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_longest, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_3 = PyObject_Length(__pyx_v_shortest); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_22 = (__pyx_t_3 - 1);
-        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_longest, __pyx_t_22, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_upper); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __pyx_t_23 = PyObject_RichCompare(__pyx_t_9, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_23); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_23); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        if (__pyx_t_15) {
-
-          /* "pysam/cvcf.pyx":817
- *                         movable = False
- *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
- *                         movable = False             # <<<<<<<<<<<<<<
- *                 if not movable:
- *                     break
- */
-          __pyx_v_movable = 0;
-          goto __pyx_L94;
-        }
-        __pyx_L94:;
-      }
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
-      /* "pysam/cvcf.pyx":818
- *                     if longest[-1].upper() != longest[len(shortest)-1].upper():
- *                         movable = False
- *                 if not movable:             # <<<<<<<<<<<<<<
- *                     break
- *                 ref = ref[:-1]
- */
-      __pyx_t_15 = ((!(__pyx_v_movable != 0)) != 0);
-      if (__pyx_t_15) {
-
-        /* "pysam/cvcf.pyx":819
- *                         movable = False
- *                 if not movable:
- *                     break             # <<<<<<<<<<<<<<
- *                 ref = ref[:-1]
- *                 alt = [allele[:-1] for allele in alt]
- */
-        goto __pyx_L89_break;
-      }
-
-      /* "pysam/cvcf.pyx":820
- *                 if not movable:
- *                     break
- *                 ref = ref[:-1]             # <<<<<<<<<<<<<<
- *                 alt = [allele[:-1] for allele in alt]
- *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
- */
-      __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 0, -1, NULL, NULL, &__pyx_slice__78, 0, 1, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_11);
-      __pyx_t_11 = 0;
-
-      /* "pysam/cvcf.pyx":821
- *                     break
- *                 ref = ref[:-1]
- *                 alt = [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
- *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
- *                     ref = faref_leftflank[pos-left-1] + ref
- */
-      __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      if (PyList_CheckExact(__pyx_v_alt) || PyTuple_CheckExact(__pyx_v_alt)) {
-        __pyx_t_23 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_23); __pyx_t_4 = 0;
-        __pyx_t_16 = NULL;
-      } else {
-        __pyx_t_4 = -1; __pyx_t_23 = PyObject_GetIter(__pyx_v_alt); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __pyx_t_16 = Py_TYPE(__pyx_t_23)->tp_iternext;
-      }
-      for (;;) {
-        if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_23)) {
-          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_23)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_23, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_2 = PySequence_ITEM(__pyx_t_23, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_23)) {
-          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_23)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_23, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_2 = PySequence_ITEM(__pyx_t_23, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-        } else {
-          __pyx_t_2 = __pyx_t_16(__pyx_t_23);
-          if (unlikely(!__pyx_t_2)) {
-            PyObject* exc_type = PyErr_Occurred();
-            if (exc_type) {
-              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            }
-            break;
-          }
-          __Pyx_GOTREF(__pyx_t_2);
-        }
-        __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_allele, 0, -1, NULL, NULL, &__pyx_slice__79, 0, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      }
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_11);
-      __pyx_t_11 = 0;
-
-      /* "pysam/cvcf.pyx":822
- *                 ref = ref[:-1]
- *                 alt = [allele[:-1] for allele in alt]
- *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:             # <<<<<<<<<<<<<<
- *                     ref = faref_leftflank[pos-left-1] + ref
- *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
- */
-      __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_23 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_23); __pyx_t_4 = 0;
-      for (;;) {
-        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_23)) break;
-        #if CYTHON_COMPILING_IN_CPYTHON
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_23, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_23, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        #endif
-        __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_2);
-        __pyx_t_2 = 0;
-        __pyx_t_22 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_22); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      }
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      __pyx_t_23 = PyTuple_New(1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_23);
-      PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_11);
-      __Pyx_GIVEREF(__pyx_t_11);
-      __pyx_t_11 = 0;
-      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_23, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      __pyx_t_23 = PyObject_RichCompare(__pyx_t_11, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_23); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_23); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      if (!__pyx_t_15) {
-        __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_20 = (__pyx_t_4 == 0);
-        __pyx_t_5 = __pyx_t_20;
-      } else {
-        __pyx_t_5 = __pyx_t_15;
-      }
-      if (__pyx_t_5) {
-
-        /* "pysam/cvcf.pyx":823
- *                 alt = [allele[:-1] for allele in alt]
- *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
- *                     ref = faref_leftflank[pos-left-1] + ref             # <<<<<<<<<<<<<<
- *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
- *                     pos -= 1
- */
-        if (unlikely(!__pyx_v_faref_leftflank)) { __Pyx_RaiseUnboundLocalError("faref_leftflank"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        if (unlikely(!__pyx_v_left)) { __Pyx_RaiseUnboundLocalError("left"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        __pyx_t_23 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_23);
-        __pyx_t_11 = PyNumber_Subtract(__pyx_t_23, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __pyx_t_23 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_11); if (unlikely(__pyx_t_23 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_23);
-        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-        __pyx_t_11 = PyNumber_Add(__pyx_t_23, __pyx_v_ref); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __Pyx_DECREF_SET(__pyx_v_ref, __pyx_t_11);
-        __pyx_t_11 = 0;
-
-        /* "pysam/cvcf.pyx":824
- *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
- *                     ref = faref_leftflank[pos-left-1] + ref
- *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]             # <<<<<<<<<<<<<<
- *                     pos -= 1
- * 
- */
-        __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __pyx_t_23 = __pyx_v_alt; __Pyx_INCREF(__pyx_t_23); __pyx_t_4 = 0;
-        for (;;) {
-          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_23)) break;
-          #if CYTHON_COMPILING_IN_CPYTHON
-          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_23, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #else
-          __pyx_t_2 = PySequence_ITEM(__pyx_t_23, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          #endif
-          __Pyx_XDECREF_SET(__pyx_v_allele, __pyx_t_2);
-          __pyx_t_2 = 0;
-          if (unlikely(!__pyx_v_faref_leftflank)) { __Pyx_RaiseUnboundLocalError("faref_leftflank"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-          if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-          if (unlikely(!__pyx_v_left)) { __Pyx_RaiseUnboundLocalError("left"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-          __pyx_t_2 = PyNumber_Subtract(__pyx_v_pos, __pyx_v_left); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __pyx_t_2 = PyObject_GetItem(__pyx_v_faref_leftflank, __pyx_t_9); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_2);
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_v_allele); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          if (unlikely(__Pyx_ListComp_Append(__pyx_t_11, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        }
-        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-        __Pyx_DECREF_SET(__pyx_v_alt, __pyx_t_11);
-        __pyx_t_11 = 0;
-
-        /* "pysam/cvcf.pyx":825
- *                     ref = faref_leftflank[pos-left-1] + ref
- *                     alt = [faref_leftflank[pos-left-1] + allele for allele in alt]
- *                     pos -= 1             # <<<<<<<<<<<<<<
- * 
- *         # parse sample columns
- */
-        if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-        __pyx_t_11 = PyNumber_InPlaceSubtract(__pyx_v_pos, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_11);
-        __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_11);
-        __pyx_t_11 = 0;
-        goto __pyx_L98;
-      }
-      __pyx_L98:;
-    }
-    __pyx_L89_break:;
-    goto __pyx_L87;
-  }
-  __pyx_L87:;
-
-  /* "pysam/cvcf.pyx":828
- * 
- *         # parse sample columns
- *         samples = []             # <<<<<<<<<<<<<<
- *         for sample in cols[9:]:
- *             dict = {}
- */
-  __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  __pyx_v_samples = ((PyObject*)__pyx_t_11);
-  __pyx_t_11 = 0;
-
-  /* "pysam/cvcf.pyx":829
- *         # parse sample columns
- *         samples = []
- *         for sample in cols[9:]:             # <<<<<<<<<<<<<<
- *             dict = {}
- *             values = sample.split(':')
- */
-  __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_v_cols, 9, 0, NULL, NULL, &__pyx_slice__80, 1, 0, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  if (PyList_CheckExact(__pyx_t_11) || PyTuple_CheckExact(__pyx_t_11)) {
-    __pyx_t_23 = __pyx_t_11; __Pyx_INCREF(__pyx_t_23); __pyx_t_4 = 0;
-    __pyx_t_16 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_23 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_23);
-    __pyx_t_16 = Py_TYPE(__pyx_t_23)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  for (;;) {
-    if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_23)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_23)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_11 = PyList_GET_ITEM(__pyx_t_23, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_11 = PySequence_ITEM(__pyx_t_23, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_23)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_23)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_23, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_11 = PySequence_ITEM(__pyx_t_23, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_11 = __pyx_t_16(__pyx_t_23);
-      if (unlikely(!__pyx_t_11)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_11);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_sample, __pyx_t_11);
-    __pyx_t_11 = 0;
-
-    /* "pysam/cvcf.pyx":830
- *         samples = []
- *         for sample in cols[9:]:
- *             dict = {}             # <<<<<<<<<<<<<<
- *             values = sample.split(':')
- *             if len(values) > len(format):
- */
-    __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __Pyx_XDECREF_SET(__pyx_v_dict, ((PyObject*)__pyx_t_11));
-    __pyx_t_11 = 0;
-
-    /* "pysam/cvcf.pyx":831
- *         for sample in cols[9:]:
- *             dict = {}
- *             values = sample.split(':')             # <<<<<<<<<<<<<<
- *             if len(values) > len(format):
- *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
- */
-    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_split); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_11);
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_9);
-    __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":832
- *             dict = {}
- *             values = sample.split(':')
- *             if len(values) > len(format):             # <<<<<<<<<<<<<<
- *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
- *             for idx in range(len(format)):
- */
-    __pyx_t_22 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_5 = ((__pyx_t_22 > __pyx_t_3) != 0);
-    if (__pyx_t_5) {
-
-      /* "pysam/cvcf.pyx":833
- *             values = sample.split(':')
- *             if len(values) > len(format):
- *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))             # <<<<<<<<<<<<<<
- *             for idx in range(len(format)):
- *                 expected = self.get_expected(format[idx], self._format, alt)
- */
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BAD_NUMBER_OF_VALUES); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_3 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_3 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_25 = PyTuple_New(3); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_25);
-      PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_sample);
-      PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_v_sample);
-      __Pyx_GIVEREF(__pyx_v_sample);
-      PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_2 = 0;
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_found_s_values_in_element_s_exp, __pyx_t_25); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-      __pyx_t_25 = PyTuple_New(3); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_25);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_11);
-      __Pyx_GIVEREF(__pyx_t_11);
-      PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_11 = 0;
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_25, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L105;
-    }
-    __pyx_L105:;
-
-    /* "pysam/cvcf.pyx":834
- *             if len(values) > len(format):
- *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
- *             for idx in range(len(format)):             # <<<<<<<<<<<<<<
- *                 expected = self.get_expected(format[idx], self._format, alt)
- *                 if idx < len(values): value = values[idx]
- */
-    __pyx_t_3 = PyObject_Length(__pyx_v_format); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_3; __pyx_t_22+=1) {
-      __pyx_v_idx = __pyx_t_22;
-
-      /* "pysam/cvcf.pyx":835
- *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
- *             for idx in range(len(format)):
- *                 expected = self.get_expected(format[idx], self._format, alt)             # <<<<<<<<<<<<<<
- *                 if idx < len(values): value = values[idx]
- *                 else:
- */
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_get_expected); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_25 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_25 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_25);
-      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_25);
-      __Pyx_GIVEREF(__pyx_t_25);
-      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_v_alt);
-      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_alt);
-      __Pyx_GIVEREF(__pyx_v_alt);
-      __pyx_t_25 = 0;
-      __pyx_t_9 = 0;
-      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_expected, __pyx_t_9);
-      __pyx_t_9 = 0;
-
-      /* "pysam/cvcf.pyx":836
- *             for idx in range(len(format)):
- *                 expected = self.get_expected(format[idx], self._format, alt)
- *                 if idx < len(values): value = values[idx]             # <<<<<<<<<<<<<<
- *                 else:
- *                     if expected == -1: value = "."
- */
-      __pyx_t_26 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = ((__pyx_v_idx < __pyx_t_26) != 0);
-      if (__pyx_t_5) {
-        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_values, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_9);
-        __pyx_t_9 = 0;
-        goto __pyx_L108;
-      }
-      /*else*/ {
-
-        /* "pysam/cvcf.pyx":838
- *                 if idx < len(values): value = values[idx]
- *                 else:
- *                     if expected == -1: value = "."             # <<<<<<<<<<<<<<
- *                     else: value = ",".join(["."]*expected)
- * 
- */
-        __pyx_t_9 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        if (__pyx_t_5) {
-          __Pyx_INCREF(__pyx_kp_s__8);
-          __Pyx_XDECREF_SET(__pyx_v_value, __pyx_kp_s__8);
-          goto __pyx_L109;
-        }
-        /*else*/ {
-
-          /* "pysam/cvcf.pyx":839
- *                 else:
- *                     if expected == -1: value = "."
- *                     else: value = ",".join(["."]*expected)             # <<<<<<<<<<<<<<
- * 
- *                 dict[format[idx]] = self.parse_formatdata(format[idx],
- */
-          __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_9);
-          __Pyx_INCREF(__pyx_kp_s__8);
-          PyList_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s__8);
-          __Pyx_GIVEREF(__pyx_kp_s__8);
-          { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_9, __pyx_v_expected); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __Pyx_GOTREF(__pyx_temp);
-            __Pyx_DECREF(__pyx_t_9);
-            __pyx_t_9 = __pyx_temp;
-          }
-          __pyx_t_11 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_11);
-          __pyx_t_11 = 0;
-        }
-        __pyx_L109:;
-      }
-      __pyx_L108:;
-
-      /* "pysam/cvcf.pyx":841
- *                     else: value = ",".join(["."]*expected)
- * 
- *                 dict[format[idx]] = self.parse_formatdata(format[idx],             # <<<<<<<<<<<<<<
- *                                                           value,
- *                                                           self._format,
- */
-      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_formatdata); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_9);
-
-      /* "pysam/cvcf.pyx":843
- *                 dict[format[idx]] = self.parse_formatdata(format[idx],
- *                                                           value,
- *                                                           self._format,             # <<<<<<<<<<<<<<
- *                                                           line)
- *                 if expected != -1 and len(dict[format[idx]]) != expected:
- */
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-
-      /* "pysam/cvcf.pyx":841
- *                     else: value = ",".join(["."]*expected)
- * 
- *                 dict[format[idx]] = self.parse_formatdata(format[idx],             # <<<<<<<<<<<<<<
- *                                                           value,
- *                                                           self._format,
- */
-      __pyx_t_25 = PyTuple_New(4); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_25);
-      PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_9);
-      __Pyx_GIVEREF(__pyx_t_9);
-      __Pyx_INCREF(__pyx_v_value);
-      PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_v_value);
-      __Pyx_GIVEREF(__pyx_v_value);
-      PyTuple_SET_ITEM(__pyx_t_25, 2, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __Pyx_INCREF(__pyx_v_line);
-      PyTuple_SET_ITEM(__pyx_t_25, 3, __pyx_v_line);
-      __Pyx_GIVEREF(__pyx_v_line);
-      __pyx_t_9 = 0;
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_25, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-      __pyx_t_25 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_25 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-      __Pyx_GOTREF(__pyx_t_25);
-      if (unlikely(PyDict_SetItem(__pyx_v_dict, __pyx_t_25, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-      /* "pysam/cvcf.pyx":845
- *                                                           self._format,
- *                                                           line)
- *                 if expected != -1 and len(dict[format[idx]]) != expected:             # <<<<<<<<<<<<<<
- *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
- */
-      __pyx_t_8 = PyObject_RichCompare(__pyx_v_expected, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      if (__pyx_t_5) {
-        __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_25 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_8); if (unlikely(__pyx_t_25 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_25);
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_26 = PyObject_Length(__pyx_t_25); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-        __pyx_t_25 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_25);
-        __pyx_t_8 = PyObject_RichCompare(__pyx_t_25, __pyx_v_expected, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-        __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_20 = __pyx_t_15;
-      } else {
-        __pyx_t_20 = __pyx_t_5;
-      }
-      if (__pyx_t_20) {
-
-        /* "pysam/cvcf.pyx":846
- *                                                           line)
- *                 if expected != -1 and len(dict[format[idx]]) != expected:
- *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,             # <<<<<<<<<<<<<<
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
- *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
- */
-        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_error); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_25 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_BAD_NUMBER_OF_PARAMETERS); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_25);
-
-        /* "pysam/cvcf.pyx":847
- *                 if expected != -1 and len(dict[format[idx]]) != expected:
- *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))             # <<<<<<<<<<<<<<
- *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
- *                     dict[format[idx]] = dict[format[idx]][:expected]
- */
-        __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_11);
-        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_9); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11);
-        __Pyx_GIVEREF(__pyx_t_11);
-        __Pyx_INCREF(__pyx_v_expected);
-        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_expected);
-        __Pyx_GIVEREF(__pyx_v_expected);
-        PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_11 = 0;
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_id_s_expected_s_parameters_got_s, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-        /* "pysam/cvcf.pyx":846
- *                                                           line)
- *                 if expected != -1 and len(dict[format[idx]]) != expected:
- *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,             # <<<<<<<<<<<<<<
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
- *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
- */
-        __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_INCREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_line);
-        __Pyx_GIVEREF(__pyx_v_line);
-        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_25);
-        __Pyx_GIVEREF(__pyx_t_25);
-        PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_2);
-        __Pyx_GIVEREF(__pyx_t_2);
-        __pyx_t_25 = 0;
-        __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-        /* "pysam/cvcf.pyx":848
- *                     self.error(line,self.BAD_NUMBER_OF_PARAMETERS,
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
- *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))             # <<<<<<<<<<<<<<
- *                     dict[format[idx]] = dict[format[idx]][:expected]
- *             samples.append( dict )
- */
-        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_2); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_9);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_26 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, __pyx_v_expected, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-        __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        if (__pyx_t_20) {
-          __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_2); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_9);
-          __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_8);
-          __pyx_t_25 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_8); if (unlikely(__pyx_t_25 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_25);
-          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_25, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_8);
-          __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-          __pyx_t_25 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_25 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_25);
-          __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_25); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-          __Pyx_GOTREF(__pyx_t_11);
-          __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-          __pyx_t_26 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          __pyx_t_25 = PyNumber_Subtract(__pyx_v_expected, __pyx_t_11); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_25);
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          __pyx_t_11 = PyList_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_11);
-          PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
-          __Pyx_GIVEREF(__pyx_t_8);
-          { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_11, __pyx_t_25); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-            __Pyx_GOTREF(__pyx_temp);
-            __Pyx_DECREF(__pyx_t_11);
-            __pyx_t_11 = __pyx_temp;
-          }
-          __pyx_t_8 = 0;
-          __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-          __pyx_t_25 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_t_11); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_GOTREF(__pyx_t_25);
-          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-          if (unlikely(PyDict_SetItem(__pyx_v_dict, __pyx_t_2, __pyx_t_25) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-          __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          goto __pyx_L111;
-        }
-        __pyx_L111:;
-
-        /* "pysam/cvcf.pyx":849
- *                                "id=%s, expected %s parameters, got %s" % (format[idx],expected,dict[format[idx]]))
- *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
- *                     dict[format[idx]] = dict[format[idx]][:expected]             # <<<<<<<<<<<<<<
- *             samples.append( dict )
- * 
- */
-        __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_25 = __Pyx_PyDict_GetItem(__pyx_v_dict, __pyx_t_2); if (unlikely(__pyx_t_25 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_25);
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_25, 0, 0, NULL, &__pyx_v_expected, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_GOTREF(__pyx_t_2);
-        __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-        __pyx_t_25 = __Pyx_GetItemInt(__pyx_v_format, __pyx_v_idx, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_25 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_25);
-        if (unlikely(PyDict_SetItem(__pyx_v_dict, __pyx_t_25, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        goto __pyx_L110;
-      }
-      __pyx_L110:;
-    }
-
-    /* "pysam/cvcf.pyx":850
- *                     if len(dict[format[idx]] ) < expected: dict[format[idx]] += [dict[format[idx]][-1]]*(expected-len(dict[format[idx]]))
- *                     dict[format[idx]] = dict[format[idx]][:expected]
- *             samples.append( dict )             # <<<<<<<<<<<<<<
- * 
- *         # done
- */
-    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_samples, __pyx_v_dict); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-
-  /* "pysam/cvcf.pyx":853
- * 
- *         # done
- *         d = {'chrom':chrom,             # <<<<<<<<<<<<<<
- *              'pos':pos,      # return 0-based position
- *              'id':id,
- */
-  __pyx_t_23 = PyDict_New(); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_23);
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_chrom, __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":854
- *         # done
- *         d = {'chrom':chrom,
- *              'pos':pos,      # return 0-based position             # <<<<<<<<<<<<<<
- *              'id':id,
- *              'ref':ref,
- */
-  if (unlikely(!__pyx_v_pos)) { __Pyx_RaiseUnboundLocalError("pos"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_pos, __pyx_v_pos) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":855
- *         d = {'chrom':chrom,
- *              'pos':pos,      # return 0-based position
- *              'id':id,             # <<<<<<<<<<<<<<
- *              'ref':ref,
- *              'alt':alt,
- */
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_id, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":856
- *              'pos':pos,      # return 0-based position
- *              'id':id,
- *              'ref':ref,             # <<<<<<<<<<<<<<
- *              'alt':alt,
- *              'qual':qual,
- */
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_ref, __pyx_v_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":857
- *              'id':id,
- *              'ref':ref,
- *              'alt':alt,             # <<<<<<<<<<<<<<
- *              'qual':qual,
- *              'filter':filter,
- */
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_alt, __pyx_v_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":858
- *              'ref':ref,
- *              'alt':alt,
- *              'qual':qual,             # <<<<<<<<<<<<<<
- *              'filter':filter,
- *              'info':info,
- */
-  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_qual); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_qual, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":859
- *              'alt':alt,
- *              'qual':qual,
- *              'filter':filter,             # <<<<<<<<<<<<<<
- *              'info':info,
- *              'format':format}
- */
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_filter_2, __pyx_v_filter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":860
- *              'qual':qual,
- *              'filter':filter,
- *              'info':info,             # <<<<<<<<<<<<<<
- *              'format':format}
- *         for key,value in zip(self._samples,samples):
- */
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_info_2, __pyx_v_info) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":861
- *              'filter':filter,
- *              'info':info,
- *              'format':format}             # <<<<<<<<<<<<<<
- *         for key,value in zip(self._samples,samples):
- *             d[key] = value
- */
-  if (PyDict_SetItem(__pyx_t_23, __pyx_n_s_format, __pyx_v_format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_v_d = ((PyObject*)__pyx_t_23);
-  __pyx_t_23 = 0;
-
-  /* "pysam/cvcf.pyx":862
- *              'info':info,
- *              'format':format}
- *         for key,value in zip(self._samples,samples):             # <<<<<<<<<<<<<<
- *             d[key] = value
- * 
- */
-  __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_23);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_23);
-  __Pyx_GIVEREF(__pyx_t_23);
-  __Pyx_INCREF(__pyx_v_samples);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_samples);
-  __Pyx_GIVEREF(__pyx_v_samples);
-  __pyx_t_23 = 0;
-  __pyx_t_23 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_23);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyList_CheckExact(__pyx_t_23) || PyTuple_CheckExact(__pyx_t_23)) {
-    __pyx_t_2 = __pyx_t_23; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
-    __pyx_t_16 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_16 = Py_TYPE(__pyx_t_2)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-  for (;;) {
-    if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_23 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_23); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_23 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_2)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_23 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_23); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_23 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_23 = __pyx_t_16(__pyx_t_2);
-      if (unlikely(!__pyx_t_23)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_23);
-    }
-    if ((likely(PyTuple_CheckExact(__pyx_t_23))) || (PyList_CheckExact(__pyx_t_23))) {
-      PyObject* sequence = __pyx_t_23;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      Py_ssize_t size = Py_SIZE(sequence);
-      #else
-      Py_ssize_t size = PySequence_Size(sequence);
-      #endif
-      if (unlikely(size != 2)) {
-        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
-        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      }
-      #if CYTHON_COMPILING_IN_CPYTHON
-      if (likely(PyTuple_CheckExact(sequence))) {
-        __pyx_t_25 = PyTuple_GET_ITEM(sequence, 0); 
-        __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
-      } else {
-        __pyx_t_25 = PyList_GET_ITEM(sequence, 0); 
-        __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
-      }
-      __Pyx_INCREF(__pyx_t_25);
-      __Pyx_INCREF(__pyx_t_11);
-      #else
-      __pyx_t_25 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_25);
-      __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_11);
-      #endif
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-    } else {
-      Py_ssize_t index = -1;
-      __pyx_t_9 = PyObject_GetIter(__pyx_t_23); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
-      __pyx_t_27 = Py_TYPE(__pyx_t_9)->tp_iternext;
-      index = 0; __pyx_t_25 = __pyx_t_27(__pyx_t_9); if (unlikely(!__pyx_t_25)) goto __pyx_L114_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_25);
-      index = 1; __pyx_t_11 = __pyx_t_27(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L114_unpacking_failed;
-      __Pyx_GOTREF(__pyx_t_11);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_27(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_27 = NULL;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      goto __pyx_L115_unpacking_done;
-      __pyx_L114_unpacking_failed:;
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __pyx_t_27 = NULL;
-      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_L115_unpacking_done:;
-    }
-    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_25);
-    __pyx_t_25 = 0;
-    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_11);
-    __pyx_t_11 = 0;
-
-    /* "pysam/cvcf.pyx":863
- *              'format':format}
- *         for key,value in zip(self._samples,samples):
- *             d[key] = value             # <<<<<<<<<<<<<<
- * 
- *         return d
- */
-    if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":865
- *             d[key] = value
- * 
- *         return d             # <<<<<<<<<<<<<<
- * 
- * 
- */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(__pyx_v_d);
-  __pyx_r = __pyx_v_d;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":656
- *         return False
- * 
- *     def parse_data( self, line, lineparse=False ):             # <<<<<<<<<<<<<<
- *         cols = line.split('\t')
- *         if len(cols) != len(self._samples)+9:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_7);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_XDECREF(__pyx_t_23);
-  __Pyx_XDECREF(__pyx_t_24);
-  __Pyx_XDECREF(__pyx_t_25);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_cols);
-  __Pyx_XDECREF(__pyx_v_chrom);
-  __Pyx_XDECREF(__pyx_v_pos);
-  __Pyx_XDECREF(__pyx_v_id);
-  __Pyx_XDECREF(__pyx_v_ref);
-  __Pyx_XDECREF(__pyx_v_c);
-  __Pyx_XDECREF(__pyx_v_left);
-  __Pyx_XDECREF(__pyx_v_faref_leftflank);
-  __Pyx_XDECREF(__pyx_v_faref);
-  __Pyx_XDECREF(__pyx_v_alt);
-  __Pyx_XDECREF(__pyx_v_filter);
-  __Pyx_XDECREF(__pyx_v_info);
-  __Pyx_XDECREF(__pyx_v_blurp);
-  __Pyx_XDECREF(__pyx_v_elts);
-  __Pyx_XDECREF(__pyx_v_v);
-  __Pyx_XDECREF(__pyx_v_format);
-  __Pyx_XDECREF(__pyx_v_f);
-  __Pyx_XDECREF(__pyx_v_newalts);
-  __Pyx_XDECREF(__pyx_v_a);
-  __Pyx_XDECREF(__pyx_v_l);
-  __Pyx_XDECREF(__pyx_v_addns);
-  __Pyx_XDECREF(__pyx_v_i);
-  __Pyx_XDECREF(__pyx_v_na);
-  __Pyx_XDECREF(__pyx_v_s);
-  __Pyx_XDECREF(__pyx_v_addn);
-  __Pyx_XDECREF(__pyx_v_allele);
-  __Pyx_XDECREF(__pyx_v_longest);
-  __Pyx_XDECREF(__pyx_v_shortest);
-  __Pyx_XDECREF(__pyx_v_samples);
-  __Pyx_XDECREF(__pyx_v_sample);
-  __Pyx_XDECREF(__pyx_v_dict);
-  __Pyx_XDECREF(__pyx_v_values);
-  __Pyx_XDECREF(__pyx_v_expected);
-  __Pyx_XDECREF(__pyx_v_value);
-  __Pyx_XDECREF(__pyx_v_d);
-  __Pyx_XDECREF(__pyx_v_key);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":868
- * 
- * 
- *     def write_data(self, stream, data):             # <<<<<<<<<<<<<<
- *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
- *         for k in required:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_35write_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_35write_data = {__Pyx_NAMESTR("write_data"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_35write_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_35write_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_stream = 0;
-  PyObject *__pyx_v_data = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("write_data (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,&__pyx_n_s_data,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __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_self = values[0];
-    __pyx_v_stream = values[1];
-    __pyx_v_data = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write_data", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.write_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_34write_data(__pyx_self, __pyx_v_self, __pyx_v_stream, __pyx_v_data);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_34write_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_data) {
-  PyObject *__pyx_v_required = NULL;
-  PyObject *__pyx_v_k = NULL;
-  PyObject *__pyx_v_alt = NULL;
-  PyObject *__pyx_v_filter = NULL;
-  PyObject *__pyx_v_qual = NULL;
-  PyObject *__pyx_v_output = NULL;
-  PyObject *__pyx_v_s = 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)(PyObject *);
-  int __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
-  PyObject *__pyx_t_11 = NULL;
-  PyObject *__pyx_t_12 = NULL;
-  PyObject *__pyx_t_13 = NULL;
-  int __pyx_t_14;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("write_data", 0);
-
-  /* "pysam/cvcf.pyx":869
- * 
- *     def write_data(self, stream, data):
- *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples             # <<<<<<<<<<<<<<
- *         for k in required:
- *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
- */
-  __pyx_t_1 = PyList_New(9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_n_s_chrom);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_chrom);
-  __Pyx_GIVEREF(__pyx_n_s_chrom);
-  __Pyx_INCREF(__pyx_n_s_pos);
-  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_pos);
-  __Pyx_GIVEREF(__pyx_n_s_pos);
-  __Pyx_INCREF(__pyx_n_s_id);
-  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_id);
-  __Pyx_GIVEREF(__pyx_n_s_id);
-  __Pyx_INCREF(__pyx_n_s_ref);
-  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_ref);
-  __Pyx_GIVEREF(__pyx_n_s_ref);
-  __Pyx_INCREF(__pyx_n_s_alt);
-  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_alt);
-  __Pyx_GIVEREF(__pyx_n_s_alt);
-  __Pyx_INCREF(__pyx_n_s_qual);
-  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_qual);
-  __Pyx_GIVEREF(__pyx_n_s_qual);
-  __Pyx_INCREF(__pyx_n_s_filter_2);
-  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_filter_2);
-  __Pyx_GIVEREF(__pyx_n_s_filter_2);
-  __Pyx_INCREF(__pyx_n_s_info_2);
-  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_info_2);
-  __Pyx_GIVEREF(__pyx_n_s_info_2);
-  __Pyx_INCREF(__pyx_n_s_format);
-  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_format);
-  __Pyx_GIVEREF(__pyx_n_s_format);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_required = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":870
- *     def write_data(self, stream, data):
- *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
- *         for k in required:             # <<<<<<<<<<<<<<
- *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
- *         if data['alt'] == []: alt = "."
- */
-  if (PyList_CheckExact(__pyx_v_required) || PyTuple_CheckExact(__pyx_v_required)) {
-    __pyx_t_3 = __pyx_v_required; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_required); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
-      if (unlikely(!__pyx_t_2)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_2);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":871
- *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
- *         for k in required:
- *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))             # <<<<<<<<<<<<<<
- *         if data['alt'] == []: alt = "."
- *         else: alt = ",".join(data['alt'])
- */
-    __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_v_k, __pyx_v_data, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_7 = (__pyx_t_6 != 0);
-    if (__pyx_t_7) {
-      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_INCREF(__pyx_v_k);
-      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k);
-      __Pyx_GIVEREF(__pyx_v_k);
-      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Required_key_s_not_found_in_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __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 = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
-      __Pyx_GIVEREF(__pyx_t_2);
-      __pyx_t_2 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":872
- *         for k in required:
- *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
- *         if data['alt'] == []: alt = "."             # <<<<<<<<<<<<<<
- *         else: alt = ",".join(data['alt'])
- *         if data['filter'] == None: filter = "."
- */
-  __pyx_t_3 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_alt); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_7) {
-    __Pyx_INCREF(__pyx_kp_s__8);
-    __pyx_v_alt = __pyx_kp_s__8;
-    goto __pyx_L6;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":873
- *             if k not in data: raise ValueError("Required key %s not found in data" % str(k))
- *         if data['alt'] == []: alt = "."
- *         else: alt = ",".join(data['alt'])             # <<<<<<<<<<<<<<
- *         if data['filter'] == None: filter = "."
- *         elif data['filter'] == []:
- */
-    __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_alt); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_v_alt = __pyx_t_2;
-    __pyx_t_2 = 0;
-  }
-  __pyx_L6:;
-
-  /* "pysam/cvcf.pyx":874
- *         if data['alt'] == []: alt = "."
- *         else: alt = ",".join(data['alt'])
- *         if data['filter'] == None: filter = "."             # <<<<<<<<<<<<<<
- *         elif data['filter'] == []:
- *             if self._version == 33: filter = "0"
- */
-  __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_filter_2); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_7) {
-    __Pyx_INCREF(__pyx_kp_s__8);
-    __pyx_v_filter = __pyx_kp_s__8;
-    goto __pyx_L7;
-  }
-
-  /* "pysam/cvcf.pyx":875
- *         else: alt = ",".join(data['alt'])
- *         if data['filter'] == None: filter = "."
- *         elif data['filter'] == []:             # <<<<<<<<<<<<<<
- *             if self._version == 33: filter = "0"
- *             else: filter = "PASS"
- */
-  __pyx_t_1 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_filter_2); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __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 = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__pyx_t_7) {
-
-    /* "pysam/cvcf.pyx":876
- *         if data['filter'] == None: filter = "."
- *         elif data['filter'] == []:
- *             if self._version == 33: filter = "0"             # <<<<<<<<<<<<<<
- *             else: filter = "PASS"
- *         else: filter = ';'.join(data['filter'])
- */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_33, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__pyx_t_7) {
-      __Pyx_INCREF(__pyx_kp_s_0);
-      __pyx_v_filter = __pyx_kp_s_0;
-      goto __pyx_L8;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":877
- *         elif data['filter'] == []:
- *             if self._version == 33: filter = "0"
- *             else: filter = "PASS"             # <<<<<<<<<<<<<<
- *         else: filter = ';'.join(data['filter'])
- *         if data['qual'] == -1: qual = "."
- */
-      __Pyx_INCREF(__pyx_n_s_PASS);
-      __pyx_v_filter = __pyx_n_s_PASS;
-    }
-    __pyx_L8:;
-    goto __pyx_L7;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":878
- *             if self._version == 33: filter = "0"
- *             else: filter = "PASS"
- *         else: filter = ';'.join(data['filter'])             # <<<<<<<<<<<<<<
- *         if data['qual'] == -1: qual = "."
- *         else: qual = str(data['qual'])
- */
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_filter_2); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_v_filter = __pyx_t_3;
-    __pyx_t_3 = 0;
-  }
-  __pyx_L7:;
-
-  /* "pysam/cvcf.pyx":879
- *             else: filter = "PASS"
- *         else: filter = ';'.join(data['filter'])
- *         if data['qual'] == -1: qual = "."             # <<<<<<<<<<<<<<
- *         else: qual = str(data['qual'])
- * 
- */
-  __pyx_t_3 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_qual); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_7) {
-    __Pyx_INCREF(__pyx_kp_s__8);
-    __pyx_v_qual = __pyx_kp_s__8;
-    goto __pyx_L9;
-  }
-  /*else*/ {
-
-    /* "pysam/cvcf.pyx":880
- *         else: filter = ';'.join(data['filter'])
- *         if data['qual'] == -1: qual = "."
- *         else: qual = str(data['qual'])             # <<<<<<<<<<<<<<
- * 
- *         output = [data['chrom'],
- */
-    __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_qual); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_v_qual = __pyx_t_2;
-    __pyx_t_2 = 0;
-  }
-  __pyx_L9:;
-
-  /* "pysam/cvcf.pyx":882
- *         else: qual = str(data['qual'])
- * 
- *         output = [data['chrom'],             # <<<<<<<<<<<<<<
- *                   str(data['pos']+1),   # change to 1-based position
- *                   data['id'],
- */
-  __pyx_t_2 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_chrom); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_2);
-
-  /* "pysam/cvcf.pyx":883
- * 
- *         output = [data['chrom'],
- *                   str(data['pos']+1),   # change to 1-based position             # <<<<<<<<<<<<<<
- *                   data['id'],
- *                   data['ref'],
- */
-  __pyx_t_3 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_pos); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":884
- *         output = [data['chrom'],
- *                   str(data['pos']+1),   # change to 1-based position
- *                   data['id'],             # <<<<<<<<<<<<<<
- *                   data['ref'],
- *                   alt,
- */
-  __pyx_t_3 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_id); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_3);
-
-  /* "pysam/cvcf.pyx":885
- *                   str(data['pos']+1),   # change to 1-based position
- *                   data['id'],
- *                   data['ref'],             # <<<<<<<<<<<<<<
- *                   alt,
- *                   qual,
- */
-  __pyx_t_8 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_ref); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_8);
-
-  /* "pysam/cvcf.pyx":889
- *                   qual,
- *                   filter,
- *                   self.format_formatdata(             # <<<<<<<<<<<<<<
- *                       data['info'], self._info, separator=";"),
- *                   self.format_formatdata(
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_formatdata); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-
-  /* "pysam/cvcf.pyx":890
- *                   filter,
- *                   self.format_formatdata(
- *                       data['info'], self._info, separator=";"),             # <<<<<<<<<<<<<<
- *                   self.format_formatdata(
- *                       data['format'], self._format, value=False)]
- */
-  __pyx_t_10 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_info_2); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-
-  /* "pysam/cvcf.pyx":889
- *                   qual,
- *                   filter,
- *                   self.format_formatdata(             # <<<<<<<<<<<<<<
- *                       data['info'], self._info, separator=";"),
- *                   self.format_formatdata(
- */
-  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
-  __Pyx_GIVEREF(__pyx_t_10);
-  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
-  __Pyx_GIVEREF(__pyx_t_11);
-  __pyx_t_10 = 0;
-  __pyx_t_11 = 0;
-  __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_separator, __pyx_kp_s__10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-
-  /* "pysam/cvcf.pyx":891
- *                   self.format_formatdata(
- *                       data['info'], self._info, separator=";"),
- *                   self.format_formatdata(             # <<<<<<<<<<<<<<
- *                       data['format'], self._format, value=False)]
- * 
- */
-  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_formatdata); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_11);
-
-  /* "pysam/cvcf.pyx":892
- *                       data['info'], self._info, separator=";"),
- *                   self.format_formatdata(
- *                       data['format'], self._format, value=False)]             # <<<<<<<<<<<<<<
- * 
- *         for s in self._samples:
- */
-  __pyx_t_12 = PyObject_GetItem(__pyx_v_data, __pyx_n_s_format); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-  __Pyx_GOTREF(__pyx_t_12);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-
-  /* "pysam/cvcf.pyx":891
- *                   self.format_formatdata(
- *                       data['info'], self._info, separator=";"),
- *                   self.format_formatdata(             # <<<<<<<<<<<<<<
- *                       data['format'], self._format, value=False)]
- * 
- */
-  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_13);
-  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12);
-  __Pyx_GIVEREF(__pyx_t_12);
-  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_9);
-  __Pyx_GIVEREF(__pyx_t_9);
-  __pyx_t_12 = 0;
-  __pyx_t_9 = 0;
-  __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-
-  /* "pysam/cvcf.pyx":892
- *                       data['info'], self._info, separator=";"),
- *                   self.format_formatdata(
- *                       data['format'], self._format, value=False)]             # <<<<<<<<<<<<<<
- * 
- *         for s in self._samples:
- */
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_value, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":891
- *                   self.format_formatdata(
- *                       data['info'], self._info, separator=";"),
- *                   self.format_formatdata(             # <<<<<<<<<<<<<<
- *                       data['format'], self._format, value=False)]
- * 
- */
-  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-  /* "pysam/cvcf.pyx":882
- *         else: qual = str(data['qual'])
- * 
- *         output = [data['chrom'],             # <<<<<<<<<<<<<<
- *                   str(data['pos']+1),   # change to 1-based position
- *                   data['id'],
- */
-  __pyx_t_9 = PyList_New(9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
-  __Pyx_GIVEREF(__pyx_t_3);
-  PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  __Pyx_INCREF(__pyx_v_alt);
-  PyList_SET_ITEM(__pyx_t_9, 4, __pyx_v_alt);
-  __Pyx_GIVEREF(__pyx_v_alt);
-  __Pyx_INCREF(__pyx_v_qual);
-  PyList_SET_ITEM(__pyx_t_9, 5, __pyx_v_qual);
-  __Pyx_GIVEREF(__pyx_v_qual);
-  __Pyx_INCREF(__pyx_v_filter);
-  PyList_SET_ITEM(__pyx_t_9, 6, __pyx_v_filter);
-  __Pyx_GIVEREF(__pyx_v_filter);
-  PyList_SET_ITEM(__pyx_t_9, 7, __pyx_t_10);
-  __Pyx_GIVEREF(__pyx_t_10);
-  PyList_SET_ITEM(__pyx_t_9, 8, __pyx_t_12);
-  __Pyx_GIVEREF(__pyx_t_12);
-  __pyx_t_2 = 0;
-  __pyx_t_1 = 0;
-  __pyx_t_3 = 0;
-  __pyx_t_8 = 0;
-  __pyx_t_10 = 0;
-  __pyx_t_12 = 0;
-  __pyx_v_output = ((PyObject*)__pyx_t_9);
-  __pyx_t_9 = 0;
-
-  /* "pysam/cvcf.pyx":894
- *                       data['format'], self._format, value=False)]
- * 
- *         for s in self._samples:             # <<<<<<<<<<<<<<
- *             output.append(self.format_formatdata(
- *                 data[s], self._format, key=False))
- */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_9);
-  if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
-    __pyx_t_12 = __pyx_t_9; __Pyx_INCREF(__pyx_t_12); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_12);
-    __pyx_t_5 = Py_TYPE(__pyx_t_12)->tp_iternext;
-  }
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  for (;;) {
-    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_12)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_9 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_9 = PySequence_ITEM(__pyx_t_12, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_12)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_9 = PySequence_ITEM(__pyx_t_12, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_9 = __pyx_t_5(__pyx_t_12);
-      if (unlikely(!__pyx_t_9)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_9);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_9);
-    __pyx_t_9 = 0;
-
-    /* "pysam/cvcf.pyx":895
- * 
- *         for s in self._samples:
- *             output.append(self.format_formatdata(             # <<<<<<<<<<<<<<
- *                 data[s], self._format, key=False))
- * 
- */
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_formatdata); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_9);
-
-    /* "pysam/cvcf.pyx":896
- *         for s in self._samples:
- *             output.append(self.format_formatdata(
- *                 data[s], self._format, key=False))             # <<<<<<<<<<<<<<
- * 
- *         stream.write( "\t".join(output) + "\n" )
- */
-    __pyx_t_10 = PyObject_GetItem(__pyx_v_data, __pyx_v_s); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-    __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-
-    /* "pysam/cvcf.pyx":895
- * 
- *         for s in self._samples:
- *             output.append(self.format_formatdata(             # <<<<<<<<<<<<<<
- *                 data[s], self._format, key=False))
- * 
- */
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
-    __Pyx_GIVEREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
-    __Pyx_GIVEREF(__pyx_t_8);
-    __pyx_t_10 = 0;
-    __pyx_t_8 = 0;
-    __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-
-    /* "pysam/cvcf.pyx":896
- *         for s in self._samples:
- *             output.append(self.format_formatdata(
- *                 data[s], self._format, key=False))             # <<<<<<<<<<<<<<
- * 
- *         stream.write( "\t".join(output) + "\n" )
- */
-    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_key, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-    /* "pysam/cvcf.pyx":895
- * 
- *         for s in self._samples:
- *             output.append(self.format_formatdata(             # <<<<<<<<<<<<<<
- *                 data[s], self._format, key=False))
- * 
- */
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_10);
-    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_output, __pyx_t_10); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-
-  /* "pysam/cvcf.pyx":898
- *                 data[s], self._format, key=False))
- * 
- *         stream.write( "\t".join(output) + "\n" )             # <<<<<<<<<<<<<<
- * 
- *     def _parse_header(self, stream):
- */
-  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stream, __pyx_n_s_write); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_12);
-  __pyx_t_10 = __Pyx_PyString_Join(__pyx_kp_s__55, __pyx_v_output); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_kp_s__60); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __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 = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_10);
-  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_8);
-  __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
-  /* "pysam/cvcf.pyx":868
- * 
- * 
- *     def write_data(self, stream, data):             # <<<<<<<<<<<<<<
- *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
- *         for k in required:
- */
-
-  /* function exit code */
-  __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_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
-  __Pyx_XDECREF(__pyx_t_11);
-  __Pyx_XDECREF(__pyx_t_12);
-  __Pyx_XDECREF(__pyx_t_13);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.write_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_required);
-  __Pyx_XDECREF(__pyx_v_k);
-  __Pyx_XDECREF(__pyx_v_alt);
-  __Pyx_XDECREF(__pyx_v_filter);
-  __Pyx_XDECREF(__pyx_v_qual);
-  __Pyx_XDECREF(__pyx_v_output);
-  __Pyx_XDECREF(__pyx_v_s);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":900
- *         stream.write( "\t".join(output) + "\n" )
- * 
- *     def _parse_header(self, stream):             # <<<<<<<<<<<<<<
- *         self._lineno = 0
- *         for line in stream:
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_37_parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_37_parse_header = {__Pyx_NAMESTR("_parse_header"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_37_parse_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_37_parse_header(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_stream = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_parse_header (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_parse_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_parse_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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_self = values[0];
-    __pyx_v_stream = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_parse_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF._parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_36_parse_header(__pyx_self, __pyx_v_self, __pyx_v_stream);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_36_parse_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) {
-  PyObject *__pyx_v_line = NULL;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  Py_ssize_t __pyx_t_2;
-  PyObject *(*__pyx_t_3)(PyObject *);
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  struct __pyx_opt_args_5pysam_6ctabix__force_str __pyx_t_6;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_parse_header", 0);
-
-  /* "pysam/cvcf.pyx":901
- * 
- *     def _parse_header(self, stream):
- *         self._lineno = 0             # <<<<<<<<<<<<<<
- *         for line in stream:
- *             line = ctabix._force_str(line, self.encoding)
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lineno, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":902
- *     def _parse_header(self, stream):
- *         self._lineno = 0
- *         for line in stream:             # <<<<<<<<<<<<<<
- *             line = ctabix._force_str(line, self.encoding)
- *             self._lineno += 1
- */
-  if (PyList_CheckExact(__pyx_v_stream) || PyTuple_CheckExact(__pyx_v_stream)) {
-    __pyx_t_1 = __pyx_v_stream; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
-    __pyx_t_3 = NULL;
-  } else {
-    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_stream); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
-      if (unlikely(!__pyx_t_4)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_4);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_4);
-    __pyx_t_4 = 0;
-
-    /* "pysam/cvcf.pyx":903
- *         self._lineno = 0
- *         for line in stream:
- *             line = ctabix._force_str(line, self.encoding)             # <<<<<<<<<<<<<<
- *             self._lineno += 1
- *             if line.startswith('##'):
- */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6.__pyx_n = 1;
-    __pyx_t_6.encoding = __pyx_t_4;
-    __pyx_t_5 = __pyx_f_5pysam_6ctabix__force_str(__pyx_v_line, &__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_DECREF_SET(__pyx_v_line, __pyx_t_5);
-    __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":904
- *         for line in stream:
- *             line = ctabix._force_str(line, self.encoding)
- *             self._lineno += 1             # <<<<<<<<<<<<<<
- *             if line.startswith('##'):
- *                 self.parse_header(line.strip())
- */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lineno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lineno, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-    /* "pysam/cvcf.pyx":905
- *             line = ctabix._force_str(line, self.encoding)
- *             self._lineno += 1
- *             if line.startswith('##'):             # <<<<<<<<<<<<<<
- *                 self.parse_header(line.strip())
- *             elif line.startswith('#'):
- */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (__pyx_t_7) {
-
-      /* "pysam/cvcf.pyx":906
- *             self._lineno += 1
- *             if line.startswith('##'):
- *                 self.parse_header(line.strip())             # <<<<<<<<<<<<<<
- *             elif line.startswith('#'):
- *                 self.parse_heading(line.strip())
- */
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __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 = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L5;
-    }
-
-    /* "pysam/cvcf.pyx":907
- *             if line.startswith('##'):
- *                 self.parse_header(line.strip())
- *             elif line.startswith('#'):             # <<<<<<<<<<<<<<
- *                 self.parse_heading(line.strip())
- *                 self.enter_default_format()
- */
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (__pyx_t_7) {
-
-      /* "pysam/cvcf.pyx":908
- *                 self.parse_header(line.strip())
- *             elif line.startswith('#'):
- *                 self.parse_heading(line.strip())             # <<<<<<<<<<<<<<
- *                 self.enter_default_format()
- *             else:
- */
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_heading); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
-      __Pyx_GIVEREF(__pyx_t_5);
-      __pyx_t_5 = 0;
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-      /* "pysam/cvcf.pyx":909
- *             elif line.startswith('#'):
- *                 self.parse_heading(line.strip())
- *                 self.enter_default_format()             # <<<<<<<<<<<<<<
- *             else:
- *                 break
- */
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_enter_default_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      goto __pyx_L5;
-    }
-    /*else*/ {
-
-      /* "pysam/cvcf.pyx":911
- *                 self.enter_default_format()
- *             else:
- *                 break             # <<<<<<<<<<<<<<
- *         return line
- * 
- */
-      goto __pyx_L4_break;
-    }
-    __pyx_L5:;
-  }
-  __pyx_L4_break:;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":912
- *             else:
- *                 break
- *         return line             # <<<<<<<<<<<<<<
- * 
- *     def _parse(self, line, stream):
- */
-  __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_v_line)) { __Pyx_RaiseUnboundLocalError("line"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-  __Pyx_INCREF(__pyx_v_line);
-  __pyx_r = __pyx_v_line;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":900
- *         stream.write( "\t".join(output) + "\n" )
- * 
- *     def _parse_header(self, stream):             # <<<<<<<<<<<<<<
- *         self._lineno = 0
- *         for line in stream:
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_AddTraceback("pysam.cvcf.VCF._parse_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_line);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-static PyObject *__pyx_gb_5pysam_4cvcf_3VCF_40generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-
-/* "pysam/cvcf.pyx":914
- *         return line
- * 
- *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
- *         # deal with files with header only
- *         if line.startswith("##"): return
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_39_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_39_parse = {__Pyx_NAMESTR("_parse"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_39_parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_39_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_line = 0;
-  PyObject *__pyx_v_stream = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("_parse (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_line,&__pyx_n_s_stream,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __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_self = values[0];
-    __pyx_v_line = values[1];
-    __pyx_v_stream = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_parse", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF._parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_38_parse(__pyx_self, __pyx_v_self, __pyx_v_line, __pyx_v_stream);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_38_parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line, PyObject *__pyx_v_stream) {
-  struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *__pyx_cur_scope;
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("_parse", 0);
-  __pyx_cur_scope = (struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *)__pyx_tp_new_5pysam_4cvcf___pyx_scope_struct___parse(__pyx_ptype_5pysam_4cvcf___pyx_scope_struct___parse, __pyx_empty_tuple, NULL);
-  if (unlikely(!__pyx_cur_scope)) {
-    __Pyx_RefNannyFinishContext();
-    return NULL;
-  }
-  __Pyx_GOTREF(__pyx_cur_scope);
-  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
-  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
-  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
-  __pyx_cur_scope->__pyx_v_line = __pyx_v_line;
-  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_line);
-  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_line);
-  __pyx_cur_scope->__pyx_v_stream = __pyx_v_stream;
-  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_stream);
-  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_stream);
-  {
-    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_5pysam_4cvcf_3VCF_40generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_cur_scope);
-    __Pyx_RefNannyFinishContext();
-    return (PyObject *) gen;
-  }
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF._parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_gb_5pysam_4cvcf_3VCF_40generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
-{
-  struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *__pyx_cur_scope = ((struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *)__pyx_generator->closure);
-  PyObject *__pyx_r = NULL;
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  int __pyx_t_3;
-  Py_ssize_t __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *(*__pyx_t_6)(PyObject *);
-  PyObject *__pyx_t_7 = NULL;
-  int __pyx_t_8;
-  int __pyx_t_9;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("None", 0);
-  switch (__pyx_generator->resume_label) {
-    case 0: goto __pyx_L3_first_run;
-    case 1: goto __pyx_L7_resume_from_yield;
-    case 2: goto __pyx_L12_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 = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":916
- *     def _parse(self, line, stream):
- *         # deal with files with header only
- *         if line.startswith("##"): return             # <<<<<<<<<<<<<<
- *         if len(line.strip()) > 0:
- *             d = self.parse_data( line.strip() )
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (__pyx_t_3) {
-    __Pyx_XDECREF(__pyx_r);
-    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":917
- *         # deal with files with header only
- *         if line.startswith("##"): return
- *         if len(line.strip()) > 0:             # <<<<<<<<<<<<<<
- *             d = self.parse_data( line.strip() )
- *             if d: yield d
- */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_3 = ((__pyx_t_4 > 0) != 0);
-  if (__pyx_t_3) {
-
-    /* "pysam/cvcf.pyx":918
- *         if line.startswith("##"): return
- *         if len(line.strip()) > 0:
- *             d = self.parse_data( line.strip() )             # <<<<<<<<<<<<<<
- *             if d: yield d
- *         for line in stream:
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_parse_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_GIVEREF(__pyx_t_5);
-    __pyx_cur_scope->__pyx_v_d = __pyx_t_5;
-    __pyx_t_5 = 0;
-
-    /* "pysam/cvcf.pyx":919
- *         if len(line.strip()) > 0:
- *             d = self.parse_data( line.strip() )
- *             if d: yield d             # <<<<<<<<<<<<<<
- *         for line in stream:
- *             self._lineno += 1
- */
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_d); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_3) {
-      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_d);
-      __pyx_r = __pyx_cur_scope->__pyx_v_d;
-      __Pyx_XGIVEREF(__pyx_r);
-      __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
-      __pyx_generator->resume_label = 1;
-      return __pyx_r;
-      __pyx_L7_resume_from_yield:;
-      if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L6;
-    }
-    __pyx_L6:;
-    goto __pyx_L5;
-  }
-  __pyx_L5:;
-
-  /* "pysam/cvcf.pyx":920
- *             d = self.parse_data( line.strip() )
- *             if d: yield d
- *         for line in stream:             # <<<<<<<<<<<<<<
- *             self._lineno += 1
- *             if self._lines and self._lineno > self._lines: raise StopIteration
- */
-  if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_stream) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_stream)) {
-    __pyx_t_5 = __pyx_cur_scope->__pyx_v_stream; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
-    __pyx_t_6 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_stream); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_5)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_5)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_2 = __pyx_t_6(__pyx_t_5);
-      if (unlikely(!__pyx_t_2)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_2);
-    }
-    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_line);
-    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_2);
-    __Pyx_GIVEREF(__pyx_t_2);
-    __pyx_t_2 = 0;
-
-    /* "pysam/cvcf.pyx":921
- *             if d: yield d
- *         for line in stream:
- *             self._lineno += 1             # <<<<<<<<<<<<<<
- *             if self._lines and self._lineno > self._lines: raise StopIteration
- *             d = self.parse_data( line.strip() )
- */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lineno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lineno, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":922
- *         for line in stream:
- *             self._lineno += 1
- *             if self._lines and self._lineno > self._lines: raise StopIteration             # <<<<<<<<<<<<<<
- *             d = self.parse_data( line.strip() )
- *             if d: yield d
- */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lines_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__pyx_t_3) {
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lineno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_lines_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_9 = __pyx_t_8;
-    } else {
-      __pyx_t_9 = __pyx_t_3;
-    }
-    if (__pyx_t_9) {
-      __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-
-    /* "pysam/cvcf.pyx":923
- *             self._lineno += 1
- *             if self._lines and self._lineno > self._lines: raise StopIteration
- *             d = self.parse_data( line.strip() )             # <<<<<<<<<<<<<<
- *             if d: yield d
- * 
- */
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_parse_data); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_d);
-    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_d, __pyx_t_1);
-    __Pyx_GIVEREF(__pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":924
- *             if self._lines and self._lineno > self._lines: raise StopIteration
- *             d = self.parse_data( line.strip() )
- *             if d: yield d             # <<<<<<<<<<<<<<
- * 
- *     ######################################################################################################
- */
-    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_d); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (__pyx_t_9) {
-      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_d);
-      __pyx_r = __pyx_cur_scope->__pyx_v_d;
-      __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
-      __Pyx_XGIVEREF(__pyx_t_5);
-      __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
-      __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
-      __Pyx_XGIVEREF(__pyx_r);
-      __Pyx_RefNannyFinishContext();
-      /* return from generator, yielding value */
-      __pyx_generator->resume_label = 2;
-      return __pyx_r;
-      __pyx_L12_resume_from_yield:;
-      __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
-      __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
-      __pyx_cur_scope->__pyx_t_1 = 0;
-      __Pyx_XGOTREF(__pyx_t_5);
-      __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
-      if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      goto __pyx_L11;
-    }
-    __pyx_L11:;
-  }
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":914
- *         return line
- * 
- *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
- *         # deal with files with header only
- *         if line.startswith("##"): return
- */
-
-  /* function exit code */
-  PyErr_SetNone(PyExc_StopIteration);
-  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_7);
-  __Pyx_AddTraceback("_parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_generator->resume_label = -1;
-  __Pyx_Generator_clear((PyObject*)__pyx_generator);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-}
-
-/* "pysam/cvcf.pyx":932
- *     ######################################################################################################
- * 
- *     def getsamples(self):             # <<<<<<<<<<<<<<
- *         """ List of samples in VCF file """
- *         return self._samples
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_42getsamples(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_41getsamples[] = " List of samples in VCF file ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_42getsamples = {__Pyx_NAMESTR("getsamples"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_42getsamples, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_41getsamples)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_42getsamples(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getsamples (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_41getsamples(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_41getsamples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_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_RefNannySetupContext("getsamples", 0);
-
-  /* "pysam/cvcf.pyx":934
- *     def getsamples(self):
- *         """ List of samples in VCF file """
- *         return self._samples             # <<<<<<<<<<<<<<
- * 
- *     def setsamples(self,samples):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_samples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":932
- *     ######################################################################################################
- * 
- *     def getsamples(self):             # <<<<<<<<<<<<<<
- *         """ List of samples in VCF file """
- *         return self._samples
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.getsamples", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":936
- *         return self._samples
- * 
- *     def setsamples(self,samples):             # <<<<<<<<<<<<<<
- *         """ List of samples in VCF file """
- *         self._samples = samples
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_44setsamples(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_43setsamples[] = " List of samples in VCF file ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_44setsamples = {__Pyx_NAMESTR("setsamples"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_44setsamples, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_43setsamples)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_44setsamples(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_samples = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setsamples (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_samples_2,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samples_2)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setsamples", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setsamples") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __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_self = values[0];
-    __pyx_v_samples = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setsamples", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setsamples", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_43setsamples(__pyx_self, __pyx_v_self, __pyx_v_samples);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_43setsamples(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_samples) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("setsamples", 0);
-
-  /* "pysam/cvcf.pyx":938
- *     def setsamples(self,samples):
- *         """ List of samples in VCF file """
- *         self._samples = samples             # <<<<<<<<<<<<<<
- * 
- *     def getheader(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_samples, __pyx_v_samples) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":936
- *         return self._samples
- * 
- *     def setsamples(self,samples):             # <<<<<<<<<<<<<<
- *         """ List of samples in VCF file """
- *         self._samples = samples
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setsamples", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":940
- *         self._samples = samples
- * 
- *     def getheader(self):             # <<<<<<<<<<<<<<
- *         """ List of header key-value pairs (strings) """
- *         return self._header
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_46getheader(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_45getheader[] = " List of header key-value pairs (strings) ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_46getheader = {__Pyx_NAMESTR("getheader"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_46getheader, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_45getheader)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_46getheader(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getheader (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_45getheader(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_45getheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_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_RefNannySetupContext("getheader", 0);
-
-  /* "pysam/cvcf.pyx":942
- *     def getheader(self):
- *         """ List of header key-value pairs (strings) """
- *         return self._header             # <<<<<<<<<<<<<<
- * 
- *     def setheader(self,header):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":940
- *         self._samples = samples
- * 
- *     def getheader(self):             # <<<<<<<<<<<<<<
- *         """ List of header key-value pairs (strings) """
- *         return self._header
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.getheader", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":944
- *         return self._header
- * 
- *     def setheader(self,header):             # <<<<<<<<<<<<<<
- *         """ List of header key-value pairs (strings) """
- *         self._header = header
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_48setheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_47setheader[] = " List of header key-value pairs (strings) ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_48setheader = {__Pyx_NAMESTR("setheader"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_48setheader, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_47setheader)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_48setheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_header = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setheader (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_header_2,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_header_2)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setheader", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setheader") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __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_self = values[0];
-    __pyx_v_header = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setheader", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setheader", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_47setheader(__pyx_self, __pyx_v_self, __pyx_v_header);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_47setheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_header) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("setheader", 0);
-
-  /* "pysam/cvcf.pyx":946
- *     def setheader(self,header):
- *         """ List of header key-value pairs (strings) """
- *         self._header = header             # <<<<<<<<<<<<<<
- * 
- *     def getinfo(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header, __pyx_v_header) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":944
- *         return self._header
- * 
- *     def setheader(self,header):             # <<<<<<<<<<<<<<
- *         """ List of header key-value pairs (strings) """
- *         self._header = header
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setheader", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":948
- *         self._header = header
- * 
- *     def getinfo(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         return self._info
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_50getinfo(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_49getinfo[] = " Dictionary of ##INFO tags, as VCF.FORMAT values ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_50getinfo = {__Pyx_NAMESTR("getinfo"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_50getinfo, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_49getinfo)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_50getinfo(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getinfo (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_49getinfo(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_49getinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_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_RefNannySetupContext("getinfo", 0);
-
-  /* "pysam/cvcf.pyx":950
- *     def getinfo(self):
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         return self._info             # <<<<<<<<<<<<<<
- * 
- *     def setinfo(self,info):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":948
- *         self._header = header
- * 
- *     def getinfo(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         return self._info
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.getinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":952
- *         return self._info
- * 
- *     def setinfo(self,info):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         self._info = info
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_52setinfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_51setinfo[] = " Dictionary of ##INFO tags, as VCF.FORMAT values ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_52setinfo = {__Pyx_NAMESTR("setinfo"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_52setinfo, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_51setinfo)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_52setinfo(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_info = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setinfo (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_info_2,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_info_2)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setinfo", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setinfo") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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_self = values[0];
-    __pyx_v_info = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setinfo", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_51setinfo(__pyx_self, __pyx_v_self, __pyx_v_info);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_51setinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_info) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("setinfo", 0);
-
-  /* "pysam/cvcf.pyx":954
- *     def setinfo(self,info):
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         self._info = info             # <<<<<<<<<<<<<<
- * 
- *     def getformat(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_info, __pyx_v_info) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":952
- *         return self._info
- * 
- *     def setinfo(self,info):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         self._info = info
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":956
- *         self._info = info
- * 
- *     def getformat(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         return self._format
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_54getformat(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_53getformat[] = " Dictionary of ##FORMAT tags, as VCF.FORMAT values ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_54getformat = {__Pyx_NAMESTR("getformat"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_54getformat, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_53getformat)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_54getformat(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getformat (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_53getformat(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_53getformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_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_RefNannySetupContext("getformat", 0);
-
-  /* "pysam/cvcf.pyx":958
- *     def getformat(self):
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         return self._format             # <<<<<<<<<<<<<<
- * 
- *     def setformat(self,format):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":956
- *         self._info = info
- * 
- *     def getformat(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         return self._format
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.getformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":960
- *         return self._format
- * 
- *     def setformat(self,format):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         self._format = format
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_56setformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_55setformat[] = " Dictionary of ##FORMAT tags, as VCF.FORMAT values ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_56setformat = {__Pyx_NAMESTR("setformat"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_56setformat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_55setformat)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_56setformat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_format = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setformat (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_format,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setformat", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setformat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __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_self = values[0];
-    __pyx_v_format = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setformat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_55setformat(__pyx_self, __pyx_v_self, __pyx_v_format);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_55setformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_format) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("setformat", 0);
-
-  /* "pysam/cvcf.pyx":962
- *     def setformat(self,format):
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         self._format = format             # <<<<<<<<<<<<<<
- * 
- *     def getfilter(self):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_format_2, __pyx_v_format) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":960
- *         return self._format
- * 
- *     def setformat(self,format):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         self._format = format
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setformat", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":964
- *         self._format = format
- * 
- *     def getfilter(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         return self._filter
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_58getfilter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_57getfilter[] = " Dictionary of ##FILTER tags, as VCF.FORMAT values ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_58getfilter = {__Pyx_NAMESTR("getfilter"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_58getfilter, METH_O, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_57getfilter)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_58getfilter(PyObject *__pyx_self, PyObject *__pyx_v_self) {
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("getfilter (wrapper)", 0);
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_57getfilter(__pyx_self, ((PyObject *)__pyx_v_self));
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_57getfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_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_RefNannySetupContext("getfilter", 0);
-
-  /* "pysam/cvcf.pyx":966
- *     def getfilter(self):
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         return self._filter             # <<<<<<<<<<<<<<
- * 
- *     def setfilter(self,filter):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":964
- *         self._format = format
- * 
- *     def getfilter(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         return self._filter
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.getfilter", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":968
- *         return self._filter
- * 
- *     def setfilter(self,filter):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         self._filter = filter
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_60setfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_59setfilter[] = " Dictionary of ##FILTER tags, as VCF.FORMAT values ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_60setfilter = {__Pyx_NAMESTR("setfilter"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_60setfilter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_59setfilter)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_60setfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_filter = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setfilter (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filter_2,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filter_2)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setfilter", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setfilter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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_self = values[0];
-    __pyx_v_filter = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setfilter", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setfilter", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_59setfilter(__pyx_self, __pyx_v_self, __pyx_v_filter);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_59setfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filter) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("setfilter", 0);
-
-  /* "pysam/cvcf.pyx":970
- *     def setfilter(self,filter):
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         self._filter = filter             # <<<<<<<<<<<<<<
- * 
- *     def setversion(self, version):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_filter, __pyx_v_filter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":968
- *         return self._filter
- * 
- *     def setfilter(self,filter):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         self._filter = filter
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setfilter", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":972
- *         self._filter = filter
- * 
- *     def setversion(self, version):             # <<<<<<<<<<<<<<
- *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
- *         self._version = version
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_62setversion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_62setversion = {__Pyx_NAMESTR("setversion"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_62setversion, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_62setversion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_version = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setversion (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_version_2,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_version_2)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setversion", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setversion") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __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_self = values[0];
-    __pyx_v_version = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setversion", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_61setversion(__pyx_self, __pyx_v_self, __pyx_v_version);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_61setversion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_version) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  int __pyx_t_3;
-  int __pyx_t_4;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("setversion", 0);
-
-  /* "pysam/cvcf.pyx":973
- * 
- *     def setversion(self, version):
- *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")             # <<<<<<<<<<<<<<
- *         self._version = version
- * 
- */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_version, __pyx_int_33, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-    __pyx_t_1 = PyObject_RichCompare(__pyx_v_version, __pyx_int_40, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_4 = __pyx_t_3;
-  } else {
-    __pyx_t_4 = __pyx_t_2;
-  }
-  if (__pyx_t_4) {
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  }
-
-  /* "pysam/cvcf.pyx":974
- *     def setversion(self, version):
- *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
- *         self._version = version             # <<<<<<<<<<<<<<
- * 
- *     def setregions(self, regions):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_version, __pyx_v_version) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":972
- *         self._filter = filter
- * 
- *     def setversion(self, version):             # <<<<<<<<<<<<<<
- *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
- *         self._version = version
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setversion", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":976
- *         self._version = version
- * 
- *     def setregions(self, regions):             # <<<<<<<<<<<<<<
- *         self._regions = regions
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_64setregions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_64setregions = {__Pyx_NAMESTR("setregions"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_64setregions, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_64setregions(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_regions = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setregions (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_regions,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_regions)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setregions", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setregions") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __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_self = values[0];
-    __pyx_v_regions = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setregions", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setregions", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_63setregions(__pyx_self, __pyx_v_self, __pyx_v_regions);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_63setregions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_regions) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("setregions", 0);
-
-  /* "pysam/cvcf.pyx":977
- * 
- *     def setregions(self, regions):
- *         self._regions = regions             # <<<<<<<<<<<<<<
- * 
- *     def setreference(self, ref):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_regions_2, __pyx_v_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":976
- *         self._version = version
- * 
- *     def setregions(self, regions):             # <<<<<<<<<<<<<<
- *         self._regions = regions
- * 
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setregions", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":979
- *         self._regions = regions
- * 
- *     def setreference(self, ref):             # <<<<<<<<<<<<<<
- *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
- *         self._reference = ref
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_66setreference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_65setreference[] = " Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_66setreference = {__Pyx_NAMESTR("setreference"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_66setreference, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_65setreference)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_66setreference(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_ref = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("setreference (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ref,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("setreference", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setreference") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __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_self = values[0];
-    __pyx_v_ref = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("setreference", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setreference", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_65setreference(__pyx_self, __pyx_v_self, __pyx_v_ref);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_65setreference(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ref) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("setreference", 0);
-
-  /* "pysam/cvcf.pyx":981
- *     def setreference(self, ref):
- *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
- *         self._reference = ref             # <<<<<<<<<<<<<<
- * 
- *     def ignoreerror(self, errorstring):
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reference_2, __pyx_v_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":979
- *         self._regions = regions
- * 
- *     def setreference(self, ref):             # <<<<<<<<<<<<<<
- *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
- *         self._reference = ref
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.setreference", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":983
- *         self._reference = ref
- * 
- *     def ignoreerror(self, errorstring):             # <<<<<<<<<<<<<<
- *         try:             self._ignored_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_68ignoreerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_68ignoreerror = {__Pyx_NAMESTR("ignoreerror"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_68ignoreerror, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_68ignoreerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_errorstring = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("ignoreerror (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_errorstring,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_errorstring)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("ignoreerror", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ignoreerror") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __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_self = values[0];
-    __pyx_v_errorstring = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("ignoreerror", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.ignoreerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_67ignoreerror(__pyx_self, __pyx_v_self, __pyx_v_errorstring);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_67ignoreerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorstring) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("ignoreerror", 0);
-
-  /* "pysam/cvcf.pyx":984
- * 
- *     def ignoreerror(self, errorstring):
- *         try:             self._ignored_errors.add(self.__dict__[errorstring])             # <<<<<<<<<<<<<<
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- */
-  {
-    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
-    __Pyx_XGOTREF(__pyx_t_1);
-    __Pyx_XGOTREF(__pyx_t_2);
-    __Pyx_XGOTREF(__pyx_t_3);
-    /*try:*/ {
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ignored_errors); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_errorstring); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;};
-      __Pyx_GOTREF(__pyx_t_6);
-      __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 = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    }
-    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L10_try_end;
-    __pyx_L3_error:;
-    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-    /* "pysam/cvcf.pyx":985
- *     def ignoreerror(self, errorstring):
- *         try:             self._ignored_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)             # <<<<<<<<<<<<<<
- * 
- *     def warnerror(self, errorstring):
- */
-    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
-    if (__pyx_t_7) {
-      __Pyx_AddTraceback("pysam.cvcf.VCF.ignoreerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_error_string_s, __pyx_v_errorstring); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L4_exception_handled;
-    }
-    goto __pyx_L5_except_error;
-    __pyx_L5_except_error:;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __Pyx_XGIVEREF(__pyx_t_2);
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
-    goto __pyx_L1_error;
-    __pyx_L4_exception_handled:;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __Pyx_XGIVEREF(__pyx_t_2);
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
-    __pyx_L10_try_end:;
-  }
-
-  /* "pysam/cvcf.pyx":983
- *         self._reference = ref
- * 
- *     def ignoreerror(self, errorstring):             # <<<<<<<<<<<<<<
- *         try:             self._ignored_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.ignoreerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":987
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- *     def warnerror(self, errorstring):             # <<<<<<<<<<<<<<
- *         try:             self._warn_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_70warnerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_70warnerror = {__Pyx_NAMESTR("warnerror"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_70warnerror, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_70warnerror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_errorstring = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("warnerror (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_errorstring,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_errorstring)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("warnerror", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "warnerror") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __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_self = values[0];
-    __pyx_v_errorstring = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("warnerror", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.warnerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_69warnerror(__pyx_self, __pyx_v_self, __pyx_v_errorstring);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_69warnerror(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorstring) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  PyObject *__pyx_t_8 = NULL;
-  PyObject *__pyx_t_9 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("warnerror", 0);
-
-  /* "pysam/cvcf.pyx":988
- * 
- *     def warnerror(self, errorstring):
- *         try:             self._warn_errors.add(self.__dict__[errorstring])             # <<<<<<<<<<<<<<
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- */
-  {
-    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
-    __Pyx_XGOTREF(__pyx_t_1);
-    __Pyx_XGOTREF(__pyx_t_2);
-    __Pyx_XGOTREF(__pyx_t_3);
-    /*try:*/ {
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_warn_errors); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_add); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_errorstring); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L3_error;};
-      __Pyx_GOTREF(__pyx_t_6);
-      __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 = 988; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_4);
-      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
-      __Pyx_GIVEREF(__pyx_t_6);
-      __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    }
-    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    goto __pyx_L10_try_end;
-    __pyx_L3_error:;
-    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-
-    /* "pysam/cvcf.pyx":989
- *     def warnerror(self, errorstring):
- *         try:             self._warn_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)             # <<<<<<<<<<<<<<
- * 
- *     def parse(self, stream):
- */
-    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
-    if (__pyx_t_7) {
-      __Pyx_AddTraceback("pysam.cvcf.VCF.warnerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_error_string_s, __pyx_v_errorstring); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_9);
-      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
-      __Pyx_GIVEREF(__pyx_t_8);
-      __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_GOTREF(__pyx_t_8);
-      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
-      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      goto __pyx_L4_exception_handled;
-    }
-    goto __pyx_L5_except_error;
-    __pyx_L5_except_error:;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __Pyx_XGIVEREF(__pyx_t_2);
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
-    goto __pyx_L1_error;
-    __pyx_L4_exception_handled:;
-    __Pyx_XGIVEREF(__pyx_t_1);
-    __Pyx_XGIVEREF(__pyx_t_2);
-    __Pyx_XGIVEREF(__pyx_t_3);
-    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
-    __pyx_L10_try_end:;
-  }
-
-  /* "pysam/cvcf.pyx":987
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- *     def warnerror(self, errorstring):             # <<<<<<<<<<<<<<
- *         try:             self._warn_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- */
-
-  /* function exit code */
-  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
-  goto __pyx_L0;
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_4);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_8);
-  __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.warnerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":991
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- *     def parse(self, stream):             # <<<<<<<<<<<<<<
- *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
- *         last_line = self._parse_header(stream)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_72parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_71parse[] = " Parse a stream of VCF-formatted lines.  Initializes class instance and return generator ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_72parse = {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_72parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_71parse)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_72parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_stream = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("parse (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __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_self = values[0];
-    __pyx_v_stream = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parse", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_71parse(__pyx_self, __pyx_v_self, __pyx_v_stream);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_71parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) {
-  PyObject *__pyx_v_last_line = NULL;
-  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_RefNannySetupContext("parse", 0);
-
-  /* "pysam/cvcf.pyx":993
- *     def parse(self, stream):
- *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
- *         last_line = self._parse_header(stream)             # <<<<<<<<<<<<<<
- *         # now return a generator that does the actual work.  In this way the pre-processing is done
- *         # before the first piece of data is yielded
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_header_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __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 = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_stream);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
-  __Pyx_GIVEREF(__pyx_v_stream);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_v_last_line = __pyx_t_3;
-  __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":996
- *         # now return a generator that does the actual work.  In this way the pre-processing is done
- *         # before the first piece of data is yielded
- *         return self._parse(last_line, stream)             # <<<<<<<<<<<<<<
- * 
- *     def write(self, stream, datagenerator):
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_last_line);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_last_line);
-  __Pyx_GIVEREF(__pyx_v_last_line);
-  __Pyx_INCREF(__pyx_v_stream);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_stream);
-  __Pyx_GIVEREF(__pyx_v_stream);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":991
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- *     def parse(self, stream):             # <<<<<<<<<<<<<<
- *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
- *         last_line = self._parse_header(stream)
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_2);
-  __Pyx_XDECREF(__pyx_t_3);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_last_line);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":998
- *         return self._parse(last_line, stream)
- * 
- *     def write(self, stream, datagenerator):             # <<<<<<<<<<<<<<
- *         """ Writes a VCF file to a stream, using a data generator (or list) """
- *         self.write_header(stream)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_74write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_73write[] = " Writes a VCF file to a stream, using a data generator (or list) ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_74write = {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_74write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_73write)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_74write(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_stream = 0;
-  PyObject *__pyx_v_datagenerator = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("write (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,&__pyx_n_s_datagenerator,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_datagenerator)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __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_self = values[0];
-    __pyx_v_stream = values[1];
-    __pyx_v_datagenerator = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_73write(__pyx_self, __pyx_v_self, __pyx_v_stream, __pyx_v_datagenerator);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_73write(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream, PyObject *__pyx_v_datagenerator) {
-  PyObject *__pyx_v_data = 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)(PyObject *);
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("write", 0);
-
-  /* "pysam/cvcf.pyx":1000
- *     def write(self, stream, datagenerator):
- *         """ Writes a VCF file to a stream, using a data generator (or list) """
- *         self.write_header(stream)             # <<<<<<<<<<<<<<
- *         self.write_heading(stream)
- *         for data in datagenerator: self.write_data(stream,data)
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __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 = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_stream);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
-  __Pyx_GIVEREF(__pyx_v_stream);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":1001
- *         """ Writes a VCF file to a stream, using a data generator (or list) """
- *         self.write_header(stream)
- *         self.write_heading(stream)             # <<<<<<<<<<<<<<
- *         for data in datagenerator: self.write_data(stream,data)
- * 
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_heading); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __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 = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_stream);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
-  __Pyx_GIVEREF(__pyx_v_stream);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":1002
- *         self.write_header(stream)
- *         self.write_heading(stream)
- *         for data in datagenerator: self.write_data(stream,data)             # <<<<<<<<<<<<<<
- * 
- *     def writeheader(self, stream):
- */
-  if (PyList_CheckExact(__pyx_v_datagenerator) || PyTuple_CheckExact(__pyx_v_datagenerator)) {
-    __pyx_t_1 = __pyx_v_datagenerator; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
-    __pyx_t_5 = NULL;
-  } else {
-    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_datagenerator); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
-  }
-  for (;;) {
-    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
-      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
-      #if CYTHON_COMPILING_IN_CPYTHON
-      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #else
-      __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      #endif
-    } else {
-      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
-      if (unlikely(!__pyx_t_2)) {
-        PyObject* exc_type = PyErr_Occurred();
-        if (exc_type) {
-          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        }
-        break;
-      }
-      __Pyx_GOTREF(__pyx_t_2);
-    }
-    __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_2);
-    __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_3);
-    __Pyx_INCREF(__pyx_v_stream);
-    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_stream);
-    __Pyx_GIVEREF(__pyx_v_stream);
-    __Pyx_INCREF(__pyx_v_data);
-    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_data);
-    __Pyx_GIVEREF(__pyx_v_data);
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  }
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":998
- *         return self._parse(last_line, stream)
- * 
- *     def write(self, stream, datagenerator):             # <<<<<<<<<<<<<<
- *         """ Writes a VCF file to a stream, using a data generator (or list) """
- *         self.write_header(stream)
- */
-
-  /* function exit code */
-  __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_6);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_data);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":1004
- *         for data in datagenerator: self.write_data(stream,data)
- * 
- *     def writeheader(self, stream):             # <<<<<<<<<<<<<<
- *         """ Writes a VCF header """
- *         self.write_header(stream)
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_76writeheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_75writeheader[] = " Writes a VCF header ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_76writeheader = {__Pyx_NAMESTR("writeheader"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_76writeheader, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_75writeheader)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_76writeheader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_stream = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("writeheader (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_stream,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stream)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("writeheader", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeheader") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __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_self = values[0];
-    __pyx_v_stream = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("writeheader", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.writeheader", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_75writeheader(__pyx_self, __pyx_v_self, __pyx_v_stream);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_75writeheader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_stream) {
-  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_RefNannySetupContext("writeheader", 0);
-
-  /* "pysam/cvcf.pyx":1006
- *     def writeheader(self, stream):
- *         """ Writes a VCF header """
- *         self.write_header(stream)             # <<<<<<<<<<<<<<
- *         self.write_heading(stream)
- * 
- */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __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 = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_stream);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
-  __Pyx_GIVEREF(__pyx_v_stream);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":1007
- *         """ Writes a VCF header """
- *         self.write_header(stream)
- *         self.write_heading(stream)             # <<<<<<<<<<<<<<
- * 
- *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):
- */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_write_heading); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __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 = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_v_stream);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stream);
-  __Pyx_GIVEREF(__pyx_v_stream);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":1004
- *         for data in datagenerator: self.write_data(stream,data)
- * 
- *     def writeheader(self, stream):             # <<<<<<<<<<<<<<
- *         """ Writes a VCF header """
- *         self.write_header(stream)
- */
-
-  /* function exit code */
-  __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("pysam.cvcf.VCF.writeheader", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":1009
- *         self.write_heading(stream)
- * 
- *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):             # <<<<<<<<<<<<<<
- *         """ Utility function: compares two calls for equality """
- *         # a variant should always be assigned to a unique position, one base before
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_78compare_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_77compare_calls[] = " Utility function: compares two calls for equality ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_78compare_calls = {__Pyx_NAMESTR("compare_calls"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_78compare_calls, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_77compare_calls)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_78compare_calls(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_pos1 = 0;
-  PyObject *__pyx_v_ref1 = 0;
-  PyObject *__pyx_v_alt1 = 0;
-  PyObject *__pyx_v_pos2 = 0;
-  PyObject *__pyx_v_ref2 = 0;
-  PyObject *__pyx_v_alt2 = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("compare_calls (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_pos1,&__pyx_n_s_ref1,&__pyx_n_s_alt1,&__pyx_n_s_pos2,&__pyx_n_s_ref2,&__pyx_n_s_alt2,0};
-    PyObject* values[7] = {0,0,0,0,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  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
-        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-        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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos1)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref1)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  3:
-        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alt1)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  4:
-        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos2)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  5:
-        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref2)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  6:
-        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alt2)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compare_calls") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-      }
-    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
-      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);
-      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
-      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
-      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
-      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
-    }
-    __pyx_v_self = values[0];
-    __pyx_v_pos1 = values[1];
-    __pyx_v_ref1 = values[2];
-    __pyx_v_alt1 = values[3];
-    __pyx_v_pos2 = values[4];
-    __pyx_v_ref2 = values[5];
-    __pyx_v_alt2 = values[6];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("compare_calls", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.compare_calls", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_77compare_calls(__pyx_self, __pyx_v_self, __pyx_v_pos1, __pyx_v_ref1, __pyx_v_alt1, __pyx_v_pos2, __pyx_v_ref2, __pyx_v_alt2);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_77compare_calls(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_pos1, PyObject *__pyx_v_ref1, PyObject *__pyx_v_alt1, PyObject *__pyx_v_pos2, PyObject *__pyx_v_ref2, PyObject *__pyx_v_alt2) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_t_2;
-  Py_ssize_t __pyx_t_3;
-  int __pyx_t_4;
-  PyObject *__pyx_t_5 = NULL;
-  PyObject *__pyx_t_6 = NULL;
-  int __pyx_t_7;
-  int __pyx_t_8;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("compare_calls", 0);
-  __Pyx_INCREF(__pyx_v_ref1);
-  __Pyx_INCREF(__pyx_v_alt1);
-  __Pyx_INCREF(__pyx_v_ref2);
-  __Pyx_INCREF(__pyx_v_alt2);
-
-  /* "pysam/cvcf.pyx":1014
- *         # the leftmost position of the alignment gap.  If this rule is implemented
- *         # correctly, the two positions must be equal for the calls to be identical.
- *         if pos1 != pos2: return False             # <<<<<<<<<<<<<<
- *         # from both calls, trim rightmost bases when identical.  Do this safely, i.e.
- *         # only when the reference bases are not Ns
- */
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_pos1, __pyx_v_pos2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (__pyx_t_2) {
-    __Pyx_XDECREF(__pyx_r);
-    __Pyx_INCREF(Py_False);
-    __pyx_r = Py_False;
-    goto __pyx_L0;
-  }
-
-  /* "pysam/cvcf.pyx":1017
- *         # from both calls, trim rightmost bases when identical.  Do this safely, i.e.
- *         # only when the reference bases are not Ns
- *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:             # <<<<<<<<<<<<<<
- *             ref1 = ref1[:-1]
- *             alt1 = alt1[:-1]
- */
-  while (1) {
-    __pyx_t_3 = PyObject_Length(__pyx_v_ref1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_2 = (__pyx_t_3 > 0);
-    if (__pyx_t_2) {
-      __pyx_t_3 = PyObject_Length(__pyx_v_alt1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_4 = (__pyx_t_3 > 0);
-      if (__pyx_t_4) {
-        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ref1, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alt1, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_8 = __pyx_t_7;
-      } else {
-        __pyx_t_8 = __pyx_t_4;
-      }
-      __pyx_t_4 = __pyx_t_8;
-    } else {
-      __pyx_t_4 = __pyx_t_2;
-    }
-    if (!__pyx_t_4) break;
-
-    /* "pysam/cvcf.pyx":1018
- *         # only when the reference bases are not Ns
- *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:
- *             ref1 = ref1[:-1]             # <<<<<<<<<<<<<<
- *             alt1 = alt1[:-1]
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
- */
-    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_ref1, 0, -1, NULL, NULL, &__pyx_slice__86, 0, 1, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF_SET(__pyx_v_ref1, __pyx_t_6);
-    __pyx_t_6 = 0;
-
-    /* "pysam/cvcf.pyx":1019
- *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:
- *             ref1 = ref1[:-1]
- *             alt1 = alt1[:-1]             # <<<<<<<<<<<<<<
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
- *             ref2 = ref2[:-1]
- */
-    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_alt1, 0, -1, NULL, NULL, &__pyx_slice__87, 0, 1, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_6);
-    __Pyx_DECREF_SET(__pyx_v_alt1, __pyx_t_6);
-    __pyx_t_6 = 0;
-  }
-
-  /* "pysam/cvcf.pyx":1020
- *             ref1 = ref1[:-1]
- *             alt1 = alt1[:-1]
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:             # <<<<<<<<<<<<<<
- *             ref2 = ref2[:-1]
- *             alt2 = alt2[:-1]
- */
-  while (1) {
-    __pyx_t_3 = PyObject_Length(__pyx_v_ref2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __pyx_t_4 = (__pyx_t_3 > 0);
-    if (__pyx_t_4) {
-      __pyx_t_3 = PyObject_Length(__pyx_v_alt2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-      __pyx_t_2 = (__pyx_t_3 > 0);
-      if (__pyx_t_2) {
-        __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_ref2, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_alt2, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
-        __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_7 = __pyx_t_8;
-      } else {
-        __pyx_t_7 = __pyx_t_2;
-      }
-      __pyx_t_2 = __pyx_t_7;
-    } else {
-      __pyx_t_2 = __pyx_t_4;
-    }
-    if (!__pyx_t_2) break;
-
-    /* "pysam/cvcf.pyx":1021
- *             alt1 = alt1[:-1]
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
- *             ref2 = ref2[:-1]             # <<<<<<<<<<<<<<
- *             alt2 = alt2[:-1]
- *         # now, the alternative alleles must be identical
- */
-    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_ref2, 0, -1, NULL, NULL, &__pyx_slice__88, 0, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_ref2, __pyx_t_1);
-    __pyx_t_1 = 0;
-
-    /* "pysam/cvcf.pyx":1022
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
- *             ref2 = ref2[:-1]
- *             alt2 = alt2[:-1]             # <<<<<<<<<<<<<<
- *         # now, the alternative alleles must be identical
- *         return alt1 == alt2
- */
-    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_alt2, 0, -1, NULL, NULL, &__pyx_slice__89, 0, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    __Pyx_GOTREF(__pyx_t_1);
-    __Pyx_DECREF_SET(__pyx_v_alt2, __pyx_t_1);
-    __pyx_t_1 = 0;
-  }
-
-  /* "pysam/cvcf.pyx":1024
- *             alt2 = alt2[:-1]
- *         # now, the alternative alleles must be identical
- *         return alt1 == alt2             # <<<<<<<<<<<<<<
- * 
- * ###########################################################################################################
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_RichCompare(__pyx_v_alt1, __pyx_v_alt2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_r = __pyx_t_1;
-  __pyx_t_1 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":1009
- *         self.write_heading(stream)
- * 
- *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):             # <<<<<<<<<<<<<<
- *         """ Utility function: compares two calls for equality """
- *         # a variant should always be assigned to a unique position, one base before
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_6);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.compare_calls", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XDECREF(__pyx_v_ref1);
-  __Pyx_XDECREF(__pyx_v_alt1);
-  __Pyx_XDECREF(__pyx_v_ref2);
-  __Pyx_XDECREF(__pyx_v_alt2);
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":1031
- * ###########################################################################################################
- * 
- *     def connect(self, filename, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         '''connect to tabix file.'''
- *         self.encoding=encoding
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_80connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_79connect[] = "connect to tabix file.";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_80connect = {__Pyx_NAMESTR("connect"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_80connect, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_79connect)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_80connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_filename = 0;
-  PyObject *__pyx_v_encoding = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,&__pyx_n_s_encoding,0};
-    PyObject* values[3] = {0,0,0};
-    values[2] = ((PyObject *)((PyObject*)__pyx_n_s_ascii));
-    if (unlikely(__pyx_kwds)) {
-      Py_ssize_t kw_args;
-      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
-      switch (pos_args) {
-        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
-        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
-        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        case  0: break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-      kw_args = PyDict_Size(__pyx_kwds);
-      switch (pos_args) {
-        case  0:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("connect", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_encoding);
-          if (value) { values[2] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "connect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __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);
-        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
-        break;
-        default: goto __pyx_L5_argtuple_error;
-      }
-    }
-    __pyx_v_self = values[0];
-    __pyx_v_filename = values[1];
-    __pyx_v_encoding = values[2];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("connect", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_79connect(__pyx_self, __pyx_v_self, __pyx_v_filename, __pyx_v_encoding);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_79connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_filename, PyObject *__pyx_v_encoding) {
-  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_RefNannySetupContext("connect", 0);
-
-  /* "pysam/cvcf.pyx":1033
- *     def connect(self, filename, encoding="ascii"):
- *         '''connect to tabix file.'''
- *         self.encoding=encoding             # <<<<<<<<<<<<<<
- *         self.tabixfile = pysam.Tabixfile(filename, encoding=encoding)
- *         self._parse_header(self.tabixfile.header)
- */
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":1034
- *         '''connect to tabix file.'''
- *         self.encoding=encoding
- *         self.tabixfile = pysam.Tabixfile(filename, encoding=encoding)             # <<<<<<<<<<<<<<
- *         self._parse_header(self.tabixfile.header)
- * 
- */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysam); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Tabixfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __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 = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_filename);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
-  __Pyx_GIVEREF(__pyx_v_filename);
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
-  /* "pysam/cvcf.pyx":1035
- *         self.encoding=encoding
- *         self.tabixfile = pysam.Tabixfile(filename, encoding=encoding)
- *         self._parse_header(self.tabixfile.header)             # <<<<<<<<<<<<<<
- * 
- *     def fetch(self,
- */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_header_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_header_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":1031
- * ###########################################################################################################
- * 
- *     def connect(self, filename, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         '''connect to tabix file.'''
- *         self.encoding=encoding
- */
-
-  /* function exit code */
-  __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("pysam.cvcf.VCF.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":1037
- *         self._parse_header(self.tabixfile.header)
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_82fetch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_81fetch[] = " Parse a stream of VCF-formatted lines.  \n        Initializes class instance and return generator ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_82fetch = {__Pyx_NAMESTR("fetch"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_82fetch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_81fetch)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_82fetch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  PyObject *__pyx_v_self = 0;
-  PyObject *__pyx_v_reference = 0;
-  PyObject *__pyx_v_start = 0;
-  PyObject *__pyx_v_end = 0;
-  PyObject *__pyx_v_region = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("fetch (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_reference,&__pyx_n_s_start,&__pyx_n_s_end,&__pyx_n_s_region,0};
-    PyObject* values[5] = {0,0,0,0,0};
-
-    /* "pysam/cvcf.pyx":1038
- * 
- *     def fetch(self,
- *               reference=None,             # <<<<<<<<<<<<<<
- *               start=None,
- *               end=None,
- */
-    values[1] = ((PyObject *)((PyObject *)Py_None));
-
-    /* "pysam/cvcf.pyx":1039
- *     def fetch(self,
- *               reference=None,
- *               start=None,             # <<<<<<<<<<<<<<
- *               end=None,
- *               region=None ):
- */
-    values[2] = ((PyObject *)((PyObject *)Py_None));
-
-    /* "pysam/cvcf.pyx":1040
- *               reference=None,
- *               start=None,
- *               end=None,             # <<<<<<<<<<<<<<
- *               region=None ):
- *         """ Parse a stream of VCF-formatted lines.
- */
-    values[3] = ((PyObject *)((PyObject *)Py_None));
-
-    /* "pysam/cvcf.pyx":1041
- *               start=None,
- *               end=None,
- *               region=None ):             # <<<<<<<<<<<<<<
- *         """ Parse a stream of VCF-formatted lines.
- *         Initializes class instance and return generator """
- */
-    values[4] = ((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  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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reference);
-          if (value) { values[1] = value; kw_args--; }
-        }
-        case  2:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
-          if (value) { values[2] = value; kw_args--; }
-        }
-        case  3:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end);
-          if (value) { values[3] = value; kw_args--; }
-        }
-        case  4:
-        if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region);
-          if (value) { values[4] = value; kw_args--; }
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __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);
-        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_self = values[0];
-    __pyx_v_reference = values[1];
-    __pyx_v_start = values[2];
-    __pyx_v_end = values[3];
-    __pyx_v_region = values[4];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("fetch", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_81fetch(__pyx_self, __pyx_v_self, __pyx_v_reference, __pyx_v_start, __pyx_v_end, __pyx_v_region);
-
-  /* "pysam/cvcf.pyx":1037
- *         self._parse_header(self.tabixfile.header)
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_81fetch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_reference, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_region) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  PyObject *__pyx_t_2 = NULL;
-  PyObject *__pyx_t_3 = NULL;
-  PyObject *__pyx_t_4 = NULL;
-  PyObject *__pyx_t_5 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("fetch", 0);
-
-  /* "pysam/cvcf.pyx":1044
- *         """ Parse a stream of VCF-formatted lines.
- *         Initializes class instance and return generator """
- *         return self.tabixfile.fetch(             # <<<<<<<<<<<<<<
- *             reference,
- *             start,
- */
-  __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tabixfile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fetch); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
-  /* "pysam/cvcf.pyx":1048
- *             start,
- *             end,
- *             region,             # <<<<<<<<<<<<<<
- *             parser = asVCFRecord(self))
- * 
- */
-  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_v_reference);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_reference);
-  __Pyx_GIVEREF(__pyx_v_reference);
-  __Pyx_INCREF(__pyx_v_start);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_start);
-  __Pyx_GIVEREF(__pyx_v_start);
-  __Pyx_INCREF(__pyx_v_end);
-  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_end);
-  __Pyx_GIVEREF(__pyx_v_end);
-  __Pyx_INCREF(__pyx_v_region);
-  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_region);
-  __Pyx_GIVEREF(__pyx_v_region);
-
-  /* "pysam/cvcf.pyx":1044
- *         """ Parse a stream of VCF-formatted lines.
- *         Initializes class instance and return generator """
- *         return self.tabixfile.fetch(             # <<<<<<<<<<<<<<
- *             reference,
- *             start,
- */
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-
-  /* "pysam/cvcf.pyx":1049
- *             end,
- *             region,
- *             parser = asVCFRecord(self))             # <<<<<<<<<<<<<<
- * 
- *     def validate(self, record):
- */
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-  __Pyx_INCREF(__pyx_v_self);
-  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
-  __Pyx_GIVEREF(__pyx_v_self);
-  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_4cvcf_asVCFRecord)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_parser, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":1044
- *         """ Parse a stream of VCF-formatted lines.
- *         Initializes class instance and return generator """
- *         return self.tabixfile.fetch(             # <<<<<<<<<<<<<<
- *             reference,
- *             start,
- */
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_r = __pyx_t_5;
-  __pyx_t_5 = 0;
-  goto __pyx_L0;
-
-  /* "pysam/cvcf.pyx":1037
- *         self._parse_header(self.tabixfile.header)
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-
-  /* function exit code */
-  __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);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.fetch", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __pyx_L0:;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-/* "pysam/cvcf.pyx":1051
- *             parser = asVCFRecord(self))
- * 
- *     def validate(self, record):             # <<<<<<<<<<<<<<
- *         '''validate vcf record.
- * 
- */
-
-/* Python wrapper */
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_84validate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5pysam_4cvcf_3VCF_83validate[] = "validate vcf record.\n\n        returns a validated record.\n        ";
-static PyMethodDef __pyx_mdef_5pysam_4cvcf_3VCF_84validate = {__Pyx_NAMESTR("validate"), (PyCFunction)__pyx_pw_5pysam_4cvcf_3VCF_84validate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_3VCF_83validate)};
-static PyObject *__pyx_pw_5pysam_4cvcf_3VCF_84validate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
-  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
-  CYTHON_UNUSED PyObject *__pyx_v_record = 0;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  PyObject *__pyx_r = 0;
-  __Pyx_RefNannyDeclarations
-  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
-  {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_record,0};
-    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:
-        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
-        else goto __pyx_L5_argtuple_error;
-        case  1:
-        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_record)) != 0)) kw_args--;
-        else {
-          __Pyx_RaiseArgtupleInvalid("validate", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-        }
-      }
-      if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "validate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __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_self = values[0];
-    __pyx_v_record = values[1];
-  }
-  goto __pyx_L4_argument_unpacking_done;
-  __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("validate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
-  __pyx_L3_error:;
-  __Pyx_AddTraceback("pysam.cvcf.VCF.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __Pyx_RefNannyFinishContext();
-  return NULL;
-  __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_5pysam_4cvcf_3VCF_83validate(__pyx_self, __pyx_v_self, __pyx_v_record);
-
-  /* function exit code */
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-
-static PyObject *__pyx_pf_5pysam_4cvcf_3VCF_83validate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_record) {
-  PyObject *__pyx_r = NULL;
-  __Pyx_RefNannyDeclarations
-  PyObject *__pyx_t_1 = NULL;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __Pyx_RefNannySetupContext("validate", 0);
-
-  /* "pysam/cvcf.pyx":1057
- *         '''
- * 
- *         raise NotImplementedError("needs to be checked")             # <<<<<<<<<<<<<<
- * 
- *         chrom, pos = record.chrom, record.pos
- */
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":1051
- *             parser = asVCFRecord(self))
- * 
- *     def validate(self, record):             # <<<<<<<<<<<<<<
- *         '''validate vcf record.
- * 
- */
-
-  /* function exit code */
-  __pyx_L1_error:;
-  __Pyx_XDECREF(__pyx_t_1);
-  __Pyx_AddTraceback("pysam.cvcf.VCF.validate", __pyx_clineno, __pyx_lineno, __pyx_filename);
-  __pyx_r = NULL;
-  __Pyx_XGIVEREF(__pyx_r);
-  __Pyx_RefNannyFinishContext();
-  return __pyx_r;
-}
-static struct __pyx_vtabstruct_5pysam_4cvcf_VCFRecord __pyx_vtable_5pysam_4cvcf_VCFRecord;
-
-static PyObject *__pyx_tp_new_5pysam_4cvcf_VCFRecord(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_4cvcf_VCFRecord *p;
-  PyObject *o = __pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_new(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_4cvcf_VCFRecord *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy*)__pyx_vtabptr_5pysam_4cvcf_VCFRecord;
-  p->vcf = Py_None; Py_INCREF(Py_None);
-  if (unlikely(__pyx_pw_5pysam_4cvcf_9VCFRecord_3__cinit__(o, a, k) < 0)) {
-    Py_DECREF(o); o = 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_4cvcf_VCFRecord(PyObject *o) {
-  struct __pyx_obj_5pysam_4cvcf_VCFRecord *p = (struct __pyx_obj_5pysam_4cvcf_VCFRecord *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->vcf);
-  PyObject_GC_Track(o);
-  if (likely(__pyx_ptype_5pysam_10TabProxies_TupleProxy)) __pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5pysam_4cvcf_VCFRecord);
-}
-
-static int __pyx_tp_traverse_5pysam_4cvcf_VCFRecord(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_4cvcf_VCFRecord *p = (struct __pyx_obj_5pysam_4cvcf_VCFRecord *)o;
-  e = ((likely(__pyx_ptype_5pysam_10TabProxies_TupleProxy)) ? ((__pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_traverse) ? __pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_4cvcf_VCFRecord)); if (e) return e;
-  if (p->vcf) {
-    e = (*v)(p->vcf, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_4cvcf_VCFRecord(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_4cvcf_VCFRecord *p = (struct __pyx_obj_5pysam_4cvcf_VCFRecord *)o;
-  if (likely(__pyx_ptype_5pysam_10TabProxies_TupleProxy)) { if (__pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_clear) __pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_4cvcf_VCFRecord);
-  tmp = ((PyObject*)p->vcf);
-  p->vcf = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-static PyObject *__pyx_sq_item_5pysam_4cvcf_VCFRecord(PyObject *o, Py_ssize_t i) {
-  PyObject *r;
-  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
-  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
-  Py_DECREF(x);
-  return r;
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_contig(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_6contig_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_pos(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_3pos_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_id(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_2id_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_ref(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_3ref_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_alt(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_3alt_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_qual(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_4qual_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_filter(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_6filter_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_info(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_4info_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_format(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_6format_1__get__(o);
-}
-
-static PyObject *__pyx_getprop_5pysam_4cvcf_9VCFRecord_samples(PyObject *o, CYTHON_UNUSED void *x) {
-  return __pyx_pw_5pysam_4cvcf_9VCFRecord_7samples_1__get__(o);
-}
-
-static PyMethodDef __pyx_methods_5pysam_4cvcf_VCFRecord[] = {
-  {__Pyx_NAMESTR("error"), (PyCFunction)__pyx_pw_5pysam_4cvcf_9VCFRecord_5error, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5pysam_4cvcf_9VCFRecord_4error)},
-  {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_5pysam_4cvcf_VCFRecord[] = {
-  {(char *)"contig", __pyx_getprop_5pysam_4cvcf_9VCFRecord_contig, 0, 0, 0},
-  {(char *)"pos", __pyx_getprop_5pysam_4cvcf_9VCFRecord_pos, 0, 0, 0},
-  {(char *)"id", __pyx_getprop_5pysam_4cvcf_9VCFRecord_id, 0, 0, 0},
-  {(char *)"ref", __pyx_getprop_5pysam_4cvcf_9VCFRecord_ref, 0, 0, 0},
-  {(char *)"alt", __pyx_getprop_5pysam_4cvcf_9VCFRecord_alt, 0, 0, 0},
-  {(char *)"qual", __pyx_getprop_5pysam_4cvcf_9VCFRecord_qual, 0, 0, 0},
-  {(char *)"filter", __pyx_getprop_5pysam_4cvcf_9VCFRecord_filter, 0, 0, 0},
-  {(char *)"info", __pyx_getprop_5pysam_4cvcf_9VCFRecord_info, 0, 0, 0},
-  {(char *)"format", __pyx_getprop_5pysam_4cvcf_9VCFRecord_format, 0, 0, 0},
-  {(char *)"samples", __pyx_getprop_5pysam_4cvcf_9VCFRecord_samples, 0, 0, 0},
-  {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_VCFRecord = {
-  __pyx_pw_5pysam_4cvcf_9VCFRecord_7__len__, /*sq_length*/
-  0, /*sq_concat*/
-  0, /*sq_repeat*/
-  __pyx_sq_item_5pysam_4cvcf_VCFRecord, /*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_VCFRecord = {
-  __pyx_pw_5pysam_4cvcf_9VCFRecord_7__len__, /*mp_length*/
-  __pyx_pw_5pysam_4cvcf_9VCFRecord_9__getitem__, /*mp_subscript*/
-  0, /*mp_ass_subscript*/
-};
-
-static PyTypeObject __pyx_type_5pysam_4cvcf_VCFRecord = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cvcf.VCFRecord"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_4cvcf_VCFRecord), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_4cvcf_VCFRecord, /*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*/
-  &__pyx_tp_as_sequence_VCFRecord, /*tp_as_sequence*/
-  &__pyx_tp_as_mapping_VCFRecord, /*tp_as_mapping*/
-  0, /*tp_hash*/
-  0, /*tp_call*/
-  0, /*tp_str*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("vcf record.\n\n    initialized from data and vcf meta \n    "), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_4cvcf_VCFRecord, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_4cvcf_VCFRecord, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_4cvcf_VCFRecord, /*tp_methods*/
-  0, /*tp_members*/
-  __pyx_getsets_5pysam_4cvcf_VCFRecord, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_4cvcf_9VCFRecord_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_4cvcf_VCFRecord, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-static struct __pyx_vtabstruct_5pysam_4cvcf_asVCFRecord __pyx_vtable_5pysam_4cvcf_asVCFRecord;
-
-static PyObject *__pyx_tp_new_5pysam_4cvcf_asVCFRecord(PyTypeObject *t, PyObject *a, PyObject *k) {
-  struct __pyx_obj_5pysam_4cvcf_asVCFRecord *p;
-  PyObject *o = __pyx_ptype_5pysam_6ctabix_Parser->tp_new(t, a, k);
-  if (unlikely(!o)) return 0;
-  p = ((struct __pyx_obj_5pysam_4cvcf_asVCFRecord *)o);
-  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_6ctabix_Parser*)__pyx_vtabptr_5pysam_4cvcf_asVCFRecord;
-  p->vcffile = Py_None; Py_INCREF(Py_None);
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_4cvcf_asVCFRecord(PyObject *o) {
-  struct __pyx_obj_5pysam_4cvcf_asVCFRecord *p = (struct __pyx_obj_5pysam_4cvcf_asVCFRecord *)o;
-  #if PY_VERSION_HEX >= 0x030400a1
-  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
-    if (PyObject_CallFinalizerFromDealloc(o)) return;
-  }
-  #endif
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->vcffile);
-  PyObject_GC_Track(o);
-  if (likely(__pyx_ptype_5pysam_6ctabix_Parser)) __pyx_ptype_5pysam_6ctabix_Parser->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5pysam_4cvcf_asVCFRecord);
-}
-
-static int __pyx_tp_traverse_5pysam_4cvcf_asVCFRecord(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_4cvcf_asVCFRecord *p = (struct __pyx_obj_5pysam_4cvcf_asVCFRecord *)o;
-  e = ((likely(__pyx_ptype_5pysam_6ctabix_Parser)) ? ((__pyx_ptype_5pysam_6ctabix_Parser->tp_traverse) ? __pyx_ptype_5pysam_6ctabix_Parser->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_4cvcf_asVCFRecord)); if (e) return e;
-  if (p->vcffile) {
-    e = (*v)(p->vcffile, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_4cvcf_asVCFRecord(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_4cvcf_asVCFRecord *p = (struct __pyx_obj_5pysam_4cvcf_asVCFRecord *)o;
-  if (likely(__pyx_ptype_5pysam_6ctabix_Parser)) { if (__pyx_ptype_5pysam_6ctabix_Parser->tp_clear) __pyx_ptype_5pysam_6ctabix_Parser->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_4cvcf_asVCFRecord);
-  tmp = ((PyObject*)p->vcffile);
-  p->vcffile = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyMethodDef __pyx_methods_5pysam_4cvcf_asVCFRecord[] = {
-  {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_5pysam_4cvcf_asVCFRecord = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cvcf.asVCFRecord"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_4cvcf_asVCFRecord), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_4cvcf_asVCFRecord, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  __Pyx_DOCSTR("converts a :term:`tabix row` into a VCF record."), /*tp_doc*/
-  __pyx_tp_traverse_5pysam_4cvcf_asVCFRecord, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_4cvcf_asVCFRecord, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  __pyx_methods_5pysam_4cvcf_asVCFRecord, /*tp_methods*/
-  0, /*tp_members*/
-  0, /*tp_getset*/
-  0, /*tp_base*/
-  0, /*tp_dict*/
-  0, /*tp_descr_get*/
-  0, /*tp_descr_set*/
-  0, /*tp_dictoffset*/
-  __pyx_pw_5pysam_4cvcf_11asVCFRecord_1__init__, /*tp_init*/
-  0, /*tp_alloc*/
-  __pyx_tp_new_5pysam_4cvcf_asVCFRecord, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *__pyx_freelist_5pysam_4cvcf___pyx_scope_struct___parse[8];
-static int __pyx_freecount_5pysam_4cvcf___pyx_scope_struct___parse = 0;
-
-static PyObject *__pyx_tp_new_5pysam_4cvcf___pyx_scope_struct___parse(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
-  PyObject *o;
-  if (likely((__pyx_freecount_5pysam_4cvcf___pyx_scope_struct___parse > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse)))) {
-    o = (PyObject*)__pyx_freelist_5pysam_4cvcf___pyx_scope_struct___parse[--__pyx_freecount_5pysam_4cvcf___pyx_scope_struct___parse];
-    memset(o, 0, sizeof(struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse));
-    (void) PyObject_INIT(o, t);
-    PyObject_GC_Track(o);
-  } else {
-    o = (*t->tp_alloc)(t, 0);
-    if (unlikely(!o)) return 0;
-  }
-  return o;
-}
-
-static void __pyx_tp_dealloc_5pysam_4cvcf___pyx_scope_struct___parse(PyObject *o) {
-  struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *p = (struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *)o;
-  PyObject_GC_UnTrack(o);
-  Py_CLEAR(p->__pyx_v_d);
-  Py_CLEAR(p->__pyx_v_line);
-  Py_CLEAR(p->__pyx_v_self);
-  Py_CLEAR(p->__pyx_v_stream);
-  Py_CLEAR(p->__pyx_t_1);
-  if ((__pyx_freecount_5pysam_4cvcf___pyx_scope_struct___parse < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse))) {
-    __pyx_freelist_5pysam_4cvcf___pyx_scope_struct___parse[__pyx_freecount_5pysam_4cvcf___pyx_scope_struct___parse++] = ((struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *)o);
-  } else {
-    (*Py_TYPE(o)->tp_free)(o);
-  }
-}
-
-static int __pyx_tp_traverse_5pysam_4cvcf___pyx_scope_struct___parse(PyObject *o, visitproc v, void *a) {
-  int e;
-  struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *p = (struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *)o;
-  if (p->__pyx_v_d) {
-    e = (*v)(p->__pyx_v_d, a); if (e) return e;
-  }
-  if (p->__pyx_v_line) {
-    e = (*v)(p->__pyx_v_line, a); if (e) return e;
-  }
-  if (p->__pyx_v_self) {
-    e = (*v)(p->__pyx_v_self, a); if (e) return e;
-  }
-  if (p->__pyx_v_stream) {
-    e = (*v)(p->__pyx_v_stream, a); if (e) return e;
-  }
-  if (p->__pyx_t_1) {
-    e = (*v)(p->__pyx_t_1, a); if (e) return e;
-  }
-  return 0;
-}
-
-static int __pyx_tp_clear_5pysam_4cvcf___pyx_scope_struct___parse(PyObject *o) {
-  PyObject* tmp;
-  struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *p = (struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse *)o;
-  tmp = ((PyObject*)p->__pyx_v_d);
-  p->__pyx_v_d = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->__pyx_v_line);
-  p->__pyx_v_line = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->__pyx_v_self);
-  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->__pyx_v_stream);
-  p->__pyx_v_stream = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  tmp = ((PyObject*)p->__pyx_t_1);
-  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
-  Py_XDECREF(tmp);
-  return 0;
-}
-
-static PyTypeObject __pyx_type_5pysam_4cvcf___pyx_scope_struct___parse = {
-  PyVarObject_HEAD_INIT(0, 0)
-  __Pyx_NAMESTR("pysam.cvcf.__pyx_scope_struct___parse"), /*tp_name*/
-  sizeof(struct __pyx_obj_5pysam_4cvcf___pyx_scope_struct___parse), /*tp_basicsize*/
-  0, /*tp_itemsize*/
-  __pyx_tp_dealloc_5pysam_4cvcf___pyx_scope_struct___parse, /*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*/
-  0, /*tp_getattro*/
-  0, /*tp_setattro*/
-  0, /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  0, /*tp_doc*/
-  __pyx_tp_traverse_5pysam_4cvcf___pyx_scope_struct___parse, /*tp_traverse*/
-  __pyx_tp_clear_5pysam_4cvcf___pyx_scope_struct___parse, /*tp_clear*/
-  0, /*tp_richcompare*/
-  0, /*tp_weaklistoffset*/
-  0, /*tp_iter*/
-  0, /*tp_iternext*/
-  0, /*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_5pysam_4cvcf___pyx_scope_struct___parse, /*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
-  #if PY_VERSION_HEX >= 0x030400a1
-  0, /*tp_finalize*/
-  #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
-  {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
-  #if PY_VERSION_HEX < 0x03020000
-    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
-  #else
-    PyModuleDef_HEAD_INIT,
-  #endif
-    __Pyx_NAMESTR("cvcf"),
-    0, /* m_doc */
-    -1, /* m_size */
-    __pyx_methods /* m_methods */,
-    NULL, /* m_reload */
-    NULL, /* m_traverse */
-    NULL, /* m_clear */
-    NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
-  {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
-  {&__pyx_kp_b_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 0, 0},
-  {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0},
-  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
-  {&__pyx_n_s_ACGTN, __pyx_k_ACGTN, sizeof(__pyx_k_ACGTN), 0, 0, 1, 1},
-  {&__pyx_kp_s_ACGTN_2, __pyx_k_ACGTN_2, sizeof(__pyx_k_ACGTN_2), 0, 0, 1, 0},
-  {&__pyx_n_s_ALT, __pyx_k_ALT, sizeof(__pyx_k_ALT), 0, 0, 1, 1},
-  {&__pyx_n_s_BADLY_FORMATTED_FORMAT_STRING, __pyx_k_BADLY_FORMATTED_FORMAT_STRING, sizeof(__pyx_k_BADLY_FORMATTED_FORMAT_STRING), 0, 0, 1, 1},
-  {&__pyx_kp_s_BADLY_FORMATTED_FORMAT_STRING_Fo, __pyx_k_BADLY_FORMATTED_FORMAT_STRING_Fo, sizeof(__pyx_k_BADLY_FORMATTED_FORMAT_STRING_Fo), 0, 0, 1, 0},
-  {&__pyx_n_s_BADLY_FORMATTED_HEADING, __pyx_k_BADLY_FORMATTED_HEADING, sizeof(__pyx_k_BADLY_FORMATTED_HEADING), 0, 0, 1, 1},
-  {&__pyx_kp_s_BADLY_FORMATTED_HEADING_Did_not, __pyx_k_BADLY_FORMATTED_HEADING_Did_not, sizeof(__pyx_k_BADLY_FORMATTED_HEADING_Did_not), 0, 0, 1, 0},
-  {&__pyx_kp_s_BAD_CHR_TAG_Error_calculating_ch, __pyx_k_BAD_CHR_TAG_Error_calculating_ch, sizeof(__pyx_k_BAD_CHR_TAG_Error_calculating_ch), 0, 0, 1, 0},
-  {&__pyx_n_s_BAD_GENOTYPE, __pyx_k_BAD_GENOTYPE, sizeof(__pyx_k_BAD_GENOTYPE), 0, 0, 1, 1},
-  {&__pyx_kp_s_BAD_GENOTYPE_Cannot_parse_genoty, __pyx_k_BAD_GENOTYPE_Cannot_parse_genoty, sizeof(__pyx_k_BAD_GENOTYPE_Cannot_parse_genoty), 0, 0, 1, 0},
-  {&__pyx_n_s_BAD_NUMBER_OF_COLUMNS, __pyx_k_BAD_NUMBER_OF_COLUMNS, sizeof(__pyx_k_BAD_NUMBER_OF_COLUMNS), 0, 0, 1, 1},
-  {&__pyx_kp_s_BAD_NUMBER_OF_COLUMNS_Wrong_numb, __pyx_k_BAD_NUMBER_OF_COLUMNS_Wrong_numb, sizeof(__pyx_k_BAD_NUMBER_OF_COLUMNS_Wrong_numb), 0, 0, 1, 0},
-  {&__pyx_n_s_BAD_NUMBER_OF_PARAMETERS, __pyx_k_BAD_NUMBER_OF_PARAMETERS, sizeof(__pyx_k_BAD_NUMBER_OF_PARAMETERS), 0, 0, 1, 1},
-  {&__pyx_kp_s_BAD_NUMBER_OF_PARAMETERS_Found_u, __pyx_k_BAD_NUMBER_OF_PARAMETERS_Found_u, sizeof(__pyx_k_BAD_NUMBER_OF_PARAMETERS_Found_u), 0, 0, 1, 0},
-  {&__pyx_n_s_BAD_NUMBER_OF_VALUES, __pyx_k_BAD_NUMBER_OF_VALUES, sizeof(__pyx_k_BAD_NUMBER_OF_VALUES), 0, 0, 1, 1},
-  {&__pyx_kp_s_BAD_NUMBER_OF_VALUES_Found_too_m, __pyx_k_BAD_NUMBER_OF_VALUES_Found_too_m, sizeof(__pyx_k_BAD_NUMBER_OF_VALUES_Found_too_m), 0, 0, 1, 0},
-  {&__pyx_n_s_CHROM, __pyx_k_CHROM, sizeof(__pyx_k_CHROM), 0, 0, 1, 1},
-  {&__pyx_kp_s_Can_only_handle_v3_3_and_v4_0_VC, __pyx_k_Can_only_handle_v3_3_and_v4_0_VC, sizeof(__pyx_k_Can_only_handle_v3_3_and_v4_0_VC), 0, 0, 1, 0},
-  {&__pyx_n_s_Character, __pyx_k_Character, sizeof(__pyx_k_Character), 0, 0, 1, 1},
-  {&__pyx_kp_s_Conditional_genotype_quality, __pyx_k_Conditional_genotype_quality, sizeof(__pyx_k_Conditional_genotype_quality), 0, 0, 1, 0},
-  {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1},
-  {&__pyx_n_s_DP, __pyx_k_DP, sizeof(__pyx_k_DP), 0, 0, 1, 1},
-  {&__pyx_kp_s_Description, __pyx_k_Description, sizeof(__pyx_k_Description), 0, 0, 1, 0},
-  {&__pyx_n_s_Description_2, __pyx_k_Description_2, sizeof(__pyx_k_Description_2), 0, 0, 1, 1},
-  {&__pyx_kp_s_Don_t_understand_region_string_s, __pyx_k_Don_t_understand_region_string_s, sizeof(__pyx_k_Don_t_understand_region_string_s), 0, 0, 1, 0},
-  {&__pyx_n_s_EC, __pyx_k_EC, sizeof(__pyx_k_EC), 0, 0, 1, 1},
-  {&__pyx_n_s_ERROR_FLAG_HAS_VALUE, __pyx_k_ERROR_FLAG_HAS_VALUE, sizeof(__pyx_k_ERROR_FLAG_HAS_VALUE), 0, 0, 1, 1},
-  {&__pyx_kp_s_ERROR_FLAG_HAS_VALUE_Flag_fields, __pyx_k_ERROR_FLAG_HAS_VALUE_Flag_fields, sizeof(__pyx_k_ERROR_FLAG_HAS_VALUE_Flag_fields), 0, 0, 1, 0},
-  {&__pyx_n_s_ERROR_FORMAT_NOT_CHAR, __pyx_k_ERROR_FORMAT_NOT_CHAR, sizeof(__pyx_k_ERROR_FORMAT_NOT_CHAR), 0, 0, 1, 1},
-  {&__pyx_kp_s_ERROR_FORMAT_NOT_CHAR_Eexpected, __pyx_k_ERROR_FORMAT_NOT_CHAR_Eexpected, sizeof(__pyx_k_ERROR_FORMAT_NOT_CHAR_Eexpected), 0, 0, 1, 0},
-  {&__pyx_n_s_ERROR_FORMAT_NOT_INTEGER, __pyx_k_ERROR_FORMAT_NOT_INTEGER, sizeof(__pyx_k_ERROR_FORMAT_NOT_INTEGER), 0, 0, 1, 1},
-  {&__pyx_kp_s_ERROR_FORMAT_NOT_INTEGER_Expecte, __pyx_k_ERROR_FORMAT_NOT_INTEGER_Expecte, sizeof(__pyx_k_ERROR_FORMAT_NOT_INTEGER_Expecte), 0, 0, 1, 0},
-  {&__pyx_n_s_ERROR_FORMAT_NOT_NUMERICAL, __pyx_k_ERROR_FORMAT_NOT_NUMERICAL, sizeof(__pyx_k_ERROR_FORMAT_NOT_NUMERICAL), 0, 0, 1, 1},
-  {&__pyx_kp_s_ERROR_FORMAT_NOT_NUMERICAL_Expec, __pyx_k_ERROR_FORMAT_NOT_NUMERICAL_Expec, sizeof(__pyx_k_ERROR_FORMAT_NOT_NUMERICAL_Expec), 0, 0, 1, 0},
-  {&__pyx_n_s_ERROR_INFO_STRING, __pyx_k_ERROR_INFO_STRING, sizeof(__pyx_k_ERROR_INFO_STRING), 0, 0, 1, 1},
-  {&__pyx_kp_s_ERROR_INFO_STRING_Error_while_pa, __pyx_k_ERROR_INFO_STRING_Error_while_pa, sizeof(__pyx_k_ERROR_INFO_STRING_Error_while_pa), 0, 0, 1, 0},
-  {&__pyx_n_s_ERROR_TRAILING_DATA, __pyx_k_ERROR_TRAILING_DATA, sizeof(__pyx_k_ERROR_TRAILING_DATA), 0, 0, 1, 1},
-  {&__pyx_kp_s_ERROR_TRAILING_DATA_Numerical_fi, __pyx_k_ERROR_TRAILING_DATA_Numerical_fi, sizeof(__pyx_k_ERROR_TRAILING_DATA_Numerical_fi), 0, 0, 1, 0},
-  {&__pyx_n_s_ERROR_UNKNOWN_KEY, __pyx_k_ERROR_UNKNOWN_KEY, sizeof(__pyx_k_ERROR_UNKNOWN_KEY), 0, 0, 1, 1},
-  {&__pyx_kp_s_ERROR_UNKNOWN_KEY_Unknown_key_s, __pyx_k_ERROR_UNKNOWN_KEY_Unknown_key_s, sizeof(__pyx_k_ERROR_UNKNOWN_KEY_Unknown_key_s), 0, 0, 1, 0},
-  {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1},
-  {&__pyx_kp_s_Expected_alternate_allel_counts, __pyx_k_Expected_alternate_allel_counts, sizeof(__pyx_k_Expected_alternate_allel_counts), 0, 0, 1, 0},
-  {&__pyx_n_s_FILTER, __pyx_k_FILTER, sizeof(__pyx_k_FILTER), 0, 0, 1, 1},
-  {&__pyx_n_s_FILTER_NOT_DEFINED, __pyx_k_FILTER_NOT_DEFINED, sizeof(__pyx_k_FILTER_NOT_DEFINED), 0, 0, 1, 1},
-  {&__pyx_kp_s_FILTER_NOT_DEFINED_Identifier_s, __pyx_k_FILTER_NOT_DEFINED_Identifier_s, sizeof(__pyx_k_FILTER_NOT_DEFINED_Identifier_s), 0, 0, 1, 0},
-  {&__pyx_n_s_FORMAT, __pyx_k_FORMAT, sizeof(__pyx_k_FORMAT), 0, 0, 1, 1},
-  {&__pyx_n_s_FORMAT_MISSING_QUOTES, __pyx_k_FORMAT_MISSING_QUOTES, sizeof(__pyx_k_FORMAT_MISSING_QUOTES), 0, 0, 1, 1},
-  {&__pyx_kp_s_FORMAT_MISSING_QUOTES_Descriptio, __pyx_k_FORMAT_MISSING_QUOTES_Descriptio, sizeof(__pyx_k_FORMAT_MISSING_QUOTES_Descriptio), 0, 0, 1, 0},
-  {&__pyx_n_s_FORMAT_NOT_DEFINED, __pyx_k_FORMAT_NOT_DEFINED, sizeof(__pyx_k_FORMAT_NOT_DEFINED), 0, 0, 1, 1},
-  {&__pyx_kp_s_FORMAT_NOT_DEFINED_Identifier_s, __pyx_k_FORMAT_NOT_DEFINED_Identifier_s, sizeof(__pyx_k_FORMAT_NOT_DEFINED_Identifier_s), 0, 0, 1, 0},
-  {&__pyx_n_s_FT, __pyx_k_FT, sizeof(__pyx_k_FT), 0, 0, 1, 1},
-  {&__pyx_n_s_Flag, __pyx_k_Flag, sizeof(__pyx_k_Flag), 0, 0, 1, 1},
-  {&__pyx_n_s_Float, __pyx_k_Float, sizeof(__pyx_k_Float), 0, 0, 1, 1},
-  {&__pyx_n_s_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 0, 1, 1},
-  {&__pyx_n_s_GL, __pyx_k_GL, sizeof(__pyx_k_GL), 0, 0, 1, 1},
-  {&__pyx_n_s_GLE, __pyx_k_GLE, sizeof(__pyx_k_GLE), 0, 0, 1, 1},
-  {&__pyx_n_s_GP, __pyx_k_GP, sizeof(__pyx_k_GP), 0, 0, 1, 1},
-  {&__pyx_n_s_GQ, __pyx_k_GQ, sizeof(__pyx_k_GQ), 0, 0, 1, 1},
-  {&__pyx_n_s_GT, __pyx_k_GT, sizeof(__pyx_k_GT), 0, 0, 1, 1},
-  {&__pyx_n_s_GTdata, __pyx_k_GTdata, sizeof(__pyx_k_GTdata), 0, 0, 1, 1},
-  {&__pyx_n_s_GTstring, __pyx_k_GTstring, sizeof(__pyx_k_GTstring), 0, 0, 1, 1},
-  {&__pyx_n_s_Genotype, __pyx_k_Genotype, sizeof(__pyx_k_Genotype), 0, 0, 1, 1},
-  {&__pyx_kp_s_Genotype_Quality, __pyx_k_Genotype_Quality, sizeof(__pyx_k_Genotype_Quality), 0, 0, 1, 0},
-  {&__pyx_kp_s_Genotype_likelihoods, __pyx_k_Genotype_likelihoods, sizeof(__pyx_k_Genotype_likelihoods), 0, 0, 1, 0},
-  {&__pyx_kp_s_Genotype_posterior_probabilities, __pyx_k_Genotype_posterior_probabilities, sizeof(__pyx_k_Genotype_posterior_probabilities), 0, 0, 1, 0},
-  {&__pyx_n_s_HEADING_NOT_SEPARATED_BY_TABS, __pyx_k_HEADING_NOT_SEPARATED_BY_TABS, sizeof(__pyx_k_HEADING_NOT_SEPARATED_BY_TABS), 0, 0, 1, 1},
-  {&__pyx_kp_s_HEADING_NOT_SEPARATED_BY_TABS_He, __pyx_k_HEADING_NOT_SEPARATED_BY_TABS_He, sizeof(__pyx_k_HEADING_NOT_SEPARATED_BY_TABS_He), 0, 0, 1, 0},
-  {&__pyx_n_s_HQ, __pyx_k_HQ, sizeof(__pyx_k_HQ), 0, 0, 1, 1},
-  {&__pyx_kp_s_Haplotype_Quality, __pyx_k_Haplotype_Quality, sizeof(__pyx_k_Haplotype_Quality), 0, 0, 1, 0},
-  {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1},
-  {&__pyx_kp_s_ID, __pyx_k_ID, sizeof(__pyx_k_ID), 0, 0, 1, 0},
-  {&__pyx_n_s_ID_2, __pyx_k_ID_2, sizeof(__pyx_k_ID_2), 0, 0, 1, 1},
-  {&__pyx_n_s_INFO, __pyx_k_INFO, sizeof(__pyx_k_INFO), 0, 0, 1, 1},
-  {&__pyx_n_s_Integer, __pyx_k_Integer, sizeof(__pyx_k_Integer), 0, 0, 1, 1},
-  {&__pyx_kp_s_Invalid_error_string_s, __pyx_k_Invalid_error_string_s, sizeof(__pyx_k_Invalid_error_string_s), 0, 0, 1, 0},
-  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
-  {&__pyx_n_s_MISSING_INDEL_ALLELE_REF_BASE, __pyx_k_MISSING_INDEL_ALLELE_REF_BASE, sizeof(__pyx_k_MISSING_INDEL_ALLELE_REF_BASE), 0, 0, 1, 1},
-  {&__pyx_kp_s_MISSING_INDEL_ALLELE_REF_BASE_In, __pyx_k_MISSING_INDEL_ALLELE_REF_BASE_In, sizeof(__pyx_k_MISSING_INDEL_ALLELE_REF_BASE_In), 0, 0, 1, 0},
-  {&__pyx_n_s_MISSING_REF, __pyx_k_MISSING_REF, sizeof(__pyx_k_MISSING_REF), 0, 0, 1, 1},
-  {&__pyx_kp_s_MISSING_REF_Reference_allele_mis, __pyx_k_MISSING_REF_Reference_allele_mis, sizeof(__pyx_k_MISSING_REF_Reference_allele_mis), 0, 0, 1, 0},
-  {&__pyx_n_s_MQ, __pyx_k_MQ, sizeof(__pyx_k_MQ), 0, 0, 1, 1},
-  {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
-  {&__pyx_n_s_NT_ALLELES, __pyx_k_NT_ALLELES, sizeof(__pyx_k_NT_ALLELES), 0, 0, 1, 1},
-  {&__pyx_n_s_NT_GENOTYPES, __pyx_k_NT_GENOTYPES, sizeof(__pyx_k_NT_GENOTYPES), 0, 0, 1, 1},
-  {&__pyx_n_s_NT_NR_ALLELES, __pyx_k_NT_NR_ALLELES, sizeof(__pyx_k_NT_NR_ALLELES), 0, 0, 1, 1},
-  {&__pyx_n_s_NT_NUMBER, __pyx_k_NT_NUMBER, sizeof(__pyx_k_NT_NUMBER), 0, 0, 1, 1},
-  {&__pyx_n_s_NT_PHASED_GENOTYPES, __pyx_k_NT_PHASED_GENOTYPES, sizeof(__pyx_k_NT_PHASED_GENOTYPES), 0, 0, 1, 1},
-  {&__pyx_n_s_NT_UNKNOWN, __pyx_k_NT_UNKNOWN, sizeof(__pyx_k_NT_UNKNOWN), 0, 0, 1, 1},
-  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
-  {&__pyx_kp_s_Number, __pyx_k_Number, sizeof(__pyx_k_Number), 0, 0, 1, 0},
-  {&__pyx_n_s_Number_2, __pyx_k_Number_2, sizeof(__pyx_k_Number_2), 0, 0, 1, 1},
-  {&__pyx_n_b_PASS, __pyx_k_PASS, sizeof(__pyx_k_PASS), 0, 0, 0, 1},
-  {&__pyx_n_s_PASS, __pyx_k_PASS, sizeof(__pyx_k_PASS), 0, 0, 1, 1},
-  {&__pyx_n_s_PL, __pyx_k_PL, sizeof(__pyx_k_PL), 0, 0, 1, 1},
-  {&__pyx_n_s_POS, __pyx_k_POS, sizeof(__pyx_k_POS), 0, 0, 1, 1},
-  {&__pyx_n_s_POS_NOT_NUMERICAL, __pyx_k_POS_NOT_NUMERICAL, sizeof(__pyx_k_POS_NOT_NUMERICAL), 0, 0, 1, 1},
-  {&__pyx_kp_s_POS_NOT_NUMERICAL_Position_colum, __pyx_k_POS_NOT_NUMERICAL_Position_colum, sizeof(__pyx_k_POS_NOT_NUMERICAL_Position_colum), 0, 0, 1, 0},
-  {&__pyx_n_s_POS_NOT_POSITIVE, __pyx_k_POS_NOT_POSITIVE, sizeof(__pyx_k_POS_NOT_POSITIVE), 0, 0, 1, 1},
-  {&__pyx_kp_s_POS_NOT_POSITIVE_Position_field, __pyx_k_POS_NOT_POSITIVE_Position_field, sizeof(__pyx_k_POS_NOT_POSITIVE_Position_field), 0, 0, 1, 0},
-  {&__pyx_n_s_PQ, __pyx_k_PQ, sizeof(__pyx_k_PQ), 0, 0, 1, 1},
-  {&__pyx_n_s_PS, __pyx_k_PS, sizeof(__pyx_k_PS), 0, 0, 1, 1},
-  {&__pyx_kp_s_Phase_set, __pyx_k_Phase_set, sizeof(__pyx_k_Phase_set), 0, 0, 1, 0},
-  {&__pyx_kp_s_Phasing_quality, __pyx_k_Phasing_quality, sizeof(__pyx_k_Phasing_quality), 0, 0, 1, 0},
-  {&__pyx_kp_s_Phred_scaled_genotype_likelihood, __pyx_k_Phred_scaled_genotype_likelihood, sizeof(__pyx_k_Phred_scaled_genotype_likelihood), 0, 0, 1, 0},
-  {&__pyx_n_s_QUAL, __pyx_k_QUAL, sizeof(__pyx_k_QUAL), 0, 0, 1, 1},
-  {&__pyx_n_s_QUAL_NOT_NUMERICAL, __pyx_k_QUAL_NOT_NUMERICAL, sizeof(__pyx_k_QUAL_NOT_NUMERICAL), 0, 0, 1, 1},
-  {&__pyx_kp_s_QUAL_NOT_NUMERICAL_Quality_field, __pyx_k_QUAL_NOT_NUMERICAL_Quality_field, sizeof(__pyx_k_QUAL_NOT_NUMERICAL_Quality_field), 0, 0, 1, 0},
-  {&__pyx_n_s_REF, __pyx_k_REF, sizeof(__pyx_k_REF), 0, 0, 1, 1},
-  {&__pyx_kp_s_RMS_mapping_quality, __pyx_k_RMS_mapping_quality, sizeof(__pyx_k_RMS_mapping_quality), 0, 0, 1, 0},
-  {&__pyx_kp_s_Read_depth_at_this_position_for, __pyx_k_Read_depth_at_this_position_for, sizeof(__pyx_k_Read_depth_at_this_position_for), 0, 0, 1, 0},
-  {&__pyx_kp_s_Required_key_s_not_found_in_data, __pyx_k_Required_key_s_not_found_in_data, sizeof(__pyx_k_Required_key_s_not_found_in_data), 0, 0, 1, 0},
-  {&__pyx_kp_s_Sample_Genotype_Filter, __pyx_k_Sample_Genotype_Filter, sizeof(__pyx_k_Sample_Genotype_Filter), 0, 0, 1, 0},
-  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
-  {&__pyx_n_s_String, __pyx_k_String, sizeof(__pyx_k_String), 0, 0, 1, 1},
-  {&__pyx_n_s_Tabixfile, __pyx_k_Tabixfile, sizeof(__pyx_k_Tabixfile), 0, 0, 1, 1},
-  {&__pyx_kp_s_Type, __pyx_k_Type, sizeof(__pyx_k_Type), 0, 0, 1, 0},
-  {&__pyx_n_s_Type_2, __pyx_k_Type_2, sizeof(__pyx_k_Type_2), 0, 0, 1, 1},
-  {&__pyx_n_s_UNKNOWN_CHAR_IN_REF, __pyx_k_UNKNOWN_CHAR_IN_REF, sizeof(__pyx_k_UNKNOWN_CHAR_IN_REF), 0, 0, 1, 1},
-  {&__pyx_kp_s_UNKNOWN_CHAR_IN_REF_Unknown_char, __pyx_k_UNKNOWN_CHAR_IN_REF_Unknown_char, sizeof(__pyx_k_UNKNOWN_CHAR_IN_REF_Unknown_char), 0, 0, 1, 0},
-  {&__pyx_n_s_UNKNOWN_FORMAT_STRING, __pyx_k_UNKNOWN_FORMAT_STRING, sizeof(__pyx_k_UNKNOWN_FORMAT_STRING), 0, 0, 1, 1},
-  {&__pyx_kp_s_UNKNOWN_FORMAT_STRING_Unknown_fi, __pyx_k_UNKNOWN_FORMAT_STRING_Unknown_fi, sizeof(__pyx_k_UNKNOWN_FORMAT_STRING_Unknown_fi), 0, 0, 1, 0},
-  {&__pyx_kp_s_Undefined_tag, __pyx_k_Undefined_tag, sizeof(__pyx_k_Undefined_tag), 0, 0, 1, 0},
-  {&__pyx_kp_s_Unknown_number_type_encountered, __pyx_k_Unknown_number_type_encountered, sizeof(__pyx_k_Unknown_number_type_encountered), 0, 0, 1, 0},
-  {&__pyx_n_s_V33_BAD_ALLELE, __pyx_k_V33_BAD_ALLELE, sizeof(__pyx_k_V33_BAD_ALLELE), 0, 0, 1, 1},
-  {&__pyx_kp_s_V33_BAD_ALLELE_Cannot_interpret, __pyx_k_V33_BAD_ALLELE_Cannot_interpret, sizeof(__pyx_k_V33_BAD_ALLELE_Cannot_interpret), 0, 0, 1, 0},
-  {&__pyx_n_s_V33_BAD_REF, __pyx_k_V33_BAD_REF, sizeof(__pyx_k_V33_BAD_REF), 0, 0, 1, 1},
-  {&__pyx_kp_s_V33_BAD_REF_Reference_should_be, __pyx_k_V33_BAD_REF_Reference_should_be, sizeof(__pyx_k_V33_BAD_REF_Reference_should_be), 0, 0, 1, 0},
-  {&__pyx_n_s_V33_UNMATCHED_DELETION, __pyx_k_V33_UNMATCHED_DELETION, sizeof(__pyx_k_V33_UNMATCHED_DELETION), 0, 0, 1, 1},
-  {&__pyx_kp_s_V33_UNMATCHED_DELETION_Deleted_s, __pyx_k_V33_UNMATCHED_DELETION_Deleted_s, sizeof(__pyx_k_V33_UNMATCHED_DELETION_Deleted_s), 0, 0, 1, 0},
-  {&__pyx_n_s_V40_BAD_ALLELE, __pyx_k_V40_BAD_ALLELE, sizeof(__pyx_k_V40_BAD_ALLELE), 0, 0, 1, 1},
-  {&__pyx_kp_s_V40_BAD_ALLELE_Bad_allele_found, __pyx_k_V40_BAD_ALLELE_Bad_allele_found, sizeof(__pyx_k_V40_BAD_ALLELE_Bad_allele_found), 0, 0, 1, 0},
-  {&__pyx_n_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD, __pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD, sizeof(__pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD), 0, 0, 1, 1},
-  {&__pyx_kp_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2, __pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2, sizeof(__pyx_k_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2), 0, 0, 1, 0},
-  {&__pyx_n_s_V40_MISSING_ANGLE_BRACKETS, __pyx_k_V40_MISSING_ANGLE_BRACKETS, sizeof(__pyx_k_V40_MISSING_ANGLE_BRACKETS), 0, 0, 1, 1},
-  {&__pyx_kp_s_V40_MISSING_ANGLE_BRACKETS_Forma, __pyx_k_V40_MISSING_ANGLE_BRACKETS_Forma, sizeof(__pyx_k_V40_MISSING_ANGLE_BRACKETS_Forma), 0, 0, 1, 0},
-  {&__pyx_n_s_VCF, __pyx_k_VCF, sizeof(__pyx_k_VCF), 0, 0, 1, 1},
-  {&__pyx_n_s_VCFRecord, __pyx_k_VCFRecord, sizeof(__pyx_k_VCFRecord), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF___init, __pyx_k_VCF___init, sizeof(__pyx_k_VCF___init), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF__add_definition, __pyx_k_VCF__add_definition, sizeof(__pyx_k_VCF__add_definition), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF__parse, __pyx_k_VCF__parse, sizeof(__pyx_k_VCF__parse), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF__parse_header, __pyx_k_VCF__parse_header, sizeof(__pyx_k_VCF__parse_header), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_compare_calls, __pyx_k_VCF_compare_calls, sizeof(__pyx_k_VCF_compare_calls), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_connect, __pyx_k_VCF_connect, sizeof(__pyx_k_VCF_connect), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_convertGT, __pyx_k_VCF_convertGT, sizeof(__pyx_k_VCF_convertGT), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_convertGTback, __pyx_k_VCF_convertGTback, sizeof(__pyx_k_VCF_convertGTback), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_enter_default_format, __pyx_k_VCF_enter_default_format, sizeof(__pyx_k_VCF_enter_default_format), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_error, __pyx_k_VCF_error, sizeof(__pyx_k_VCF_error), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_fetch, __pyx_k_VCF_fetch, sizeof(__pyx_k_VCF_fetch), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_format_format, __pyx_k_VCF_format_format, sizeof(__pyx_k_VCF_format_format), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_format_formatdata, __pyx_k_VCF_format_formatdata, sizeof(__pyx_k_VCF_format_formatdata), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_get_expected, __pyx_k_VCF_get_expected, sizeof(__pyx_k_VCF_get_expected), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_getfilter, __pyx_k_VCF_getfilter, sizeof(__pyx_k_VCF_getfilter), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_getformat, __pyx_k_VCF_getformat, sizeof(__pyx_k_VCF_getformat), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_getheader, __pyx_k_VCF_getheader, sizeof(__pyx_k_VCF_getheader), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_getinfo, __pyx_k_VCF_getinfo, sizeof(__pyx_k_VCF_getinfo), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_getsamples, __pyx_k_VCF_getsamples, sizeof(__pyx_k_VCF_getsamples), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_ignoreerror, __pyx_k_VCF_ignoreerror, sizeof(__pyx_k_VCF_ignoreerror), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_inregion, __pyx_k_VCF_inregion, sizeof(__pyx_k_VCF_inregion), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_parse, __pyx_k_VCF_parse, sizeof(__pyx_k_VCF_parse), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_parse_data, __pyx_k_VCF_parse_data, sizeof(__pyx_k_VCF_parse_data), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_parse_format, __pyx_k_VCF_parse_format, sizeof(__pyx_k_VCF_parse_format), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_parse_formatdata, __pyx_k_VCF_parse_formatdata, sizeof(__pyx_k_VCF_parse_formatdata), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_parse_header, __pyx_k_VCF_parse_header, sizeof(__pyx_k_VCF_parse_header), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_parse_heading, __pyx_k_VCF_parse_heading, sizeof(__pyx_k_VCF_parse_heading), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_setfilter, __pyx_k_VCF_setfilter, sizeof(__pyx_k_VCF_setfilter), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_setformat, __pyx_k_VCF_setformat, sizeof(__pyx_k_VCF_setformat), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_setheader, __pyx_k_VCF_setheader, sizeof(__pyx_k_VCF_setheader), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_setinfo, __pyx_k_VCF_setinfo, sizeof(__pyx_k_VCF_setinfo), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_setreference, __pyx_k_VCF_setreference, sizeof(__pyx_k_VCF_setreference), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_setregions, __pyx_k_VCF_setregions, sizeof(__pyx_k_VCF_setregions), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_setsamples, __pyx_k_VCF_setsamples, sizeof(__pyx_k_VCF_setsamples), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_setversion, __pyx_k_VCF_setversion, sizeof(__pyx_k_VCF_setversion), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_validate, __pyx_k_VCF_validate, sizeof(__pyx_k_VCF_validate), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_warnerror, __pyx_k_VCF_warnerror, sizeof(__pyx_k_VCF_warnerror), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_write, __pyx_k_VCF_write, sizeof(__pyx_k_VCF_write), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_write_data, __pyx_k_VCF_write_data, sizeof(__pyx_k_VCF_write_data), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_write_header, __pyx_k_VCF_write_header, sizeof(__pyx_k_VCF_write_header), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_write_heading, __pyx_k_VCF_write_heading, sizeof(__pyx_k_VCF_write_heading), 0, 0, 1, 1},
-  {&__pyx_n_s_VCF_writeheader, __pyx_k_VCF_writeheader, sizeof(__pyx_k_VCF_writeheader), 0, 0, 1, 1},
-  {&__pyx_kp_s_VCFv3_3, __pyx_k_VCFv3_3, sizeof(__pyx_k_VCFv3_3), 0, 0, 1, 0},
-  {&__pyx_kp_s_VCFv4_0, __pyx_k_VCFv4_0, sizeof(__pyx_k_VCFv4_0), 0, 0, 1, 0},
-  {&__pyx_kp_s_VCFv4_1, __pyx_k_VCFv4_1, sizeof(__pyx_k_VCFv4_1), 0, 0, 1, 0},
-  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
-  {&__pyx_n_s_WRONG_REF, __pyx_k_WRONG_REF, sizeof(__pyx_k_WRONG_REF), 0, 0, 1, 1},
-  {&__pyx_kp_s_WRONG_REF_Wrong_reference_s, __pyx_k_WRONG_REF_Wrong_reference_s, sizeof(__pyx_k_WRONG_REF_Wrong_reference_s), 0, 0, 1, 0},
-  {&__pyx_n_s_Warning, __pyx_k_Warning, sizeof(__pyx_k_Warning), 0, 0, 1, 1},
-  {&__pyx_n_s_ZERO_FOR_NON_FLAG_FIELD, __pyx_k_ZERO_FOR_NON_FLAG_FIELD, sizeof(__pyx_k_ZERO_FOR_NON_FLAG_FIELD), 0, 0, 1, 1},
-  {&__pyx_kp_s_ZERO_FOR_NON_FLAG_FIELD_number_s, __pyx_k_ZERO_FOR_NON_FLAG_FIELD_number_s, sizeof(__pyx_k_ZERO_FOR_NON_FLAG_FIELD_number_s), 0, 0, 1, 0},
-  {&__pyx_n_s_ZERO_LENGTH_ALLELE, __pyx_k_ZERO_LENGTH_ALLELE, sizeof(__pyx_k_ZERO_LENGTH_ALLELE), 0, 0, 1, 1},
-  {&__pyx_kp_s_ZERO_LENGTH_ALLELE_Found_zero_le, __pyx_k_ZERO_LENGTH_ALLELE_Found_zero_le, sizeof(__pyx_k_ZERO_LENGTH_ALLELE_Found_zero_le), 0, 0, 1, 0},
-  {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0},
-  {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0},
-  {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
-  {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0},
-  {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
-  {&__pyx_kp_s__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 0, 1, 0},
-  {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
-  {&__pyx_kp_s__46, __pyx_k__46, sizeof(__pyx_k__46), 0, 0, 1, 0},
-  {&__pyx_kp_s__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 0, 1, 0},
-  {&__pyx_kp_s__55, __pyx_k__55, sizeof(__pyx_k__55), 0, 0, 1, 0},
-  {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
-  {&__pyx_kp_s__60, __pyx_k__60, sizeof(__pyx_k__60), 0, 0, 1, 0},
-  {&__pyx_kp_s__61, __pyx_k__61, sizeof(__pyx_k__61), 0, 0, 1, 0},
-  {&__pyx_kp_b__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 0, 0},
-  {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
-  {&__pyx_kp_s__91, __pyx_k__91, sizeof(__pyx_k__91), 0, 0, 1, 0},
-  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
-  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
-  {&__pyx_n_s_add_definition, __pyx_k_add_definition, sizeof(__pyx_k_add_definition), 0, 0, 1, 1},
-  {&__pyx_n_s_addn, __pyx_k_addn, sizeof(__pyx_k_addn), 0, 0, 1, 1},
-  {&__pyx_n_s_addns, __pyx_k_addns, sizeof(__pyx_k_addns), 0, 0, 1, 1},
-  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
-  {&__pyx_n_s_allele, __pyx_k_allele, sizeof(__pyx_k_allele), 0, 0, 1, 1},
-  {&__pyx_n_s_alleleRegEx, __pyx_k_alleleRegEx, sizeof(__pyx_k_alleleRegEx), 0, 0, 1, 1},
-  {&__pyx_kp_s_alleles, __pyx_k_alleles, sizeof(__pyx_k_alleles), 0, 0, 1, 0},
-  {&__pyx_n_s_alt, __pyx_k_alt, sizeof(__pyx_k_alt), 0, 0, 1, 1},
-  {&__pyx_n_s_alt1, __pyx_k_alt1, sizeof(__pyx_k_alt1), 0, 0, 1, 1},
-  {&__pyx_n_s_alt2, __pyx_k_alt2, sizeof(__pyx_k_alt2), 0, 0, 1, 1},
-  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
-  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
-  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
-  {&__pyx_n_s_bisect, __pyx_k_bisect, sizeof(__pyx_k_bisect), 0, 0, 1, 1},
-  {&__pyx_n_s_blurp, __pyx_k_blurp, sizeof(__pyx_k_blurp), 0, 0, 1, 1},
-  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
-  {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1},
-  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
-  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
-  {&__pyx_n_s_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 0, 0, 1, 1},
-  {&__pyx_n_s_compare_calls, __pyx_k_compare_calls, sizeof(__pyx_k_compare_calls), 0, 0, 1, 1},
-  {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
-  {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
-  {&__pyx_n_s_convertGT, __pyx_k_convertGT, sizeof(__pyx_k_convertGT), 0, 0, 1, 1},
-  {&__pyx_n_s_convertGTback, __pyx_k_convertGTback, sizeof(__pyx_k_convertGTback), 0, 0, 1, 1},
-  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
-  {&__pyx_n_s_copy_2, __pyx_k_copy_2, sizeof(__pyx_k_copy_2), 0, 0, 1, 1},
-  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
-  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
-  {&__pyx_n_s_datagenerator, __pyx_k_datagenerator, sizeof(__pyx_k_datagenerator), 0, 0, 1, 1},
-  {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1},
-  {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1},
-  {&__pyx_kp_s_deletion_is_s_reference_is_s, __pyx_k_deletion_is_s_reference_is_s, sizeof(__pyx_k_deletion_is_s_reference_is_s), 0, 0, 1, 0},
-  {&__pyx_n_s_descr, __pyx_k_descr, sizeof(__pyx_k_descr), 0, 0, 1, 1},
-  {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1},
-  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
-  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
-  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
-  {&__pyx_n_s_elts, __pyx_k_elts, sizeof(__pyx_k_elts), 0, 0, 1, 1},
-  {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1},
-  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
-  {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
-  {&__pyx_n_s_enter_default_format, __pyx_k_enter_default_format, sizeof(__pyx_k_enter_default_format), 0, 0, 1, 1},
-  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
-  {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
-  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
-  {&__pyx_n_s_errorlabel, __pyx_k_errorlabel, sizeof(__pyx_k_errorlabel), 0, 0, 1, 1},
-  {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
-  {&__pyx_n_s_errorstring, __pyx_k_errorstring, sizeof(__pyx_k_errorstring), 0, 0, 1, 1},
-  {&__pyx_n_s_errwarn, __pyx_k_errwarn, sizeof(__pyx_k_errwarn), 0, 0, 1, 1},
-  {&__pyx_n_s_expected, __pyx_k_expected, sizeof(__pyx_k_expected), 0, 0, 1, 1},
-  {&__pyx_kp_s_expected_s_for_s_samples_s_got_s, __pyx_k_expected_s_for_s_samples_s_got_s, sizeof(__pyx_k_expected_s_for_s_samples_s_got_s), 0, 0, 1, 0},
-  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
-  {&__pyx_n_s_fa, __pyx_k_fa, sizeof(__pyx_k_fa), 0, 0, 1, 1},
-  {&__pyx_n_s_faref, __pyx_k_faref, sizeof(__pyx_k_faref), 0, 0, 1, 1},
-  {&__pyx_n_s_faref_leftflank, __pyx_k_faref_leftflank, sizeof(__pyx_k_faref_leftflank), 0, 0, 1, 1},
-  {&__pyx_n_s_fetch, __pyx_k_fetch, sizeof(__pyx_k_fetch), 0, 0, 1, 1},
-  {&__pyx_n_s_fileformat, __pyx_k_fileformat, sizeof(__pyx_k_fileformat), 0, 0, 1, 1},
-  {&__pyx_kp_s_fileformat_VCFv_s_s, __pyx_k_fileformat_VCFv_s_s, sizeof(__pyx_k_fileformat_VCFv_s_s), 0, 0, 1, 0},
-  {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1},
-  {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1},
-  {&__pyx_n_s_filter_2, __pyx_k_filter_2, sizeof(__pyx_k_filter_2), 0, 0, 1, 1},
-  {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
-  {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1},
-  {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1},
-  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
-  {&__pyx_n_s_format_2, __pyx_k_format_2, sizeof(__pyx_k_format_2), 0, 0, 1, 1},
-  {&__pyx_n_s_format_format, __pyx_k_format_format, sizeof(__pyx_k_format_format), 0, 0, 1, 1},
-  {&__pyx_n_s_format_formatdata, __pyx_k_format_formatdata, sizeof(__pyx_k_format_formatdata), 0, 0, 1, 1},
-  {&__pyx_n_s_formatdict, __pyx_k_formatdict, sizeof(__pyx_k_formatdict), 0, 0, 1, 1},
-  {&__pyx_kp_s_found_s_expected_s, __pyx_k_found_s_expected_s, sizeof(__pyx_k_found_s_expected_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_found_s_values_in_element_s_exp, __pyx_k_found_s_values_in_element_s_exp, sizeof(__pyx_k_found_s_values_in_element_s_exp), 0, 0, 1, 0},
-  {&__pyx_kp_s_genotypes, __pyx_k_genotypes, sizeof(__pyx_k_genotypes), 0, 0, 1, 0},
-  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
-  {&__pyx_n_s_get_expected, __pyx_k_get_expected, sizeof(__pyx_k_get_expected), 0, 0, 1, 1},
-  {&__pyx_n_s_get_sequence, __pyx_k_get_sequence, sizeof(__pyx_k_get_sequence), 0, 0, 1, 1},
-  {&__pyx_n_s_getfilter, __pyx_k_getfilter, sizeof(__pyx_k_getfilter), 0, 0, 1, 1},
-  {&__pyx_n_s_getformat, __pyx_k_getformat, sizeof(__pyx_k_getformat), 0, 0, 1, 1},
-  {&__pyx_n_s_getheader, __pyx_k_getheader, sizeof(__pyx_k_getheader), 0, 0, 1, 1},
-  {&__pyx_n_s_getinfo, __pyx_k_getinfo, sizeof(__pyx_k_getinfo), 0, 0, 1, 1},
-  {&__pyx_n_s_getsamples, __pyx_k_getsamples, sizeof(__pyx_k_getsamples), 0, 0, 1, 1},
-  {&__pyx_n_s_gts, __pyx_k_gts, sizeof(__pyx_k_gts), 0, 0, 1, 1},
-  {&__pyx_n_s_gtsRegEx, __pyx_k_gtsRegEx, sizeof(__pyx_k_gtsRegEx), 0, 0, 1, 1},
-  {&__pyx_n_s_have_deletions, __pyx_k_have_deletions, sizeof(__pyx_k_have_deletions), 0, 0, 1, 1},
-  {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1},
-  {&__pyx_n_s_header_2, __pyx_k_header_2, sizeof(__pyx_k_header_2), 0, 0, 1, 1},
-  {&__pyx_n_s_headings, __pyx_k_headings, sizeof(__pyx_k_headings), 0, 0, 1, 1},
-  {&__pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_k_home_andreas_devel_pysam_pysam, sizeof(__pyx_k_home_andreas_devel_pysam_pysam), 0, 0, 1, 0},
-  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
-  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
-  {&__pyx_kp_s_id_numbertype_number_type_descri, __pyx_k_id_numbertype_number_type_descri, sizeof(__pyx_k_id_numbertype_number_type_descri), 0, 0, 1, 0},
-  {&__pyx_kp_s_id_s_expected_s_parameters_got_s, __pyx_k_id_s_expected_s_parameters_got_s, sizeof(__pyx_k_id_s_expected_s_parameters_got_s), 0, 0, 1, 0},
-  {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
-  {&__pyx_n_s_ielts, __pyx_k_ielts, sizeof(__pyx_k_ielts), 0, 0, 1, 1},
-  {&__pyx_n_s_ignored_errors, __pyx_k_ignored_errors, sizeof(__pyx_k_ignored_errors), 0, 0, 1, 1},
-  {&__pyx_n_s_ignoreerror, __pyx_k_ignoreerror, sizeof(__pyx_k_ignoreerror), 0, 0, 1, 1},
-  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_kp_s_in_line_s_s_s_s_s, __pyx_k_in_line_s_s_s_s_s, sizeof(__pyx_k_in_line_s_s_s_s_s), 0, 0, 1, 0},
-  {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
-  {&__pyx_n_s_info_2, __pyx_k_info_2, sizeof(__pyx_k_info_2), 0, 0, 1, 1},
-  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
-  {&__pyx_n_s_inregion, __pyx_k_inregion, sizeof(__pyx_k_inregion), 0, 0, 1, 1},
-  {&__pyx_n_s_itemgetter, __pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 0, 1, 1},
-  {&__pyx_n_s_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 0, 0, 1, 1},
-  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
-  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
-  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
-  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
-  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
-  {&__pyx_n_s_label, __pyx_k_label, sizeof(__pyx_k_label), 0, 0, 1, 1},
-  {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1},
-  {&__pyx_n_s_last_line, __pyx_k_last_line, sizeof(__pyx_k_last_line), 0, 0, 1, 1},
-  {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1},
-  {&__pyx_n_s_leftalign, __pyx_k_leftalign, sizeof(__pyx_k_leftalign), 0, 0, 1, 1},
-  {&__pyx_n_s_leftalign_2, __pyx_k_leftalign_2, sizeof(__pyx_k_leftalign_2), 0, 0, 1, 1},
-  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
-  {&__pyx_n_s_line_2, __pyx_k_line_2, sizeof(__pyx_k_line_2), 0, 0, 1, 1},
-  {&__pyx_n_s_lineno, __pyx_k_lineno, sizeof(__pyx_k_lineno), 0, 0, 1, 1},
-  {&__pyx_n_s_lineparse, __pyx_k_lineparse, sizeof(__pyx_k_lineparse), 0, 0, 1, 1},
-  {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1},
-  {&__pyx_n_s_lines_2, __pyx_k_lines_2, sizeof(__pyx_k_lines_2), 0, 0, 1, 1},
-  {&__pyx_n_s_longest, __pyx_k_longest, sizeof(__pyx_k_longest), 0, 0, 1, 1},
-  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
-  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
-  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
-  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
-  {&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
-  {&__pyx_n_s_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 0, 1, 1},
-  {&__pyx_n_s_missingvalue, __pyx_k_missingvalue, sizeof(__pyx_k_missingvalue), 0, 0, 1, 1},
-  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
-  {&__pyx_n_s_movable, __pyx_k_movable, sizeof(__pyx_k_movable), 0, 0, 1, 1},
-  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
-  {&__pyx_n_s_na, __pyx_k_na, sizeof(__pyx_k_na), 0, 0, 1, 1},
-  {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1},
-  {&__pyx_kp_s_needs_to_be_checked, __pyx_k_needs_to_be_checked, sizeof(__pyx_k_needs_to_be_checked), 0, 0, 1, 0},
-  {&__pyx_n_s_newalts, __pyx_k_newalts, sizeof(__pyx_k_newalts), 0, 0, 1, 1},
-  {&__pyx_n_s_nmb, __pyx_k_nmb, sizeof(__pyx_k_nmb), 0, 0, 1, 1},
-  {&__pyx_kp_s_nonref_alleles, __pyx_k_nonref_alleles, sizeof(__pyx_k_nonref_alleles), 0, 0, 1, 0},
-  {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1},
-  {&__pyx_n_s_numbertype, __pyx_k_numbertype, sizeof(__pyx_k_numbertype), 0, 0, 1, 1},
-  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
-  {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1},
-  {&__pyx_n_s_opt, __pyx_k_opt, sizeof(__pyx_k_opt), 0, 0, 1, 1},
-  {&__pyx_kp_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 0},
-  {&__pyx_n_s_output_2, __pyx_k_output_2, sizeof(__pyx_k_output_2), 0, 0, 1, 1},
-  {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
-  {&__pyx_n_s_parse_2, __pyx_k_parse_2, sizeof(__pyx_k_parse_2), 0, 0, 1, 1},
-  {&__pyx_n_s_parse_data, __pyx_k_parse_data, sizeof(__pyx_k_parse_data), 0, 0, 1, 1},
-  {&__pyx_n_s_parse_format, __pyx_k_parse_format, sizeof(__pyx_k_parse_format), 0, 0, 1, 1},
-  {&__pyx_n_s_parse_formatdata, __pyx_k_parse_formatdata, sizeof(__pyx_k_parse_formatdata), 0, 0, 1, 1},
-  {&__pyx_n_s_parse_header, __pyx_k_parse_header, sizeof(__pyx_k_parse_header), 0, 0, 1, 1},
-  {&__pyx_n_s_parse_header_2, __pyx_k_parse_header_2, sizeof(__pyx_k_parse_header_2), 0, 0, 1, 1},
-  {&__pyx_n_s_parse_heading, __pyx_k_parse_heading, sizeof(__pyx_k_parse_heading), 0, 0, 1, 1},
-  {&__pyx_n_s_parse_regions, __pyx_k_parse_regions, sizeof(__pyx_k_parse_regions), 0, 0, 1, 1},
-  {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
-  {&__pyx_kp_s_phased_genotypes, __pyx_k_phased_genotypes, sizeof(__pyx_k_phased_genotypes), 0, 0, 1, 0},
-  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
-  {&__pyx_n_s_pos1, __pyx_k_pos1, sizeof(__pyx_k_pos1), 0, 0, 1, 1},
-  {&__pyx_n_s_pos2, __pyx_k_pos2, sizeof(__pyx_k_pos2), 0, 0, 1, 1},
-  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
-  {&__pyx_n_s_pysam, __pyx_k_pysam, sizeof(__pyx_k_pysam), 0, 0, 1, 1},
-  {&__pyx_n_s_pysam_cvcf, __pyx_k_pysam_cvcf, sizeof(__pyx_k_pysam_cvcf), 0, 0, 1, 1},
-  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
-  {&__pyx_n_s_qual, __pyx_k_qual, sizeof(__pyx_k_qual), 0, 0, 1, 1},
-  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 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_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
-  {&__pyx_n_s_record, __pyx_k_record, sizeof(__pyx_k_record), 0, 0, 1, 1},
-  {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
-  {&__pyx_n_s_ref1, __pyx_k_ref1, sizeof(__pyx_k_ref1), 0, 0, 1, 1},
-  {&__pyx_n_s_ref2, __pyx_k_ref2, sizeof(__pyx_k_ref2), 0, 0, 1, 1},
-  {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1},
-  {&__pyx_n_s_reference_2, __pyx_k_reference_2, sizeof(__pyx_k_reference_2), 0, 0, 1, 1},
-  {&__pyx_kp_s_reference_is_s_VCF_says_s, __pyx_k_reference_is_s_VCF_says_s, sizeof(__pyx_k_reference_is_s_VCF_says_s), 0, 0, 1, 0},
-  {&__pyx_n_s_region, __pyx_k_region, sizeof(__pyx_k_region), 0, 0, 1, 1},
-  {&__pyx_n_s_regions, __pyx_k_regions, sizeof(__pyx_k_regions), 0, 0, 1, 1},
-  {&__pyx_n_s_regions_2, __pyx_k_regions_2, sizeof(__pyx_k_regions_2), 0, 0, 1, 1},
-  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
-  {&__pyx_n_s_required, __pyx_k_required, sizeof(__pyx_k_required), 0, 0, 1, 1},
-  {&__pyx_n_s_required_2, __pyx_k_required_2, sizeof(__pyx_k_required_2), 0, 0, 1, 1},
-  {&__pyx_n_s_rest, __pyx_k_rest, sizeof(__pyx_k_rest), 0, 0, 1, 1},
-  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
-  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
-  {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0},
-  {&__pyx_kp_s_s_s_2, __pyx_k_s_s_2, sizeof(__pyx_k_s_s_2), 0, 0, 1, 0},
-  {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1},
-  {&__pyx_n_s_sample2column, __pyx_k_sample2column, sizeof(__pyx_k_sample2column), 0, 0, 1, 1},
-  {&__pyx_n_s_samples, __pyx_k_samples, sizeof(__pyx_k_samples), 0, 0, 1, 1},
-  {&__pyx_n_s_samples_2, __pyx_k_samples_2, sizeof(__pyx_k_samples_2), 0, 0, 1, 1},
-  {&__pyx_n_s_sdata, __pyx_k_sdata, sizeof(__pyx_k_sdata), 0, 0, 1, 1},
-  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
-  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
-  {&__pyx_n_s_separator, __pyx_k_separator, sizeof(__pyx_k_separator), 0, 0, 1, 1},
-  {&__pyx_n_s_sequence, __pyx_k_sequence, sizeof(__pyx_k_sequence), 0, 0, 1, 1},
-  {&__pyx_n_s_setfilter, __pyx_k_setfilter, sizeof(__pyx_k_setfilter), 0, 0, 1, 1},
-  {&__pyx_n_s_setformat, __pyx_k_setformat, sizeof(__pyx_k_setformat), 0, 0, 1, 1},
-  {&__pyx_n_s_setheader, __pyx_k_setheader, sizeof(__pyx_k_setheader), 0, 0, 1, 1},
-  {&__pyx_n_s_setinfo, __pyx_k_setinfo, sizeof(__pyx_k_setinfo), 0, 0, 1, 1},
-  {&__pyx_n_s_setreference, __pyx_k_setreference, sizeof(__pyx_k_setreference), 0, 0, 1, 1},
-  {&__pyx_n_s_setregions, __pyx_k_setregions, sizeof(__pyx_k_setregions), 0, 0, 1, 1},
-  {&__pyx_n_s_setsamples, __pyx_k_setsamples, sizeof(__pyx_k_setsamples), 0, 0, 1, 1},
-  {&__pyx_n_s_setversion, __pyx_k_setversion, sizeof(__pyx_k_setversion), 0, 0, 1, 1},
-  {&__pyx_n_s_shortest, __pyx_k_shortest, sizeof(__pyx_k_shortest), 0, 0, 1, 1},
-  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
-  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
-  {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
-  {&__pyx_kp_s_sth_entry_not_found, __pyx_k_sth_entry_not_found, sizeof(__pyx_k_sth_entry_not_found), 0, 0, 1, 0},
-  {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
-  {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
-  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
-  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
-  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
-  {&__pyx_n_s_tabixfile, __pyx_k_tabixfile, sizeof(__pyx_k_tabixfile), 0, 0, 1, 1},
-  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
-  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
-  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
-  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
-  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
-  {&__pyx_n_s_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 0, 1, 1},
-  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
-  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
-  {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1},
-  {&__pyx_n_s_vcf, __pyx_k_vcf, sizeof(__pyx_k_vcf), 0, 0, 1, 1},
-  {&__pyx_n_s_vcffile, __pyx_k_vcffile, sizeof(__pyx_k_vcffile), 0, 0, 1, 1},
-  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
-  {&__pyx_n_s_version_2, __pyx_k_version_2, sizeof(__pyx_k_version_2), 0, 0, 1, 1},
-  {&__pyx_n_s_warn_errors, __pyx_k_warn_errors, sizeof(__pyx_k_warn_errors), 0, 0, 1, 1},
-  {&__pyx_n_s_warnerror, __pyx_k_warnerror, sizeof(__pyx_k_warnerror), 0, 0, 1, 1},
-  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
-  {&__pyx_n_s_write_data, __pyx_k_write_data, sizeof(__pyx_k_write_data), 0, 0, 1, 1},
-  {&__pyx_n_s_write_header, __pyx_k_write_header, sizeof(__pyx_k_write_header), 0, 0, 1, 1},
-  {&__pyx_n_s_write_heading, __pyx_k_write_heading, sizeof(__pyx_k_write_heading), 0, 0, 1, 1},
-  {&__pyx_n_s_writeheader, __pyx_k_writeheader, sizeof(__pyx_k_writeheader), 0, 0, 1, 1},
-  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
-  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
-  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
-  {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __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);
-
-  /* "pysam/cvcf.pyx":72
- * def parse_regions( string ):
- *     result = []
- *     for r in string.split(','):             # <<<<<<<<<<<<<<
- *         elts = r.split(':')
- *         chrom, start, end = elts[0], 0, 3000000000
- */
-  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__3);
-  __Pyx_GIVEREF(__pyx_tuple__3);
-
-  /* "pysam/cvcf.pyx":73
- *     result = []
- *     for r in string.split(','):
- *         elts = r.split(':')             # <<<<<<<<<<<<<<
- *         chrom, start, end = elts[0], 0, 3000000000
- *         if len(elts)==1: pass
- */
-  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__5);
-  __Pyx_GIVEREF(__pyx_tuple__5);
-
-  /* "pysam/cvcf.pyx":78
- *         elif len(elts)==2:
- *             if len(elts[1])>0:
- *                 ielts = elts[1].split('-')             # <<<<<<<<<<<<<<
- *                 if len(ielts) != 2: ValueError("Don't understand region string '%s'" % r)
- *                 try:    start, end = int(ielts[0])-1, int(ielts[1])
- */
-  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__7);
-  __Pyx_GIVEREF(__pyx_tuple__7);
-
-  /* "pysam/cvcf.pyx":160
- *             alt = self.fields[4]
- *             if alt == ".": alt = []
- *             else: alt = alt.upper().split(',')             # <<<<<<<<<<<<<<
- *             return alt
- * 
- */
-  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__9);
-  __Pyx_GIVEREF(__pyx_tuple__9);
-
-  /* "pysam/cvcf.pyx":177
- *             # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- *             if f == b"." or f == b"PASS" or f == b"0": return []
- *             else: return f.split(';')             # <<<<<<<<<<<<<<
- * 
- *     property info:
- */
-  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s__10); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__11);
-  __Pyx_GIVEREF(__pyx_tuple__11);
-
-  /* "pysam/cvcf.pyx":185
- *             info = {}
- *             if col != b".":
- *                 for blurp in col.split(';'):             # <<<<<<<<<<<<<<
- *                     elts = blurp.split('=')
- *                     if len(elts) == 1: v = None
- */
-  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s__10); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__12);
-  __Pyx_GIVEREF(__pyx_tuple__12);
-
-  /* "pysam/cvcf.pyx":186
- *             if col != b".":
- *                 for blurp in col.split(';'):
- *                     elts = blurp.split('=')             # <<<<<<<<<<<<<<
- *                     if len(elts) == 1: v = None
- *                     elif len(elts) == 2: v = elts[1]
- */
-  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__14);
-  __Pyx_GIVEREF(__pyx_tuple__14);
-
-  /* "pysam/cvcf.pyx":195
- *     property format:
- *          def __get__(self):
- *              return self.fields[8].split(':')             # <<<<<<<<<<<<<<
- * 
- *     property samples:
- */
-  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__15);
-  __Pyx_GIVEREF(__pyx_tuple__15);
-
-  /* "pysam/cvcf.pyx":204
- * 
- *         # parse sample columns
- *         values = self.fields[self.vcf._sample2column[key]].split(':')             # <<<<<<<<<<<<<<
- *         alt = self.alt
- *         format = self.format
- */
-  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__16);
-  __Pyx_GIVEREF(__pyx_tuple__16);
-
-  /* "pysam/cvcf.pyx":323
- *         # make error identifiers accessible by name
- *         for id in self._errors.keys():
- *             self.__dict__[self._errors[id].split(':')[0]] = id             # <<<<<<<<<<<<<<
- *         if _copy != None:
- *             self._leftalign = _copy._leftalign
- */
-  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__17);
-  __Pyx_GIVEREF(__pyx_tuple__17);
-
-  /* "pysam/cvcf.pyx":326
- *         if _copy != None:
- *             self._leftalign = _copy._leftalign
- *             self._header = _copy._header[:]             # <<<<<<<<<<<<<<
- *             self._version = _copy._version
- *             self._info = copy.deepcopy(_copy._info)
- */
-  __pyx_slice__18 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__18);
-  __Pyx_GIVEREF(__pyx_slice__18);
-
-  /* "pysam/cvcf.pyx":331
- *             self._filter = copy.deepcopy(_copy._filter)
- *             self._format = copy.deepcopy(_copy._format)
- *             self._samples = _copy._samples[:]             # <<<<<<<<<<<<<<
- *             self._sample2column = copy.deepcopy(_copy._sample2column)
- *             self._ignored_errors = copy.deepcopy(_copy._ignored_errors)
- */
-  __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__19);
-  __Pyx_GIVEREF(__pyx_slice__19);
-
-  /* "pysam/cvcf.pyx":345
- *     def error(self,line,error,opt=None):
- *         if error in self._ignored_errors: return
- *         errorlabel, errorstring = self._errors[error].split(':')             # <<<<<<<<<<<<<<
- *         if opt: errorstring = errorstring % opt
- *         errwarn = ["Error","Warning"][error in self._warn_errors]
- */
-  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__20);
-  __Pyx_GIVEREF(__pyx_tuple__20);
-
-  /* "pysam/cvcf.pyx":354
- *     def parse_format(self,line,format,filter=False):
- *         if self._version == 40:
- *             if not format.startswith('<'):             # <<<<<<<<<<<<<<
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format = "<"+format
- */
-  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s__21); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__22);
-  __Pyx_GIVEREF(__pyx_tuple__22);
-
-  /* "pysam/cvcf.pyx":357
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format = "<"+format
- *             if not format.endswith('>'):             # <<<<<<<<<<<<<<
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format += ">"
- */
-  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s__23); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__24);
-  __Pyx_GIVEREF(__pyx_tuple__24);
-
-  /* "pysam/cvcf.pyx":360
- *                 self.error(line,self.V40_MISSING_ANGLE_BRACKETS)
- *                 format += ">"
- *             format = format[1:-1]             # <<<<<<<<<<<<<<
- *         data = {'id':None,'number':None,'type':None,'descr':None}
- *         idx = 0
- */
-  __pyx_slice__25 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__25);
-  __Pyx_GIVEREF(__pyx_slice__25);
-
-  /* "pysam/cvcf.pyx":364
- *         idx = 0
- *         while len(format.strip())>0:
- *             elts = format.strip().split(',')             # <<<<<<<<<<<<<<
- *             first, rest = elts[0], ','.join(elts[1:])
- *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
- */
-  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__26);
-  __Pyx_GIVEREF(__pyx_tuple__26);
-
-  /* "pysam/cvcf.pyx":365
- *         while len(format.strip())>0:
- *             elts = format.strip().split(',')
- *             first, rest = elts[0], ','.join(elts[1:])             # <<<<<<<<<<<<<<
- *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):
- *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
- */
-  __pyx_slice__27 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__27);
-  __Pyx_GIVEREF(__pyx_slice__27);
-
-  /* "pysam/cvcf.pyx":366
- *             elts = format.strip().split(',')
- *             first, rest = elts[0], ','.join(elts[1:])
- *             if first.find('=') == -1 or (first.find('"')>=0 and first.find('=') > first.find('"')):             # <<<<<<<<<<<<<<
- *                 if self._version == 40: self.error(line,self.V40_FORMAT_MUST_HAVE_NAMED_FIELDS)
- *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__28);
-  __Pyx_GIVEREF(__pyx_tuple__28);
-  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s__29); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__31);
-  __Pyx_GIVEREF(__pyx_tuple__31);
-  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s__29); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
-
-  /* "pysam/cvcf.pyx":370
- *                 if idx == 4: self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- *                 first = ["ID=","Number=","Type=","Description="][idx] + first
- *             if first.startswith('ID='):            data['id'] = first.split('=')[1]             # <<<<<<<<<<<<<<
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
- */
-  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_ID); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__33);
-  __Pyx_GIVEREF(__pyx_tuple__33);
-  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
-
-  /* "pysam/cvcf.pyx":371
- *                 first = ["ID=","Number=","Type=","Description="][idx] + first
- *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]             # <<<<<<<<<<<<<<
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
- *             elif first.startswith('Description='):
- */
-  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Number); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__35);
-  __Pyx_GIVEREF(__pyx_tuple__35);
-  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
-
-  /* "pysam/cvcf.pyx":372
- *             if first.startswith('ID='):            data['id'] = first.split('=')[1]
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]             # <<<<<<<<<<<<<<
- *             elif first.startswith('Description='):
- *                 elts = format.split('"')
- */
-  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Type); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__37);
-  __Pyx_GIVEREF(__pyx_tuple__37);
-  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__38);
-  __Pyx_GIVEREF(__pyx_tuple__38);
-
-  /* "pysam/cvcf.pyx":373
- *             elif first.startswith('Number='):      data['number'] = first.split('=')[1]
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
- *             elif first.startswith('Description='):             # <<<<<<<<<<<<<<
- *                 elts = format.split('"')
- *                 if len(elts)<3:
- */
-  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Description); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__39);
-  __Pyx_GIVEREF(__pyx_tuple__39);
-
-  /* "pysam/cvcf.pyx":374
- *             elif first.startswith('Type='):        data['type'] = first.split('=')[1]
- *             elif first.startswith('Description='):
- *                 elts = format.split('"')             # <<<<<<<<<<<<<<
- *                 if len(elts)<3:
- *                     self.error(line,self.FORMAT_MISSING_QUOTES)
- */
-  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s__29); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__40);
-  __Pyx_GIVEREF(__pyx_tuple__40);
-
-  /* "pysam/cvcf.pyx":377
- *                 if len(elts)<3:
- *                     self.error(line,self.FORMAT_MISSING_QUOTES)
- *                     elts = first.split('=') + [rest]             # <<<<<<<<<<<<<<
- *                 data['descr'] = elts[1]
- *                 rest = '"'.join(elts[2:])
- */
-  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__41);
-  __Pyx_GIVEREF(__pyx_tuple__41);
-
-  /* "pysam/cvcf.pyx":379
- *                     elts = first.split('=') + [rest]
- *                 data['descr'] = elts[1]
- *                 rest = '"'.join(elts[2:])             # <<<<<<<<<<<<<<
- *                 if rest.startswith(','): rest = rest[1:]
- *             else:
- */
-  __pyx_slice__42 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__42);
-  __Pyx_GIVEREF(__pyx_slice__42);
-
-  /* "pysam/cvcf.pyx":380
- *                 data['descr'] = elts[1]
- *                 rest = '"'.join(elts[2:])
- *                 if rest.startswith(','): rest = rest[1:]             # <<<<<<<<<<<<<<
- *             else:
- *                 self.error(line,self.BADLY_FORMATTED_FORMAT_STRING)
- */
-  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__43);
-  __Pyx_GIVEREF(__pyx_tuple__43);
-
-  /* "pysam/cvcf.pyx":500
- *         # snip off trailing missing data
- *         while len(output) > 1:
- *             last = output[-1].replace(',','').replace('.','')             # <<<<<<<<<<<<<<
- *             if len(last)>0: break
- *             output = output[:-1]
- */
-  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_kp_s__2, __pyx_kp_s_); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__44);
-  __Pyx_GIVEREF(__pyx_tuple__44);
-  __pyx_tuple__45 = PyTuple_Pack(2, __pyx_kp_s__8, __pyx_kp_s_); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__45);
-  __Pyx_GIVEREF(__pyx_tuple__45);
-
-  /* "pysam/cvcf.pyx":527
- *     def parse_header(self, line):
- * 
- *         assert line.startswith('##')             # <<<<<<<<<<<<<<
- *         elts = line[2:].split('=')
- *         key = elts[0].strip()
- */
-  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s__46); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__47);
-  __Pyx_GIVEREF(__pyx_tuple__47);
-
-  /* "pysam/cvcf.pyx":528
- * 
- *         assert line.startswith('##')
- *         elts = line[2:].split('=')             # <<<<<<<<<<<<<<
- *         key = elts[0].strip()
- *         value = '='.join(elts[1:]).strip()
- */
-  __pyx_slice__48 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__48);
-  __Pyx_GIVEREF(__pyx_slice__48);
-  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__49);
-  __Pyx_GIVEREF(__pyx_tuple__49);
-
-  /* "pysam/cvcf.pyx":530
- *         elts = line[2:].split('=')
- *         key = elts[0].strip()
- *         value = '='.join(elts[1:]).strip()             # <<<<<<<<<<<<<<
- *         if key == "fileformat":
- *             if value == "VCFv3.3":
- */
-  __pyx_slice__50 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__50);
-  __Pyx_GIVEREF(__pyx_slice__50);
-
-  /* "pysam/cvcf.pyx":563
- * 
- *     def parse_heading( self, line ):
- *         assert line.startswith('#')             # <<<<<<<<<<<<<<
- *         assert not line.startswith('##')
- *         headings = line[1:].split('\t')
- */
-  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s__51); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__52);
-  __Pyx_GIVEREF(__pyx_tuple__52);
-
-  /* "pysam/cvcf.pyx":564
- *     def parse_heading( self, line ):
- *         assert line.startswith('#')
- *         assert not line.startswith('##')             # <<<<<<<<<<<<<<
- *         headings = line[1:].split('\t')
- *         # test for 8, as FORMAT field might be missing
- */
-  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s__46); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__53);
-  __Pyx_GIVEREF(__pyx_tuple__53);
-
-  /* "pysam/cvcf.pyx":565
- *         assert line.startswith('#')
- *         assert not line.startswith('##')
- *         headings = line[1:].split('\t')             # <<<<<<<<<<<<<<
- *         # test for 8, as FORMAT field might be missing
- *         if len(headings)==1 and len(line[1:].split()) >= 8:
- */
-  __pyx_slice__54 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__54);
-  __Pyx_GIVEREF(__pyx_slice__54);
-  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s__55); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__56);
-  __Pyx_GIVEREF(__pyx_tuple__56);
-
-  /* "pysam/cvcf.pyx":567
- *         headings = line[1:].split('\t')
- *         # test for 8, as FORMAT field might be missing
- *         if len(headings)==1 and len(line[1:].split()) >= 8:             # <<<<<<<<<<<<<<
- *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
- *             headings = line[1:].split()
- */
-  __pyx_slice__57 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__57);
-  __Pyx_GIVEREF(__pyx_slice__57);
-
-  /* "pysam/cvcf.pyx":569
- *         if len(headings)==1 and len(line[1:].split()) >= 8:
- *             self.error(line,self.HEADING_NOT_SEPARATED_BY_TABS)
- *             headings = line[1:].split()             # <<<<<<<<<<<<<<
- * 
- *         for i,s in enumerate(self._required):
- */
-  __pyx_slice__58 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__58);
-  __Pyx_GIVEREF(__pyx_slice__58);
-
-  /* "pysam/cvcf.pyx":587
- *                     self.error(line,self.BADLY_FORMATTED_HEADING,err)
- * 
- *         self._samples = headings[9:]             # <<<<<<<<<<<<<<
- *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
- * 
- */
-  __pyx_slice__59 = PySlice_New(__pyx_int_9, Py_None, Py_None); if (unlikely(!__pyx_slice__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__59);
-  __Pyx_GIVEREF(__pyx_slice__59);
-
-  /* "pysam/cvcf.pyx":617
- *             if value is not None: self.error(line,self.ERROR_FLAG_HAS_VALUE)
- *             return []
- *         values = value.split(',')             # <<<<<<<<<<<<<<
- *         # deal with trailing data in some early VCF files
- *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
- */
-  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__62);
-  __Pyx_GIVEREF(__pyx_tuple__62);
-
-  /* "pysam/cvcf.pyx":619
- *         values = value.split(',')
- *         # deal with trailing data in some early VCF files
- *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:             # <<<<<<<<<<<<<<
- *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
- *             values[-1] = values[-1].split(';')[0]
- */
-  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s__10); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__63);
-  __Pyx_GIVEREF(__pyx_tuple__63);
-
-  /* "pysam/cvcf.pyx":621
- *         if f.type in ["Float","Integer"] and len(values)>0 and values[-1].find(';') > -1:
- *             self.error(line,self.ERROR_TRAILING_DATA,values[-1])
- *             values[-1] = values[-1].split(';')[0]             # <<<<<<<<<<<<<<
- *         if f.type == "Integer":
- *             for idx,v in enumerate(values):
- */
-  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s__10); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__64);
-  __Pyx_GIVEREF(__pyx_tuple__64);
-
-  /* "pysam/cvcf.pyx":657
- * 
- *     def parse_data( self, line, lineparse=False ):
- *         cols = line.split('\t')             # <<<<<<<<<<<<<<
- *         if len(cols) != len(self._samples)+9:
- *             # gracefully deal with absent FORMAT column
- */
-  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s__55); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__65);
-  __Pyx_GIVEREF(__pyx_tuple__65);
-
-  /* "pysam/cvcf.pyx":703
- *         # convert v3.3 to v4.0 alleles below
- *         if cols[4] == ".": alt = []
- *         else: alt = cols[4].upper().split(',')             # <<<<<<<<<<<<<<
- * 
- *         if cols[5] == ".": qual = -1
- */
-  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__66);
-  __Pyx_GIVEREF(__pyx_tuple__66);
-
-  /* "pysam/cvcf.pyx":712
- *         # postpone checking that filters exist.  Encode missing filter or no filtering as empty list
- *         if cols[6] == "." or cols[6] == "PASS" or cols[6] == "0": filter = []
- *         else: filter = cols[6].split(';')             # <<<<<<<<<<<<<<
- * 
- *         # dictionary of keys, and list of values
- */
-  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s__10); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__67);
-  __Pyx_GIVEREF(__pyx_tuple__67);
-
-  /* "pysam/cvcf.pyx":717
- *         info = {}
- *         if cols[7] != ".":
- *             for blurp in cols[7].split(';'):             # <<<<<<<<<<<<<<
- *                 elts = blurp.split('=')
- *                 if len(elts) == 1: v = None
- */
-  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s__10); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__68);
-  __Pyx_GIVEREF(__pyx_tuple__68);
-
-  /* "pysam/cvcf.pyx":718
- *         if cols[7] != ".":
- *             for blurp in cols[7].split(';'):
- *                 elts = blurp.split('=')             # <<<<<<<<<<<<<<
- *                 if len(elts) == 1: v = None
- *                 elif len(elts) == 2: v = elts[1]
- */
-  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s__13); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__69);
-  __Pyx_GIVEREF(__pyx_tuple__69);
-
-  /* "pysam/cvcf.pyx":729
- *         # Gracefully deal with absent FORMAT column
- *         if cols[8] == "": format = []
- *         else: format = cols[8].split(':')             # <<<<<<<<<<<<<<
- * 
- *         # check: all filters are defined
- */
-  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__70);
-  __Pyx_GIVEREF(__pyx_tuple__70);
-
-  /* "pysam/cvcf.pyx":746
- *             have_deletions = False
- *             for a in alt:
- *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference             # <<<<<<<<<<<<<<
- *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
- *                 elif a.startswith('D'): # allow D<seq> and D<num>
- */
-  __pyx_slice__71 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__71);
-  __Pyx_GIVEREF(__pyx_slice__71);
-
-  /* "pysam/cvcf.pyx":747
- *             for a in alt:
- *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
- *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference             # <<<<<<<<<<<<<<
- *                 elif a.startswith('D'): # allow D<seq> and D<num>
- *                     have_deletions = True
- */
-  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_n_s_I); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__72);
-  __Pyx_GIVEREF(__pyx_tuple__72);
-  __pyx_slice__73 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__73);
-  __Pyx_GIVEREF(__pyx_slice__73);
-  __pyx_slice__74 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__74);
-  __Pyx_GIVEREF(__pyx_slice__74);
-
-  /* "pysam/cvcf.pyx":748
- *                 if len(a) == 1: a = a + ref[1:]                       # SNP; add trailing reference
- *                 elif a.startswith('I'): a = ref[0] + a[1:] + ref[1:]  # insertion just beyond pos; add first and trailing reference
- *                 elif a.startswith('D'): # allow D<seq> and D<num>             # <<<<<<<<<<<<<<
- *                     have_deletions = True
- *                     try:
- */
-  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_D); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__75);
-  __Pyx_GIVEREF(__pyx_tuple__75);
-
-  /* "pysam/cvcf.pyx":751
- *                     have_deletions = True
- *                     try:
- *                         l = int(a[1:])          # throws ValueError if sequence             # <<<<<<<<<<<<<<
- *                         if len(ref) < l:        # add to reference if necessary
- *                             addns = get_sequence(chrom,pos+len(ref),pos+l,self._reference)
- */
-  __pyx_slice__76 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__76);
-  __Pyx_GIVEREF(__pyx_slice__76);
-
-  /* "pysam/cvcf.pyx":758
- *                         a = ref[l:]             # new deletion, deleting pos...pos+l
- *                     except ValueError:
- *                         s = a[1:]             # <<<<<<<<<<<<<<
- *                         if len(ref) < len(s):   # add Ns to reference if necessary
- *                             addns = get_sequence(chrom,pos+len(ref),pos+len(s),self._reference)
- */
-  __pyx_slice__77 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__77);
-  __Pyx_GIVEREF(__pyx_slice__77);
-
-  /* "pysam/cvcf.pyx":820
- *                 if not movable:
- *                     break
- *                 ref = ref[:-1]             # <<<<<<<<<<<<<<
- *                 alt = [allele[:-1] for allele in alt]
- *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
- */
-  __pyx_slice__78 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__78);
-  __Pyx_GIVEREF(__pyx_slice__78);
-
-  /* "pysam/cvcf.pyx":821
- *                     break
- *                 ref = ref[:-1]
- *                 alt = [allele[:-1] for allele in alt]             # <<<<<<<<<<<<<<
- *                 if min([len(allele) for allele in alt]) == 0 or len(ref) == 0:
- *                     ref = faref_leftflank[pos-left-1] + ref
- */
-  __pyx_slice__79 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__79);
-  __Pyx_GIVEREF(__pyx_slice__79);
-
-  /* "pysam/cvcf.pyx":829
- *         # parse sample columns
- *         samples = []
- *         for sample in cols[9:]:             # <<<<<<<<<<<<<<
- *             dict = {}
- *             values = sample.split(':')
- */
-  __pyx_slice__80 = PySlice_New(__pyx_int_9, Py_None, Py_None); if (unlikely(!__pyx_slice__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__80);
-  __Pyx_GIVEREF(__pyx_slice__80);
-
-  /* "pysam/cvcf.pyx":831
- *         for sample in cols[9:]:
- *             dict = {}
- *             values = sample.split(':')             # <<<<<<<<<<<<<<
- *             if len(values) > len(format):
- *                 self.error(line,self.BAD_NUMBER_OF_VALUES,"(found %s values in element %s; expected %s)" % (len(values),sample,len(format)))
- */
-  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__81);
-  __Pyx_GIVEREF(__pyx_tuple__81);
-
-  /* "pysam/cvcf.pyx":905
- *             line = ctabix._force_str(line, self.encoding)
- *             self._lineno += 1
- *             if line.startswith('##'):             # <<<<<<<<<<<<<<
- *                 self.parse_header(line.strip())
- *             elif line.startswith('#'):
- */
-  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s__46); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__82);
-  __Pyx_GIVEREF(__pyx_tuple__82);
-
-  /* "pysam/cvcf.pyx":907
- *             if line.startswith('##'):
- *                 self.parse_header(line.strip())
- *             elif line.startswith('#'):             # <<<<<<<<<<<<<<
- *                 self.parse_heading(line.strip())
- *                 self.enter_default_format()
- */
-  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s__51); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__83);
-  __Pyx_GIVEREF(__pyx_tuple__83);
-
-  /* "pysam/cvcf.pyx":916
- *     def _parse(self, line, stream):
- *         # deal with files with header only
- *         if line.startswith("##"): return             # <<<<<<<<<<<<<<
- *         if len(line.strip()) > 0:
- *             d = self.parse_data( line.strip() )
- */
-  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s__46); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__84);
-  __Pyx_GIVEREF(__pyx_tuple__84);
-
-  /* "pysam/cvcf.pyx":973
- * 
- *     def setversion(self, version):
- *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")             # <<<<<<<<<<<<<<
- *         self._version = version
- * 
- */
-  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_Can_only_handle_v3_3_and_v4_0_VC); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__85);
-  __Pyx_GIVEREF(__pyx_tuple__85);
-
-  /* "pysam/cvcf.pyx":1018
- *         # only when the reference bases are not Ns
- *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:
- *             ref1 = ref1[:-1]             # <<<<<<<<<<<<<<
- *             alt1 = alt1[:-1]
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
- */
-  __pyx_slice__86 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__86);
-  __Pyx_GIVEREF(__pyx_slice__86);
-
-  /* "pysam/cvcf.pyx":1019
- *         while len(ref1)>0 and len(alt1)>0 and ref1[-1] == alt1[-1]:
- *             ref1 = ref1[:-1]
- *             alt1 = alt1[:-1]             # <<<<<<<<<<<<<<
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
- *             ref2 = ref2[:-1]
- */
-  __pyx_slice__87 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__87);
-  __Pyx_GIVEREF(__pyx_slice__87);
-
-  /* "pysam/cvcf.pyx":1021
- *             alt1 = alt1[:-1]
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
- *             ref2 = ref2[:-1]             # <<<<<<<<<<<<<<
- *             alt2 = alt2[:-1]
- *         # now, the alternative alleles must be identical
- */
-  __pyx_slice__88 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__88);
-  __Pyx_GIVEREF(__pyx_slice__88);
-
-  /* "pysam/cvcf.pyx":1022
- *         while len(ref2)>0 and len(alt2)>0 and ref2[-1] == alt2[-1]:
- *             ref2 = ref2[:-1]
- *             alt2 = alt2[:-1]             # <<<<<<<<<<<<<<
- *         # now, the alternative alleles must be identical
- *         return alt1 == alt2
- */
-  __pyx_slice__89 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_slice__89);
-  __Pyx_GIVEREF(__pyx_slice__89);
-
-  /* "pysam/cvcf.pyx":1057
- *         '''
- * 
- *         raise NotImplementedError("needs to be checked")             # <<<<<<<<<<<<<<
- * 
- *         chrom, pos = record.chrom, record.pos
- */
-  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_needs_to_be_checked); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__90);
-  __Pyx_GIVEREF(__pyx_tuple__90);
-
-  /* "pysam/cvcf.pyx":56
- * import pysam
- * 
- * gtsRegEx = re.compile("[|/\\\\]")             # <<<<<<<<<<<<<<
- * alleleRegEx = re.compile('^[ACGTN]+$')
- * 
- */
-  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s__91); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__92);
-  __Pyx_GIVEREF(__pyx_tuple__92);
-
-  /* "pysam/cvcf.pyx":57
- * 
- * gtsRegEx = re.compile("[|/\\\\]")
- * alleleRegEx = re.compile('^[ACGTN]+$')             # <<<<<<<<<<<<<<
- * 
- * # Utility function.  Uses 0-based coordinates
- */
-  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_ACGTN_2); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__93);
-  __Pyx_GIVEREF(__pyx_tuple__93);
-
-  /* "pysam/cvcf.pyx":60
- * 
- * # Utility function.  Uses 0-based coordinates
- * def get_sequence(chrom, start, end, fa):             # <<<<<<<<<<<<<<
- *     # obtain sequence from .fa file, without truncation
- *     if end<=start: return ""
- */
-  __pyx_tuple__94 = PyTuple_Pack(5, __pyx_n_s_chrom, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_fa, __pyx_n_s_sequence); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__94);
-  __Pyx_GIVEREF(__pyx_tuple__94);
-  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_get_sequence, 60, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":70
- * 
- * # Utility function.  Parses a region string
- * def parse_regions( string ):             # <<<<<<<<<<<<<<
- *     result = []
- *     for r in string.split(','):
- */
-  __pyx_tuple__96 = PyTuple_Pack(8, __pyx_n_s_string, __pyx_n_s_result, __pyx_n_s_r, __pyx_n_s_elts, __pyx_n_s_chrom, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_ielts); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__96);
-  __Pyx_GIVEREF(__pyx_tuple__96);
-  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse_regions, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":88
- * 
- * 
- * FORMAT = namedtuple('FORMAT','id numbertype number type description missingvalue')             # <<<<<<<<<<<<<<
- * 
- * ###########################################################################################################
- */
-  __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_FORMAT, __pyx_kp_s_id_numbertype_number_type_descri); if (unlikely(!__pyx_tuple__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__98);
-  __Pyx_GIVEREF(__pyx_tuple__98);
-
-  /* "pysam/cvcf.pyx":319
- *     _lines = None
- * 
- *     def __init__(self, _copy=None, reference=None, regions=None,             # <<<<<<<<<<<<<<
- *                  lines=None, leftalign=False):
- *         # make error identifiers accessible by name
- */
-  __pyx_tuple__99 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_copy, __pyx_n_s_reference, __pyx_n_s_regions, __pyx_n_s_lines, __pyx_n_s_leftalign, __pyx_n_s_id); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__99);
-  __Pyx_GIVEREF(__pyx_tuple__99);
-  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_init, 319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__101 = PyTuple_Pack(5, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__101);
-  __Pyx_GIVEREF(__pyx_tuple__101);
-
-  /* "pysam/cvcf.pyx":343
- *         self.encoding = "ascii"
- * 
- *     def error(self,line,error,opt=None):             # <<<<<<<<<<<<<<
- *         if error in self._ignored_errors: return
- *         errorlabel, errorstring = self._errors[error].split(':')
- */
-  __pyx_tuple__102 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_error, __pyx_n_s_opt, __pyx_n_s_errorlabel, __pyx_n_s_errorstring, __pyx_n_s_errwarn); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__102);
-  __Pyx_GIVEREF(__pyx_tuple__102);
-  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_error, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__104 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__104);
-  __Pyx_GIVEREF(__pyx_tuple__104);
-
-  /* "pysam/cvcf.pyx":352
- *         raise ValueError(errorstring)
- * 
- *     def parse_format(self,line,format,filter=False):             # <<<<<<<<<<<<<<
- *         if self._version == 40:
- *             if not format.startswith('<'):
- */
-  __pyx_tuple__105 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_format, __pyx_n_s_filter_2, __pyx_n_s_data, __pyx_n_s_idx, __pyx_n_s_elts, __pyx_n_s_first, __pyx_n_s_rest, __pyx_n_s_n, __pyx_n_s_t); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__105);
-  __Pyx_GIVEREF(__pyx_tuple__105);
-  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(4, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse_format, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__107 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__107);
-  __Pyx_GIVEREF(__pyx_tuple__107);
-
-  /* "pysam/cvcf.pyx":424
- *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])
- * 
- *     def format_format( self, fmt, filter=False ):             # <<<<<<<<<<<<<<
- *         values = [('ID',fmt.id)]
- *         if fmt.number != None and not filter:
- */
-  __pyx_tuple__108 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_fmt, __pyx_n_s_filter_2, __pyx_n_s_values, __pyx_n_s_nmb, __pyx_n_s_format, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__108);
-  __Pyx_GIVEREF(__pyx_tuple__108);
-  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_format_format, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__110 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__110);
-  __Pyx_GIVEREF(__pyx_tuple__110);
-
-  /* "pysam/cvcf.pyx":444
- *         return format
- * 
- *     def get_expected(self, format, formatdict, alt):             # <<<<<<<<<<<<<<
- *         fmt = formatdict[format]
- *         if fmt.numbertype == self.NT_UNKNOWN: return -1
- */
-  __pyx_tuple__111 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_format, __pyx_n_s_formatdict, __pyx_n_s_alt, __pyx_n_s_fmt); if (unlikely(!__pyx_tuple__111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__111);
-  __Pyx_GIVEREF(__pyx_tuple__111);
-  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_get_expected, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":455
- * 
- * 
- *     def _add_definition(self, formatdict, key, data, line ):             # <<<<<<<<<<<<<<
- *         if key in formatdict: return
- *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
- */
-  __pyx_tuple__113 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_formatdict, __pyx_n_s_key, __pyx_n_s_data, __pyx_n_s_line); if (unlikely(!__pyx_tuple__113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__113);
-  __Pyx_GIVEREF(__pyx_tuple__113);
-  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_add_definition, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":472
- * 
- *     # todo: trim trailing missing values
- *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):             # <<<<<<<<<<<<<<
- *         output, sdata = [], []
- *         if type(data) == type([]): # for FORMAT field, make data with dummy values
- */
-  __pyx_tuple__115 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_format, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_separator, __pyx_n_s_output_2, __pyx_n_s_sdata, __pyx_n_s_d, __pyx_n_s_k, __pyx_n_s_idx, __pyx_n_s_v, __pyx_n_s_last); if (unlikely(!__pyx_tuple__115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__115);
-  __Pyx_GIVEREF(__pyx_tuple__115);
-  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(6, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_format_formatdata, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__117 = PyTuple_Pack(3, ((PyObject *)Py_True), ((PyObject *)Py_True), ((PyObject*)__pyx_kp_s__4)); if (unlikely(!__pyx_tuple__117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__117);
-  __Pyx_GIVEREF(__pyx_tuple__117);
-
-  /* "pysam/cvcf.pyx":506
- * 
- * 
- *     def enter_default_format(self):             # <<<<<<<<<<<<<<
- *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
- */
-  __pyx_tuple__118 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_f); if (unlikely(!__pyx_tuple__118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__118);
-  __Pyx_GIVEREF(__pyx_tuple__118);
-  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_enter_default_format, 506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":525
- *                 self._format[f.id] = f
- * 
- *     def parse_header(self, line):             # <<<<<<<<<<<<<<
- * 
- *         assert line.startswith('##')
- */
-  __pyx_tuple__120 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_elts, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_f); if (unlikely(!__pyx_tuple__120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__120);
-  __Pyx_GIVEREF(__pyx_tuple__120);
-  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse_header, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":555
- * 
- * 
- *     def write_header( self, stream ):             # <<<<<<<<<<<<<<
- *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
- *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
- */
-  __pyx_tuple__122 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_var, __pyx_n_s_label, __pyx_n_s_f); if (unlikely(!__pyx_tuple__122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__122);
-  __Pyx_GIVEREF(__pyx_tuple__122);
-  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_write_header, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":562
- * 
- * 
- *     def parse_heading( self, line ):             # <<<<<<<<<<<<<<
- *         assert line.startswith('#')
- *         assert not line.startswith('##')
- */
-  __pyx_tuple__124 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_headings, __pyx_n_s_i, __pyx_n_s_s, __pyx_n_s_err, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__124);
-  __Pyx_GIVEREF(__pyx_tuple__124);
-  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse_heading, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":590
- *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
- * 
- *     def write_heading( self, stream ):             # <<<<<<<<<<<<<<
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
- * 
- */
-  __pyx_tuple__126 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_stream); if (unlikely(!__pyx_tuple__126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__126);
-  __Pyx_GIVEREF(__pyx_tuple__126);
-  __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__126, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_write_heading, 590, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":593
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
- * 
- *     def convertGT(self, GTstring):             # <<<<<<<<<<<<<<
- *         if GTstring == ".": return ["."]
- *         try:
- */
-  __pyx_tuple__128 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_GTstring, __pyx_n_s_gts); if (unlikely(!__pyx_tuple__128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__128);
-  __Pyx_GIVEREF(__pyx_tuple__128);
-  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_convertGT, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":605
- *             return [".","|","."]
- * 
- *     def convertGTback(self, GTdata):             # <<<<<<<<<<<<<<
- *         return ''.join(map(str,GTdata))
- * 
- */
-  __pyx_tuple__130 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_GTdata); if (unlikely(!__pyx_tuple__130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__130);
-  __Pyx_GIVEREF(__pyx_tuple__130);
-  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_convertGTback, 605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":608
- *         return ''.join(map(str,GTdata))
- * 
- *     def parse_formatdata( self, key, value, formatdict, line ):             # <<<<<<<<<<<<<<
- *         # To do: check that the right number of values is present
- *         f = formatdict.get(key,None)
- */
-  __pyx_tuple__132 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_formatdict, __pyx_n_s_line, __pyx_n_s_f, __pyx_n_s_values, __pyx_n_s_idx, __pyx_n_s_v); if (unlikely(!__pyx_tuple__132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__132);
-  __Pyx_GIVEREF(__pyx_tuple__132);
-  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse_formatdata, 608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":650
- *             self.error(line,self.ERROR_INFO_STRING)
- * 
- *     def inregion(self, chrom, pos):             # <<<<<<<<<<<<<<
- *         if not self._regions: return True
- *         for r in self._regions:
- */
-  __pyx_tuple__134 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_chrom, __pyx_n_s_pos, __pyx_n_s_r); if (unlikely(!__pyx_tuple__134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__134);
-  __Pyx_GIVEREF(__pyx_tuple__134);
-  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_inregion, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":656
- *         return False
- * 
- *     def parse_data( self, line, lineparse=False ):             # <<<<<<<<<<<<<<
- *         cols = line.split('\t')
- *         if len(cols) != len(self._samples)+9:
- */
-  __pyx_tuple__136 = PyTuple_Pack(43, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_lineparse, __pyx_n_s_cols, __pyx_n_s_chrom, __pyx_n_s_pos, __pyx_n_s_id, __pyx_n_s_ref, __pyx_n_s_c, __pyx_n_s_left, __pyx_n_s_faref_leftflank, __pyx_n_s_faref, __pyx_n_s_alt, __pyx_n_s_qual, __pyx_n_s_filter_2, __pyx_n_s_info_2, __pyx_n_s_blurp, __pyx_n_s_elts, __pyx_n_s_v, __pyx_n_s_format, __pyx_n_s_f, __pyx_n_s_newalts, __pyx_n_s_have_deletions, __pyx_n_s_a, __pyx_n_s_l, __pyx_n_s_addns, __pyx_n_s_i, __py [...]
-  __Pyx_GOTREF(__pyx_tuple__136);
-  __Pyx_GIVEREF(__pyx_tuple__136);
-  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(3, 0, 43, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse_data, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__138 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__138);
-  __Pyx_GIVEREF(__pyx_tuple__138);
-
-  /* "pysam/cvcf.pyx":868
- * 
- * 
- *     def write_data(self, stream, data):             # <<<<<<<<<<<<<<
- *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
- *         for k in required:
- */
-  __pyx_tuple__139 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_data, __pyx_n_s_required_2, __pyx_n_s_k, __pyx_n_s_alt, __pyx_n_s_filter_2, __pyx_n_s_qual, __pyx_n_s_output_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__139);
-  __Pyx_GIVEREF(__pyx_tuple__139);
-  __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_write_data, 868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":900
- *         stream.write( "\t".join(output) + "\n" )
- * 
- *     def _parse_header(self, stream):             # <<<<<<<<<<<<<<
- *         self._lineno = 0
- *         for line in stream:
- */
-  __pyx_tuple__141 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_line); if (unlikely(!__pyx_tuple__141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__141);
-  __Pyx_GIVEREF(__pyx_tuple__141);
-  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse_header_2, 900, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":914
- *         return line
- * 
- *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
- *         # deal with files with header only
- *         if line.startswith("##"): return
- */
-  __pyx_tuple__143 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_line, __pyx_n_s_stream, __pyx_n_s_d); if (unlikely(!__pyx_tuple__143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__143);
-  __Pyx_GIVEREF(__pyx_tuple__143);
-  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse, 914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":932
- *     ######################################################################################################
- * 
- *     def getsamples(self):             # <<<<<<<<<<<<<<
- *         """ List of samples in VCF file """
- *         return self._samples
- */
-  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__145);
-  __Pyx_GIVEREF(__pyx_tuple__145);
-  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_getsamples, 932, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":936
- *         return self._samples
- * 
- *     def setsamples(self,samples):             # <<<<<<<<<<<<<<
- *         """ List of samples in VCF file """
- *         self._samples = samples
- */
-  __pyx_tuple__147 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_samples_2); if (unlikely(!__pyx_tuple__147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__147);
-  __Pyx_GIVEREF(__pyx_tuple__147);
-  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setsamples, 936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":940
- *         self._samples = samples
- * 
- *     def getheader(self):             # <<<<<<<<<<<<<<
- *         """ List of header key-value pairs (strings) """
- *         return self._header
- */
-  __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__149);
-  __Pyx_GIVEREF(__pyx_tuple__149);
-  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_getheader, 940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":944
- *         return self._header
- * 
- *     def setheader(self,header):             # <<<<<<<<<<<<<<
- *         """ List of header key-value pairs (strings) """
- *         self._header = header
- */
-  __pyx_tuple__151 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_header_2); if (unlikely(!__pyx_tuple__151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__151);
-  __Pyx_GIVEREF(__pyx_tuple__151);
-  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setheader, 944, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":948
- *         self._header = header
- * 
- *     def getinfo(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         return self._info
- */
-  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__153);
-  __Pyx_GIVEREF(__pyx_tuple__153);
-  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_getinfo, 948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":952
- *         return self._info
- * 
- *     def setinfo(self,info):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         self._info = info
- */
-  __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_info_2); if (unlikely(!__pyx_tuple__155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__155);
-  __Pyx_GIVEREF(__pyx_tuple__155);
-  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setinfo, 952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":956
- *         self._info = info
- * 
- *     def getformat(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         return self._format
- */
-  __pyx_tuple__157 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__157);
-  __Pyx_GIVEREF(__pyx_tuple__157);
-  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_getformat, 956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":960
- *         return self._format
- * 
- *     def setformat(self,format):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         self._format = format
- */
-  __pyx_tuple__159 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_format); if (unlikely(!__pyx_tuple__159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__159);
-  __Pyx_GIVEREF(__pyx_tuple__159);
-  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setformat, 960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":964
- *         self._format = format
- * 
- *     def getfilter(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         return self._filter
- */
-  __pyx_tuple__161 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__161);
-  __Pyx_GIVEREF(__pyx_tuple__161);
-  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_getfilter, 964, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":968
- *         return self._filter
- * 
- *     def setfilter(self,filter):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         self._filter = filter
- */
-  __pyx_tuple__163 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filter_2); if (unlikely(!__pyx_tuple__163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__163);
-  __Pyx_GIVEREF(__pyx_tuple__163);
-  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setfilter, 968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":972
- *         self._filter = filter
- * 
- *     def setversion(self, version):             # <<<<<<<<<<<<<<
- *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
- *         self._version = version
- */
-  __pyx_tuple__165 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_version_2); if (unlikely(!__pyx_tuple__165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__165);
-  __Pyx_GIVEREF(__pyx_tuple__165);
-  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setversion, 972, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":976
- *         self._version = version
- * 
- *     def setregions(self, regions):             # <<<<<<<<<<<<<<
- *         self._regions = regions
- * 
- */
-  __pyx_tuple__167 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_regions); if (unlikely(!__pyx_tuple__167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__167);
-  __Pyx_GIVEREF(__pyx_tuple__167);
-  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setregions, 976, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":979
- *         self._regions = regions
- * 
- *     def setreference(self, ref):             # <<<<<<<<<<<<<<
- *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
- *         self._reference = ref
- */
-  __pyx_tuple__169 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ref); if (unlikely(!__pyx_tuple__169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__169);
-  __Pyx_GIVEREF(__pyx_tuple__169);
-  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_setreference, 979, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":983
- *         self._reference = ref
- * 
- *     def ignoreerror(self, errorstring):             # <<<<<<<<<<<<<<
- *         try:             self._ignored_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- */
-  __pyx_tuple__171 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_errorstring); if (unlikely(!__pyx_tuple__171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__171);
-  __Pyx_GIVEREF(__pyx_tuple__171);
-  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_ignoreerror, 983, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":987
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- *     def warnerror(self, errorstring):             # <<<<<<<<<<<<<<
- *         try:             self._warn_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- */
-  __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_errorstring); if (unlikely(!__pyx_tuple__173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__173);
-  __Pyx_GIVEREF(__pyx_tuple__173);
-  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_warnerror, 987, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":991
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- *     def parse(self, stream):             # <<<<<<<<<<<<<<
- *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
- *         last_line = self._parse_header(stream)
- */
-  __pyx_tuple__175 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_last_line); if (unlikely(!__pyx_tuple__175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__175);
-  __Pyx_GIVEREF(__pyx_tuple__175);
-  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_parse_2, 991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":998
- *         return self._parse(last_line, stream)
- * 
- *     def write(self, stream, datagenerator):             # <<<<<<<<<<<<<<
- *         """ Writes a VCF file to a stream, using a data generator (or list) """
- *         self.write_header(stream)
- */
-  __pyx_tuple__177 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_stream, __pyx_n_s_datagenerator, __pyx_n_s_data); if (unlikely(!__pyx_tuple__177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__177);
-  __Pyx_GIVEREF(__pyx_tuple__177);
-  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_write, 998, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":1004
- *         for data in datagenerator: self.write_data(stream,data)
- * 
- *     def writeheader(self, stream):             # <<<<<<<<<<<<<<
- *         """ Writes a VCF header """
- *         self.write_header(stream)
- */
-  __pyx_tuple__179 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_stream); if (unlikely(!__pyx_tuple__179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__179);
-  __Pyx_GIVEREF(__pyx_tuple__179);
-  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_writeheader, 1004, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":1009
- *         self.write_heading(stream)
- * 
- *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):             # <<<<<<<<<<<<<<
- *         """ Utility function: compares two calls for equality """
- *         # a variant should always be assigned to a unique position, one base before
- */
-  __pyx_tuple__181 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_pos1, __pyx_n_s_ref1, __pyx_n_s_alt1, __pyx_n_s_pos2, __pyx_n_s_ref2, __pyx_n_s_alt2); if (unlikely(!__pyx_tuple__181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__181);
-  __Pyx_GIVEREF(__pyx_tuple__181);
-  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_compare_calls, 1009, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":1031
- * ###########################################################################################################
- * 
- *     def connect(self, filename, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         '''connect to tabix file.'''
- *         self.encoding=encoding
- */
-  __pyx_tuple__183 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__183);
-  __Pyx_GIVEREF(__pyx_tuple__183);
-  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_connect, 1031, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__185 = PyTuple_Pack(1, ((PyObject*)__pyx_n_s_ascii)); if (unlikely(!__pyx_tuple__185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__185);
-  __Pyx_GIVEREF(__pyx_tuple__185);
-
-  /* "pysam/cvcf.pyx":1037
- *         self._parse_header(self.tabixfile.header)
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-  __pyx_tuple__186 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_reference, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_region); if (unlikely(!__pyx_tuple__186)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__186);
-  __Pyx_GIVEREF(__pyx_tuple__186);
-  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_fetch, 1037, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_tuple__188 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__188)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__188);
-  __Pyx_GIVEREF(__pyx_tuple__188);
-
-  /* "pysam/cvcf.pyx":1051
- *             parser = asVCFRecord(self))
- * 
- *     def validate(self, record):             # <<<<<<<<<<<<<<
- *         '''validate vcf record.
- * 
- */
-  __pyx_tuple__189 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_record); if (unlikely(!__pyx_tuple__189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_tuple__189);
-  __Pyx_GIVEREF(__pyx_tuple__189);
-  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_andreas_devel_pysam_pysam, __pyx_n_s_validate, 1051, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __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_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_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_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_17 = PyInt_FromLong(17); if (unlikely(!__pyx_int_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_18 = PyInt_FromLong(18); if (unlikely(!__pyx_int_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_19 = PyInt_FromLong(19); if (unlikely(!__pyx_int_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_21 = PyInt_FromLong(21); if (unlikely(!__pyx_int_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_22 = PyInt_FromLong(22); if (unlikely(!__pyx_int_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_23 = PyInt_FromLong(23); if (unlikely(!__pyx_int_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_25 = PyInt_FromLong(25); if (unlikely(!__pyx_int_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_27 = PyInt_FromLong(27); if (unlikely(!__pyx_int_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_28 = PyInt_FromLong(28); if (unlikely(!__pyx_int_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_29 = PyInt_FromLong(29); if (unlikely(!__pyx_int_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_31 = PyInt_FromLong(31); if (unlikely(!__pyx_int_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_33 = PyInt_FromLong(33); if (unlikely(!__pyx_int_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_3000000000 = PyInt_FromString((char *)"3000000000", 0, 0); if (unlikely(!__pyx_int_3000000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  return 0;
-  __pyx_L1_error:;
-  return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC initcvcf(void); /*proto*/
-PyMODINIT_FUNC initcvcf(void)
-#else
-PyMODINIT_FUNC PyInit_cvcf(void); /*proto*/
-PyMODINIT_FUNC PyInit_cvcf(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;
-  int __pyx_lineno = 0;
-  const char *__pyx_filename = NULL;
-  int __pyx_clineno = 0;
-  __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_cvcf(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("cvcf"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
-  #else
-  __pyx_m = PyModule_Create(&__pyx_moduledef);
-  #endif
-  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  Py_INCREF(__pyx_d);
-  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #if CYTHON_COMPILING_IN_PYPY
-  Py_INCREF(__pyx_b);
-  #endif
-  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 PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
-  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  #endif
-  if (__pyx_module_is_main_pysam__cvcf) {
-    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;};
-  }
-  #if PY_MAJOR_VERSION >= 3
-  {
-    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    if (!PyDict_GetItemString(modules, "pysam.cvcf")) {
-      if (unlikely(PyDict_SetItemString(modules, "pysam.cvcf", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-    }
-  }
-  #endif
-  /*--- Builtin init code ---*/
-  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Constants init code ---*/
-  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Global init code ---*/
-  /*--- Variable export code ---*/
-  /*--- Function export code ---*/
-  /*--- Type init code ---*/
-  __pyx_ptype_5pysam_10TabProxies_TupleProxy = __Pyx_ImportType("pysam.TabProxies", "TupleProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_TupleProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_TupleProxy)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_TupleProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_TupleProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_TupleProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_TupleProxy)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_4cvcf_VCFRecord = &__pyx_vtable_5pysam_4cvcf_VCFRecord;
-  __pyx_vtable_5pysam_4cvcf_VCFRecord.__pyx_base = *__pyx_vtabptr_5pysam_10TabProxies_TupleProxy;
-  __pyx_vtable_5pysam_4cvcf_VCFRecord.__pyx_base.update = (PyObject *(*)(struct __pyx_obj_5pysam_10TabProxies_TupleProxy *, char *, size_t))__pyx_f_5pysam_4cvcf_9VCFRecord_update;
-  __pyx_type_5pysam_4cvcf_VCFRecord.tp_base = __pyx_ptype_5pysam_10TabProxies_TupleProxy;
-  if (PyType_Ready(&__pyx_type_5pysam_4cvcf_VCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_4cvcf_VCFRecord.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_4cvcf_VCFRecord.tp_dict, __pyx_vtabptr_5pysam_4cvcf_VCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "VCFRecord", (PyObject *)&__pyx_type_5pysam_4cvcf_VCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_4cvcf_VCFRecord = &__pyx_type_5pysam_4cvcf_VCFRecord;
-  __pyx_ptype_5pysam_6ctabix_Parser = __Pyx_ImportType("pysam.ctabix", "Parser", sizeof(struct __pyx_obj_5pysam_6ctabix_Parser), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_Parser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_Parser = (struct __pyx_vtabstruct_5pysam_6ctabix_Parser*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_Parser->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_Parser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_4cvcf_asVCFRecord = &__pyx_vtable_5pysam_4cvcf_asVCFRecord;
-  __pyx_vtable_5pysam_4cvcf_asVCFRecord.__pyx_base = *__pyx_vtabptr_5pysam_6ctabix_Parser;
-  __pyx_vtable_5pysam_4cvcf_asVCFRecord.__pyx_base.parse = (PyObject *(*)(struct __pyx_obj_5pysam_6ctabix_Parser *, char *, int))__pyx_f_5pysam_4cvcf_11asVCFRecord_parse;
-  __pyx_type_5pysam_4cvcf_asVCFRecord.tp_base = __pyx_ptype_5pysam_6ctabix_Parser;
-  if (PyType_Ready(&__pyx_type_5pysam_4cvcf_asVCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_4cvcf_asVCFRecord.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_5pysam_4cvcf_asVCFRecord.tp_dict, __pyx_vtabptr_5pysam_4cvcf_asVCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_SetAttrString(__pyx_m, "asVCFRecord", (PyObject *)&__pyx_type_5pysam_4cvcf_asVCFRecord) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_4cvcf_asVCFRecord = &__pyx_type_5pysam_4cvcf_asVCFRecord;
-  if (PyType_Ready(&__pyx_type_5pysam_4cvcf___pyx_scope_struct___parse) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_type_5pysam_4cvcf___pyx_scope_struct___parse.tp_print = 0;
-  __pyx_ptype_5pysam_4cvcf___pyx_scope_struct___parse = &__pyx_type_5pysam_4cvcf___pyx_scope_struct___parse;
-  /*--- Type import code ---*/
-  __pyx_ptype_5pysam_6ctabix_tabix_file_iterator = __Pyx_ImportType("pysam.ctabix", "tabix_file_iterator", sizeof(struct __pyx_obj_5pysam_6ctabix_tabix_file_iterator), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_tabix_file_iterator)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_tabix_file_iterator = (struct __pyx_vtabstruct_5pysam_6ctabix_tabix_file_iterator*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_tabix_file_iterator->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_tabix_file_iterator)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_TabixFile = __Pyx_ImportType("pysam.ctabix", "TabixFile", sizeof(struct __pyx_obj_5pysam_6ctabix_TabixFile), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_TabixFile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_asTuple = __Pyx_ImportType("pysam.ctabix", "asTuple", sizeof(struct __pyx_obj_5pysam_6ctabix_asTuple), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_asTuple)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_asTuple = (struct __pyx_vtabstruct_5pysam_6ctabix_asTuple*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_asTuple->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_asTuple)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_asGTF = __Pyx_ImportType("pysam.ctabix", "asGTF", sizeof(struct __pyx_obj_5pysam_6ctabix_asGTF), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_asGTF)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_asGTF = (struct __pyx_vtabstruct_5pysam_6ctabix_asGTF*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_asGTF->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_asGTF)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_asBed = __Pyx_ImportType("pysam.ctabix", "asBed", sizeof(struct __pyx_obj_5pysam_6ctabix_asBed), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_asBed)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_asBed = (struct __pyx_vtabstruct_5pysam_6ctabix_asBed*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_asBed->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_asBed)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_asVCF = __Pyx_ImportType("pysam.ctabix", "asVCF", sizeof(struct __pyx_obj_5pysam_6ctabix_asVCF), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_asVCF)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_asVCF = (struct __pyx_vtabstruct_5pysam_6ctabix_asVCF*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_asVCF->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_asVCF)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_TabixIterator = __Pyx_ImportType("pysam.ctabix", "TabixIterator", sizeof(struct __pyx_obj_5pysam_6ctabix_TabixIterator), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_TabixIterator)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_TabixIterator = (struct __pyx_vtabstruct_5pysam_6ctabix_TabixIterator*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_TabixIterator->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_TabixIterator)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_TabixIteratorParsed = __Pyx_ImportType("pysam.ctabix", "TabixIteratorParsed", sizeof(struct __pyx_obj_5pysam_6ctabix_TabixIteratorParsed), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_TabixIteratorParsed)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_TabixIteratorParsed = (struct __pyx_vtabstruct_5pysam_6ctabix_TabixIteratorParsed*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_TabixIteratorParsed->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_TabixIteratorParsed)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_GZIterator = __Pyx_ImportType("pysam.ctabix", "GZIterator", sizeof(struct __pyx_obj_5pysam_6ctabix_GZIterator), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_GZIterator)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_GZIterator = (struct __pyx_vtabstruct_5pysam_6ctabix_GZIterator*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_GZIterator->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_GZIterator)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_GZIteratorHead = __Pyx_ImportType("pysam.ctabix", "GZIteratorHead", sizeof(struct __pyx_obj_5pysam_6ctabix_GZIteratorHead), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_GZIteratorHead)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_GZIteratorHead = (struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorHead*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_GZIteratorHead->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_GZIteratorHead)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_GZIteratorParsed = __Pyx_ImportType("pysam.ctabix", "GZIteratorParsed", sizeof(struct __pyx_obj_5pysam_6ctabix_GZIteratorParsed), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_GZIteratorParsed)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_6ctabix_GZIteratorParsed = (struct __pyx_vtabstruct_5pysam_6ctabix_GZIteratorParsed*)__Pyx_GetVtable(__pyx_ptype_5pysam_6ctabix_GZIteratorParsed->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6ctabix_GZIteratorParsed)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_6ctabix_Tabixfile = __Pyx_ImportType("pysam.ctabix", "Tabixfile", sizeof(struct __pyx_obj_5pysam_6ctabix_Tabixfile), 1); if (unlikely(!__pyx_ptype_5pysam_6ctabix_Tabixfile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_GTFProxy = __Pyx_ImportType("pysam.TabProxies", "GTFProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_GTFProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_GTFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_GTFProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_GTFProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_GTFProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_GTFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_NamedTupleProxy = __Pyx_ImportType("pysam.TabProxies", "NamedTupleProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_NamedTupleProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_NamedTupleProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_NamedTupleProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_NamedTupleProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_BedProxy = __Pyx_ImportType("pysam.TabProxies", "BedProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_BedProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_BedProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_BedProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_BedProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_BedProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_BedProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_ptype_5pysam_10TabProxies_VCFProxy = __Pyx_ImportType("pysam.TabProxies", "VCFProxy", sizeof(struct __pyx_obj_5pysam_10TabProxies_VCFProxy), 1); if (unlikely(!__pyx_ptype_5pysam_10TabProxies_VCFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __pyx_vtabptr_5pysam_10TabProxies_VCFProxy = (struct __pyx_vtabstruct_5pysam_10TabProxies_VCFProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_10TabProxies_VCFProxy->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_10TabProxies_VCFProxy)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  /*--- Variable import code ---*/
-  /*--- Function import code ---*/
-  __pyx_t_1 = __Pyx_ImportModule("pysam.ctabix"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (__Pyx_ImportFunction(__pyx_t_1, "_force_str", (void (**)(void))&__pyx_f_5pysam_6ctabix__force_str, "PyObject *(PyObject *, struct __pyx_opt_args_5pysam_6ctabix__force_str *__pyx_optional_args)") < 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;
-  /*--- Execution code ---*/
-
-  /* "pysam/cvcf.pyx":47
- * #
- * 
- * from collections import namedtuple, defaultdict             # <<<<<<<<<<<<<<
- * from operator import itemgetter
- * import sys, re, copy, bisect
- */
-  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_INCREF(__pyx_n_s_namedtuple);
-  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple);
-  __Pyx_GIVEREF(__pyx_n_s_namedtuple);
-  __Pyx_INCREF(__pyx_n_s_defaultdict);
-  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_defaultdict);
-  __Pyx_GIVEREF(__pyx_n_s_defaultdict);
-  __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_defaultdict, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":48
- * 
- * from collections import namedtuple, defaultdict
- * from operator import itemgetter             # <<<<<<<<<<<<<<
- * import sys, re, copy, bisect
- * 
- */
-  __pyx_t_3 = PyList_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(__pyx_n_s_itemgetter);
-  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_itemgetter);
-  __Pyx_GIVEREF(__pyx_n_s_itemgetter);
-  __pyx_t_2 = __Pyx_Import(__pyx_n_s_operator, __pyx_t_3, -1); 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_3); __pyx_t_3 = 0;
-  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_itemgetter); 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);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itemgetter, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":49
- * from collections import namedtuple, defaultdict
- * from operator import itemgetter
- * import sys, re, copy, bisect             # <<<<<<<<<<<<<<
- * 
- * cimport ctabix
- */
-  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy_2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_Import(__pyx_n_s_bisect, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bisect, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":54
- * cimport TabProxies
- * 
- * import pysam             # <<<<<<<<<<<<<<
- * 
- * gtsRegEx = re.compile("[|/\\\\]")
- */
-  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pysam, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pysam, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":56
- * import pysam
- * 
- * gtsRegEx = re.compile("[|/\\\\]")             # <<<<<<<<<<<<<<
- * alleleRegEx = re.compile('^[ACGTN]+$')
- * 
- */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gtsRegEx, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":57
- * 
- * gtsRegEx = re.compile("[|/\\\\]")
- * alleleRegEx = re.compile('^[ACGTN]+$')             # <<<<<<<<<<<<<<
- * 
- * # Utility function.  Uses 0-based coordinates
- */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_compile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_alleleRegEx, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":60
- * 
- * # Utility function.  Uses 0-based coordinates
- * def get_sequence(chrom, start, end, fa):             # <<<<<<<<<<<<<<
- *     # obtain sequence from .fa file, without truncation
- *     if end<=start: return ""
- */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_1get_sequence, NULL, __pyx_n_s_pysam_cvcf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_sequence, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":70
- * 
- * # Utility function.  Parses a region string
- * def parse_regions( string ):             # <<<<<<<<<<<<<<
- *     result = []
- *     for r in string.split(','):
- */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3parse_regions, NULL, __pyx_n_s_pysam_cvcf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_regions, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
-  /* "pysam/cvcf.pyx":88
- * 
- * 
- * FORMAT = namedtuple('FORMAT','id numbertype number type description missingvalue')             # <<<<<<<<<<<<<<
- * 
- * ###########################################################################################################
- */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORMAT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":242
- *         return r
- * 
- * class VCF(object):             # <<<<<<<<<<<<<<
- * 
- *     # types
- */
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_builtin_object);
-  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object);
-  __Pyx_GIVEREF(__pyx_builtin_object);
-  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_VCF, __pyx_n_s_VCF, (PyObject *) NULL, __pyx_n_s_pysam_cvcf, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_4);
-
-  /* "pysam/cvcf.pyx":245
- * 
- *     # types
- *     NT_UNKNOWN = 0             # <<<<<<<<<<<<<<
- *     NT_NUMBER = 1
- *     NT_ALLELES = 2
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_NT_UNKNOWN, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":246
- *     # types
- *     NT_UNKNOWN = 0
- *     NT_NUMBER = 1             # <<<<<<<<<<<<<<
- *     NT_ALLELES = 2
- *     NT_NR_ALLELES = 3
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_NT_NUMBER, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":247
- *     NT_UNKNOWN = 0
- *     NT_NUMBER = 1
- *     NT_ALLELES = 2             # <<<<<<<<<<<<<<
- *     NT_NR_ALLELES = 3
- *     NT_GENOTYPES = 4
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_NT_ALLELES, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":248
- *     NT_NUMBER = 1
- *     NT_ALLELES = 2
- *     NT_NR_ALLELES = 3             # <<<<<<<<<<<<<<
- *     NT_GENOTYPES = 4
- *     NT_PHASED_GENOTYPES = 5
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_NT_NR_ALLELES, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":249
- *     NT_ALLELES = 2
- *     NT_NR_ALLELES = 3
- *     NT_GENOTYPES = 4             # <<<<<<<<<<<<<<
- *     NT_PHASED_GENOTYPES = 5
- * 
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_NT_GENOTYPES, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":250
- *     NT_NR_ALLELES = 3
- *     NT_GENOTYPES = 4
- *     NT_PHASED_GENOTYPES = 5             # <<<<<<<<<<<<<<
- * 
- *     _errors = { 0:"UNKNOWN_FORMAT_STRING:Unknown file format identifier",
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_NT_PHASED_GENOTYPES, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":252
- *     NT_PHASED_GENOTYPES = 5
- * 
- *     _errors = { 0:"UNKNOWN_FORMAT_STRING:Unknown file format identifier",             # <<<<<<<<<<<<<<
- *                 1:"BADLY_FORMATTED_FORMAT_STRING:Formatting error in the format string",
- *                 2:"BADLY_FORMATTED_HEADING:Did not find 9 required headings (CHROM, POS, ..., FORMAT) %s",
- */
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_0, __pyx_kp_s_UNKNOWN_FORMAT_STRING_Unknown_fi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_1, __pyx_kp_s_BADLY_FORMATTED_FORMAT_STRING_Fo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_2, __pyx_kp_s_BADLY_FORMATTED_HEADING_Did_not) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_3, __pyx_kp_s_BAD_NUMBER_OF_COLUMNS_Wrong_numb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_4, __pyx_kp_s_POS_NOT_NUMERICAL_Position_colum) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_5, __pyx_kp_s_UNKNOWN_CHAR_IN_REF_Unknown_char) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_6, __pyx_kp_s_V33_BAD_REF_Reference_should_be) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_7, __pyx_kp_s_V33_BAD_ALLELE_Cannot_interpret) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_8, __pyx_kp_s_POS_NOT_POSITIVE_Position_field) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_9, __pyx_kp_s_QUAL_NOT_NUMERICAL_Quality_field) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_10, __pyx_kp_s_ERROR_INFO_STRING_Error_while_pa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_11, __pyx_kp_s_ERROR_UNKNOWN_KEY_Unknown_key_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_12, __pyx_kp_s_ERROR_FORMAT_NOT_NUMERICAL_Expec) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_13, __pyx_kp_s_ERROR_FORMAT_NOT_CHAR_Eexpected) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_14, __pyx_kp_s_FILTER_NOT_DEFINED_Identifier_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_15, __pyx_kp_s_FORMAT_NOT_DEFINED_Identifier_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_16, __pyx_kp_s_BAD_NUMBER_OF_VALUES_Found_too_m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_17, __pyx_kp_s_BAD_NUMBER_OF_PARAMETERS_Found_u) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_18, __pyx_kp_s_BAD_GENOTYPE_Cannot_parse_genoty) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_19, __pyx_kp_s_V40_BAD_ALLELE_Bad_allele_found) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_20, __pyx_kp_s_MISSING_REF_Reference_allele_mis) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_21, __pyx_kp_s_V33_UNMATCHED_DELETION_Deleted_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_22, __pyx_kp_s_V40_MISSING_ANGLE_BRACKETS_Forma) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_23, __pyx_kp_s_FORMAT_MISSING_QUOTES_Descriptio) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_24, __pyx_kp_s_V40_FORMAT_MUST_HAVE_NAMED_FIELD_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_25, __pyx_kp_s_HEADING_NOT_SEPARATED_BY_TABS_He) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_26, __pyx_kp_s_WRONG_REF_Wrong_reference_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_27, __pyx_kp_s_ERROR_TRAILING_DATA_Numerical_fi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_28, __pyx_kp_s_BAD_CHR_TAG_Error_calculating_ch) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_29, __pyx_kp_s_ZERO_LENGTH_ALLELE_Found_zero_le) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_30, __pyx_kp_s_MISSING_INDEL_ALLELE_REF_BASE_In) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_31, __pyx_kp_s_ZERO_FOR_NON_FLAG_FIELD_number_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_32, __pyx_kp_s_ERROR_FORMAT_NOT_INTEGER_Expecte) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyDict_SetItem(__pyx_t_5, __pyx_int_33, __pyx_kp_s_ERROR_FLAG_HAS_VALUE_Flag_fields) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_errors, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":289
- * 
- *     # tag-value pairs; tags are not unique; does not include fileformat, INFO, FILTER or FORMAT fields
- *     _header = []             # <<<<<<<<<<<<<<
- * 
- *     # version number; 33=v3.3; 40=v4.0
- */
-  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_header, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":292
- * 
- *     # version number; 33=v3.3; 40=v4.0
- *     _version = 40             # <<<<<<<<<<<<<<
- * 
- *     # info, filter and format data
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_version, __pyx_int_40) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":295
- * 
- *     # info, filter and format data
- *     _info = {}             # <<<<<<<<<<<<<<
- *     _filter = {}
- *     _format = {}
- */
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_info, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":296
- *     # info, filter and format data
- *     _info = {}
- *     _filter = {}             # <<<<<<<<<<<<<<
- *     _format = {}
- * 
- */
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_filter, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":297
- *     _info = {}
- *     _filter = {}
- *     _format = {}             # <<<<<<<<<<<<<<
- * 
- *     # header; and required columns
- */
-  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_format_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":300
- * 
- *     # header; and required columns
- *     _required = ["CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"]             # <<<<<<<<<<<<<<
- *     _samples = []
- * 
- */
-  __pyx_t_5 = PyList_New(9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_INCREF(__pyx_n_s_CHROM);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_CHROM);
-  __Pyx_GIVEREF(__pyx_n_s_CHROM);
-  __Pyx_INCREF(__pyx_n_s_POS);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_POS);
-  __Pyx_GIVEREF(__pyx_n_s_POS);
-  __Pyx_INCREF(__pyx_n_s_ID_2);
-  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_n_s_ID_2);
-  __Pyx_GIVEREF(__pyx_n_s_ID_2);
-  __Pyx_INCREF(__pyx_n_s_REF);
-  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_n_s_REF);
-  __Pyx_GIVEREF(__pyx_n_s_REF);
-  __Pyx_INCREF(__pyx_n_s_ALT);
-  PyList_SET_ITEM(__pyx_t_5, 4, __pyx_n_s_ALT);
-  __Pyx_GIVEREF(__pyx_n_s_ALT);
-  __Pyx_INCREF(__pyx_n_s_QUAL);
-  PyList_SET_ITEM(__pyx_t_5, 5, __pyx_n_s_QUAL);
-  __Pyx_GIVEREF(__pyx_n_s_QUAL);
-  __Pyx_INCREF(__pyx_n_s_FILTER);
-  PyList_SET_ITEM(__pyx_t_5, 6, __pyx_n_s_FILTER);
-  __Pyx_GIVEREF(__pyx_n_s_FILTER);
-  __Pyx_INCREF(__pyx_n_s_INFO);
-  PyList_SET_ITEM(__pyx_t_5, 7, __pyx_n_s_INFO);
-  __Pyx_GIVEREF(__pyx_n_s_INFO);
-  __Pyx_INCREF(__pyx_n_s_FORMAT);
-  PyList_SET_ITEM(__pyx_t_5, 8, __pyx_n_s_FORMAT);
-  __Pyx_GIVEREF(__pyx_n_s_FORMAT);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_required, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":301
- *     # header; and required columns
- *     _required = ["CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO","FORMAT"]
- *     _samples = []             # <<<<<<<<<<<<<<
- * 
- *     # control behaviour
- */
-  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_samples, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":304
- * 
- *     # control behaviour
- *     _ignored_errors = set([11,31])   # ERROR_UNKNOWN_KEY, ERROR_ZERO_FOR_NON_FLAG_FIELD             # <<<<<<<<<<<<<<
- *     _warn_errors = set([])
- *     _leftalign = False
- */
-  __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PySet_Add(__pyx_t_5, __pyx_int_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PySet_Add(__pyx_t_5, __pyx_int_31) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_ignored_errors, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":305
- *     # control behaviour
- *     _ignored_errors = set([11,31])   # ERROR_UNKNOWN_KEY, ERROR_ZERO_FOR_NON_FLAG_FIELD
- *     _warn_errors = set([])             # <<<<<<<<<<<<<<
- *     _leftalign = False
- * 
- */
-  __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_warn_errors, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":306
- *     _ignored_errors = set([11,31])   # ERROR_UNKNOWN_KEY, ERROR_ZERO_FOR_NON_FLAG_FIELD
- *     _warn_errors = set([])
- *     _leftalign = False             # <<<<<<<<<<<<<<
- * 
- *     # reference sequence
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_leftalign_2, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":309
- * 
- *     # reference sequence
- *     _reference = None             # <<<<<<<<<<<<<<
- * 
- *     # regions to include; None includes everything
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_reference_2, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":312
- * 
- *     # regions to include; None includes everything
- *     _regions = None             # <<<<<<<<<<<<<<
- * 
- *     # statefull stuff
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_regions_2, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":315
- * 
- *     # statefull stuff
- *     _lineno = -1             # <<<<<<<<<<<<<<
- *     _line = None
- *     _lines = None
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_lineno, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":316
- *     # statefull stuff
- *     _lineno = -1
- *     _line = None             # <<<<<<<<<<<<<<
- *     _lines = None
- * 
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_line_2, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":317
- *     _lineno = -1
- *     _line = None
- *     _lines = None             # <<<<<<<<<<<<<<
- * 
- *     def __init__(self, _copy=None, reference=None, regions=None,
- */
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_lines_2, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
-  /* "pysam/cvcf.pyx":319
- *     _lines = None
- * 
- *     def __init__(self, _copy=None, reference=None, regions=None,             # <<<<<<<<<<<<<<
- *                  lines=None, leftalign=False):
- *         # make error identifiers accessible by name
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_1__init__, 0, __pyx_n_s_VCF___init, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__101);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":343
- *         self.encoding = "ascii"
- * 
- *     def error(self,line,error,opt=None):             # <<<<<<<<<<<<<<
- *         if error in self._ignored_errors: return
- *         errorlabel, errorstring = self._errors[error].split(':')
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_3error, 0, __pyx_n_s_VCF_error, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__104);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_error, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":352
- *         raise ValueError(errorstring)
- * 
- *     def parse_format(self,line,format,filter=False):             # <<<<<<<<<<<<<<
- *         if self._version == 40:
- *             if not format.startswith('<'):
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_5parse_format, 0, __pyx_n_s_VCF_parse_format, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__107);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_parse_format, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":424
- *         return FORMAT(data['id'],t,n,data['type'],data['descr'],data['missing'])
- * 
- *     def format_format( self, fmt, filter=False ):             # <<<<<<<<<<<<<<
- *         values = [('ID',fmt.id)]
- *         if fmt.number != None and not filter:
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_7format_format, 0, __pyx_n_s_VCF_format_format, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__110);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_format_format, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":444
- *         return format
- * 
- *     def get_expected(self, format, formatdict, alt):             # <<<<<<<<<<<<<<
- *         fmt = formatdict[format]
- *         if fmt.numbertype == self.NT_UNKNOWN: return -1
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_9get_expected, 0, __pyx_n_s_VCF_get_expected, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_get_expected, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":455
- * 
- * 
- *     def _add_definition(self, formatdict, key, data, line ):             # <<<<<<<<<<<<<<
- *         if key in formatdict: return
- *         self.error(line,self.ERROR_UNKNOWN_KEY,key)
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_11_add_definition, 0, __pyx_n_s_VCF__add_definition, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_add_definition, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":472
- * 
- *     # todo: trim trailing missing values
- *     def format_formatdata( self, data, format, key=True, value=True, separator=":" ):             # <<<<<<<<<<<<<<
- *         output, sdata = [], []
- *         if type(data) == type([]): # for FORMAT field, make data with dummy values
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_13format_formatdata, 0, __pyx_n_s_VCF_format_formatdata, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__117);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_format_formatdata, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":506
- * 
- * 
- *     def enter_default_format(self):             # <<<<<<<<<<<<<<
- *         for f in [FORMAT('GT',self.NT_NUMBER,1,'String','Genotype','.'),
- *                   FORMAT('DP',self.NT_NUMBER,1,'Integer','Read depth at this position for this sample',-1),
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_15enter_default_format, 0, __pyx_n_s_VCF_enter_default_format, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_enter_default_format, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":525
- *                 self._format[f.id] = f
- * 
- *     def parse_header(self, line):             # <<<<<<<<<<<<<<
- * 
- *         assert line.startswith('##')
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_17parse_header, 0, __pyx_n_s_VCF_parse_header, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_parse_header, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":555
- * 
- * 
- *     def write_header( self, stream ):             # <<<<<<<<<<<<<<
- *         stream.write("##fileformat=VCFv%s.%s\n" % (self._version // 10, self._version % 10))
- *         for key,value in self._header: stream.write("##%s=%s\n" % (key,value))
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_19write_header, 0, __pyx_n_s_VCF_write_header, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_write_header, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":562
- * 
- * 
- *     def parse_heading( self, line ):             # <<<<<<<<<<<<<<
- *         assert line.startswith('#')
- *         assert not line.startswith('##')
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_21parse_heading, 0, __pyx_n_s_VCF_parse_heading, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_parse_heading, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":590
- *         self._sample2column = dict( [(y,x+9) for x,y in enumerate( self._samples ) ] )
- * 
- *     def write_heading( self, stream ):             # <<<<<<<<<<<<<<
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
- * 
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_23write_heading, 0, __pyx_n_s_VCF_write_heading, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_write_heading, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":593
- *         stream.write("#" + "\t".join(self._required + self._samples) + "\n")
- * 
- *     def convertGT(self, GTstring):             # <<<<<<<<<<<<<<
- *         if GTstring == ".": return ["."]
- *         try:
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_25convertGT, 0, __pyx_n_s_VCF_convertGT, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_convertGT, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":605
- *             return [".","|","."]
- * 
- *     def convertGTback(self, GTdata):             # <<<<<<<<<<<<<<
- *         return ''.join(map(str,GTdata))
- * 
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_27convertGTback, 0, __pyx_n_s_VCF_convertGTback, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_convertGTback, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":608
- *         return ''.join(map(str,GTdata))
- * 
- *     def parse_formatdata( self, key, value, formatdict, line ):             # <<<<<<<<<<<<<<
- *         # To do: check that the right number of values is present
- *         f = formatdict.get(key,None)
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_29parse_formatdata, 0, __pyx_n_s_VCF_parse_formatdata, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_parse_formatdata, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":650
- *             self.error(line,self.ERROR_INFO_STRING)
- * 
- *     def inregion(self, chrom, pos):             # <<<<<<<<<<<<<<
- *         if not self._regions: return True
- *         for r in self._regions:
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_31inregion, 0, __pyx_n_s_VCF_inregion, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_inregion, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":656
- *         return False
- * 
- *     def parse_data( self, line, lineparse=False ):             # <<<<<<<<<<<<<<
- *         cols = line.split('\t')
- *         if len(cols) != len(self._samples)+9:
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_33parse_data, 0, __pyx_n_s_VCF_parse_data, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__138);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_parse_data, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":868
- * 
- * 
- *     def write_data(self, stream, data):             # <<<<<<<<<<<<<<
- *         required = ['chrom','pos','id','ref','alt','qual','filter','info','format'] + self._samples
- *         for k in required:
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_35write_data, 0, __pyx_n_s_VCF_write_data, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_write_data, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":900
- *         stream.write( "\t".join(output) + "\n" )
- * 
- *     def _parse_header(self, stream):             # <<<<<<<<<<<<<<
- *         self._lineno = 0
- *         for line in stream:
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_37_parse_header, 0, __pyx_n_s_VCF__parse_header, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_parse_header_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":914
- *         return line
- * 
- *     def _parse(self, line, stream):             # <<<<<<<<<<<<<<
- *         # deal with files with header only
- *         if line.startswith("##"): return
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_39_parse, 0, __pyx_n_s_VCF__parse, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_parse, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":932
- *     ######################################################################################################
- * 
- *     def getsamples(self):             # <<<<<<<<<<<<<<
- *         """ List of samples in VCF file """
- *         return self._samples
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_42getsamples, 0, __pyx_n_s_VCF_getsamples, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_getsamples, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":936
- *         return self._samples
- * 
- *     def setsamples(self,samples):             # <<<<<<<<<<<<<<
- *         """ List of samples in VCF file """
- *         self._samples = samples
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_44setsamples, 0, __pyx_n_s_VCF_setsamples, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_setsamples, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":940
- *         self._samples = samples
- * 
- *     def getheader(self):             # <<<<<<<<<<<<<<
- *         """ List of header key-value pairs (strings) """
- *         return self._header
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_46getheader, 0, __pyx_n_s_VCF_getheader, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_getheader, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":944
- *         return self._header
- * 
- *     def setheader(self,header):             # <<<<<<<<<<<<<<
- *         """ List of header key-value pairs (strings) """
- *         self._header = header
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_48setheader, 0, __pyx_n_s_VCF_setheader, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_setheader, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":948
- *         self._header = header
- * 
- *     def getinfo(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         return self._info
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_50getinfo, 0, __pyx_n_s_VCF_getinfo, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_getinfo, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":952
- *         return self._info
- * 
- *     def setinfo(self,info):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##INFO tags, as VCF.FORMAT values """
- *         self._info = info
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_52setinfo, 0, __pyx_n_s_VCF_setinfo, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_setinfo, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":956
- *         self._info = info
- * 
- *     def getformat(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         return self._format
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_54getformat, 0, __pyx_n_s_VCF_getformat, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_getformat, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":960
- *         return self._format
- * 
- *     def setformat(self,format):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FORMAT tags, as VCF.FORMAT values """
- *         self._format = format
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_56setformat, 0, __pyx_n_s_VCF_setformat, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_setformat, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":964
- *         self._format = format
- * 
- *     def getfilter(self):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         return self._filter
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_58getfilter, 0, __pyx_n_s_VCF_getfilter, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_getfilter, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":968
- *         return self._filter
- * 
- *     def setfilter(self,filter):             # <<<<<<<<<<<<<<
- *         """ Dictionary of ##FILTER tags, as VCF.FORMAT values """
- *         self._filter = filter
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_60setfilter, 0, __pyx_n_s_VCF_setfilter, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_setfilter, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":972
- *         self._filter = filter
- * 
- *     def setversion(self, version):             # <<<<<<<<<<<<<<
- *         if version != 33 and version != 40: raise ValueError("Can only handle v3.3 and v4.0 VCF files")
- *         self._version = version
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_62setversion, 0, __pyx_n_s_VCF_setversion, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_setversion, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":976
- *         self._version = version
- * 
- *     def setregions(self, regions):             # <<<<<<<<<<<<<<
- *         self._regions = regions
- * 
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_64setregions, 0, __pyx_n_s_VCF_setregions, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_setregions, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":979
- *         self._regions = regions
- * 
- *     def setreference(self, ref):             # <<<<<<<<<<<<<<
- *         """ Provide a reference sequence; a Python class supporting a fetch(chromosome, start, end) method, e.g. PySam.FastaFile """
- *         self._reference = ref
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_66setreference, 0, __pyx_n_s_VCF_setreference, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_setreference, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":983
- *         self._reference = ref
- * 
- *     def ignoreerror(self, errorstring):             # <<<<<<<<<<<<<<
- *         try:             self._ignored_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_68ignoreerror, 0, __pyx_n_s_VCF_ignoreerror, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_ignoreerror, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":987
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- *     def warnerror(self, errorstring):             # <<<<<<<<<<<<<<
- *         try:             self._warn_errors.add(self.__dict__[errorstring])
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_70warnerror, 0, __pyx_n_s_VCF_warnerror, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_warnerror, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":991
- *         except KeyError: raise ValueError("Invalid error string: %s" % errorstring)
- * 
- *     def parse(self, stream):             # <<<<<<<<<<<<<<
- *         """ Parse a stream of VCF-formatted lines.  Initializes class instance and return generator """
- *         last_line = self._parse_header(stream)
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_72parse, 0, __pyx_n_s_VCF_parse, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_parse_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":998
- *         return self._parse(last_line, stream)
- * 
- *     def write(self, stream, datagenerator):             # <<<<<<<<<<<<<<
- *         """ Writes a VCF file to a stream, using a data generator (or list) """
- *         self.write_header(stream)
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_74write, 0, __pyx_n_s_VCF_write, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_write, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":1004
- *         for data in datagenerator: self.write_data(stream,data)
- * 
- *     def writeheader(self, stream):             # <<<<<<<<<<<<<<
- *         """ Writes a VCF header """
- *         self.write_header(stream)
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_76writeheader, 0, __pyx_n_s_VCF_writeheader, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_writeheader, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":1009
- *         self.write_heading(stream)
- * 
- *     def compare_calls(self, pos1, ref1, alt1, pos2, ref2, alt2):             # <<<<<<<<<<<<<<
- *         """ Utility function: compares two calls for equality """
- *         # a variant should always be assigned to a unique position, one base before
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_78compare_calls, 0, __pyx_n_s_VCF_compare_calls, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_compare_calls, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":1031
- * ###########################################################################################################
- * 
- *     def connect(self, filename, encoding="ascii"):             # <<<<<<<<<<<<<<
- *         '''connect to tabix file.'''
- *         self.encoding=encoding
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_80connect, 0, __pyx_n_s_VCF_connect, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__185);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_connect, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":1037
- *         self._parse_header(self.tabixfile.header)
- * 
- *     def fetch(self,             # <<<<<<<<<<<<<<
- *               reference=None,
- *               start=None,
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_82fetch, 0, __pyx_n_s_VCF_fetch, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__188);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_fetch, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":1051
- *             parser = asVCFRecord(self))
- * 
- *     def validate(self, record):             # <<<<<<<<<<<<<<
- *         '''validate vcf record.
- * 
- */
-  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5pysam_4cvcf_3VCF_84validate, 0, __pyx_n_s_VCF_validate, NULL, __pyx_n_s_pysam_cvcf, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_validate, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-
-  /* "pysam/cvcf.pyx":242
- *         return r
- * 
- * class VCF(object):             # <<<<<<<<<<<<<<
- * 
- *     # types
- */
-  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_VCF, __pyx_t_3, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VCF, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":1178
- *                     pos -= 1
- * 
- * __all__ = [             # <<<<<<<<<<<<<<
- *     "VCF", "VCFRecord", ]
- * 
- */
-  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  __Pyx_INCREF(__pyx_n_s_VCF);
-  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_VCF);
-  __Pyx_GIVEREF(__pyx_n_s_VCF);
-  __Pyx_INCREF(__pyx_n_s_VCFRecord);
-  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_VCFRecord);
-  __Pyx_GIVEREF(__pyx_n_s_VCFRecord);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
-  /* "pysam/cvcf.pyx":1
- * #             # <<<<<<<<<<<<<<
- * # Code to read, write and edit VCF files
- * #
- */
-  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 pysam.cvcf", __pyx_clineno, __pyx_lineno, __pyx_filename);
-    Py_DECREF(__pyx_m); __pyx_m = 0;
-  } else if (!PyErr_Occurred()) {
-    PyErr_SetString(PyExc_ImportError, "init pysam.cvcf");
-  }
-  __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_GetBuiltinName(PyObject *name) {
-    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
-    if (unlikely(!result)) {
-        PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
-            "name '%U' is not defined", name);
-#else
-            "name '%.200s' is not defined", PyString_AS_STRING(name));
-#endif
-    }
-    return result;
-}
-
-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,
-                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_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_AsString(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;
-            continue;
-        }
-        name = first_kw_arg;
-        #if PY_MAJOR_VERSION < 3
-        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
-            while (*name) {
-                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
-                        && _PyString_Eq(**name, key)) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    if ((**argname == key) || (
-                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
-                             && _PyString_Eq(**argname, key))) {
-                        goto arg_passed_twice;
-                    }
-                    argname++;
-                }
-            }
-        } else
-        #endif
-        if (likely(PyUnicode_Check(key))) {
-            while (*name) {
-                int cmp = (**name == key) ? 0 :
-                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
-                #endif
-                    PyUnicode_Compare(**name, key);
-                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                if (cmp == 0) {
-                    values[name-argnames] = value;
-                    break;
-                }
-                name++;
-            }
-            if (*name) continue;
-            else {
-                PyObject*** argname = argnames;
-                while (argname != first_kw_arg) {
-                    int cmp = (**argname == key) ? 0 :
-                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
-                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
-                    #endif
-                        PyUnicode_Compare(**argname, key);
-                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
-                    if (cmp == 0) goto arg_passed_twice;
-                    argname++;
-                }
-            }
-        } else
-            goto invalid_keyword_type;
-        if (kwds2) {
-            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
-        } else {
-            goto invalid_keyword;
-        }
-    }
-    return 0;
-arg_passed_twice:
-    __Pyx_RaiseDoubleKeywordsError(function_name, key);
-    goto bad;
-invalid_keyword_type:
-    PyErr_Format(PyExc_TypeError,
-        "%.200s() keywords must be strings", function_name);
-    goto bad;
-invalid_keyword:
-    PyErr_Format(PyExc_TypeError,
-    #if PY_MAJOR_VERSION < 3
-        "%.200s() got an unexpected keyword argument '%.200s'",
-        function_name, PyString_AsString(key));
-    #else
-        "%s() got an unexpected keyword argument '%U'",
-        function_name, key);
-    #endif
-bad:
-    return -1;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
-    PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
-    result = PyDict_GetItem(__pyx_d, name);
-    if (result) {
-        Py_INCREF(result);
-    } else {
-#else
-    result = PyObject_GetItem(__pyx_d, name);
-    if (!result) {
-        PyErr_Clear();
-#endif
-        result = __Pyx_GetBuiltinName(name);
-    }
-    return result;
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyObject *result;
-    ternaryfunc call = func->ob_type->tp_call;
-    if (unlikely(!call))
-        return PyObject_Call(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
-        return NULL;
-#endif
-    result = (*call)(func, arg, kw);
-#if PY_VERSION_HEX >= 0x02060000
-    Py_LeaveRecursiveCall();
-#endif
-    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
-        PyErr_SetString(
-            PyExc_SystemError,
-            "NULL result without error in PyObject_Call");
-    }
-    return result;
-}
-#endif
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
-    PyObject *r;
-    if (!j) return NULL;
-    r = PyObject_GetItem(o, j);
-    Py_DECREF(j);
-    return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
-        PyObject *r = PyList_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
-                                                              int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
-    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
-        PyObject *r = PyTuple_GET_ITEM(o, i);
-        Py_INCREF(r);
-        return r;
-    }
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
-    return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
-                                                     int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (is_list || PyList_CheckExact(o)) {
-        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
-        if ((!boundscheck) || (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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
-        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
-            PyObject *r = PyTuple_GET_ITEM(o, n);
-            Py_INCREF(r);
-            return r;
-        }
-    } else {
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_item)) {
-            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (likely(l >= 0)) {
-                    i += l;
-                } else {
-                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                        PyErr_Clear();
-                    else
-                        return NULL;
-                }
-            }
-            return m->sq_item(o, i);
-        }
-    }
-#else
-    if (is_list || PySequence_Check(o)) {
-        return PySequence_GetItem(o, i);
-    }
-#endif
-    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    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);
-#else
-    PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(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->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);
-#else
-    PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
-    PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
-    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (unlikely(tstate->curexc_type))
-#else
-    if (unlikely(PyErr_Occurred()))
-#endif
-        goto bad;
-    #if PY_MAJOR_VERSION >= 3
-    if (local_tb) {
-        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
-            goto bad;
-    }
-    #endif
-    Py_XINCREF(local_tb);
-    Py_XINCREF(local_type);
-    Py_XINCREF(local_value);
-    *type = local_type;
-    *value = local_value;
-    *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-    Py_XDECREF(tmp_type);
-    Py_XDECREF(tmp_value);
-    Py_XDECREF(tmp_tb);
-#else
-    PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
-    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_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);
-    if (!value || value == Py_None)
-        value = NULL;
-    else
-        Py_INCREF(value);
-    if (!tb || tb == Py_None)
-        tb = NULL;
-    else {
-        Py_INCREF(tb);
-        if (!PyTraceBack_Check(tb)) {
-            PyErr_SetString(PyExc_TypeError,
-                "raise: arg 3 must be a traceback or None");
-            goto raise_error;
-        }
-    }
-    #if PY_VERSION_HEX < 0x02050000
-    if (PyClass_Check(type)) {
-    #else
-    if (PyType_Check(type)) {
-    #endif
-#if CYTHON_COMPILING_IN_PYPY
-        if (!value) {
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-#endif
-        PyErr_NormalizeException(&type, &value, &tb);
-    } else {
-        if (value) {
-            PyErr_SetString(PyExc_TypeError,
-                "instance exception may not have a separate value");
-            goto raise_error;
-        }
-        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) {
-    PyObject* owned_instance = NULL;
-    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)) {
-        PyObject *instance_class = NULL;
-        if (value && PyExceptionInstance_Check(value)) {
-            instance_class = (PyObject*) Py_TYPE(value);
-            if (instance_class != type) {
-                if (PyObject_IsSubclass(instance_class, type)) {
-                    type = instance_class;
-                } else {
-                    instance_class = NULL;
-                }
-            }
-        }
-        if (!instance_class) {
-            PyObject *args;
-            if (!value)
-                args = PyTuple_New(0);
-            else if (PyTuple_Check(value)) {
-                Py_INCREF(value);
-                args = value;
-            } else
-                args = PyTuple_Pack(1, value);
-            if (!args)
-                goto bad;
-            owned_instance = PyObject_Call(type, args, NULL);
-            Py_DECREF(args);
-            if (!owned_instance)
-                goto bad;
-            value = owned_instance;
-            if (!PyExceptionInstance_Check(value)) {
-                PyErr_Format(PyExc_TypeError,
-                             "calling %R should have returned an instance of "
-                             "BaseException, not %R",
-                             type, Py_TYPE(value));
-                goto bad;
-            }
-        }
-    } else {
-        PyErr_SetString(PyExc_TypeError,
-            "raise: exception class must be a subclass of BaseException");
-        goto bad;
-    }
-#if PY_VERSION_HEX >= 0x03030000
-    if (cause) {
-#else
-    if (cause && cause != Py_None) {
-#endif
-        PyObject *fixed_cause;
-        if (cause == Py_None) {
-            fixed_cause = NULL;
-        } else 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;
-        }
-        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:
-    Py_XDECREF(owned_instance);
-    return;
-}
-#endif
-
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-    if (s1 == s2) {
-        return (equals == Py_EQ);
-    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
-        const char *ps1, *ps2;
-        Py_ssize_t length = PyBytes_GET_SIZE(s1);
-        if (length != PyBytes_GET_SIZE(s2))
-            return (equals == Py_NE);
-        ps1 = PyBytes_AS_STRING(s1);
-        ps2 = PyBytes_AS_STRING(s2);
-        if (ps1[0] != ps2[0]) {
-            return (equals == Py_NE);
-        } else if (length == 1) {
-            return (equals == Py_EQ);
-        } else {
-            int result = memcmp(ps1, ps2, (size_t)length);
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
-        return (equals == Py_NE);
-    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
-        return (equals == Py_NE);
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-#endif
-}
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
-    return PyObject_RichCompareBool(s1, s2, equals);
-#else
-#if PY_MAJOR_VERSION < 3
-    PyObject* owned_ref = NULL;
-#endif
-    int s1_is_unicode, s2_is_unicode;
-    if (s1 == s2) {
-        goto return_eq;
-    }
-    s1_is_unicode = PyUnicode_CheckExact(s1);
-    s2_is_unicode = PyUnicode_CheckExact(s2);
-#if PY_MAJOR_VERSION < 3
-    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
-        owned_ref = PyUnicode_FromObject(s2);
-        if (unlikely(!owned_ref))
-            return -1;
-        s2 = owned_ref;
-        s2_is_unicode = 1;
-    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
-        owned_ref = PyUnicode_FromObject(s1);
-        if (unlikely(!owned_ref))
-            return -1;
-        s1 = owned_ref;
-        s1_is_unicode = 1;
-    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
-        return __Pyx_PyBytes_Equals(s1, s2, equals);
-    }
-#endif
-    if (s1_is_unicode & s2_is_unicode) {
-        Py_ssize_t length;
-        int kind;
-        void *data1, *data2;
-        #if CYTHON_PEP393_ENABLED
-        if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
-            return -1;
-        #endif
-        length = __Pyx_PyUnicode_GET_LENGTH(s1);
-        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
-            goto return_ne;
-        }
-        kind = __Pyx_PyUnicode_KIND(s1);
-        if (kind != __Pyx_PyUnicode_KIND(s2)) {
-            goto return_ne;
-        }
-        data1 = __Pyx_PyUnicode_DATA(s1);
-        data2 = __Pyx_PyUnicode_DATA(s2);
-        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
-            goto return_ne;
-        } else if (length == 1) {
-            goto return_eq;
-        } else {
-            int result = memcmp(data1, data2, length * kind);
-            #if PY_MAJOR_VERSION < 3
-            Py_XDECREF(owned_ref);
-            #endif
-            return (equals == Py_EQ) ? (result == 0) : (result != 0);
-        }
-    } else if ((s1 == Py_None) & s2_is_unicode) {
-        goto return_ne;
-    } else if ((s2 == Py_None) & s1_is_unicode) {
-        goto return_ne;
-    } else {
-        int result;
-        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
-        if (!py_result)
-            return -1;
-        result = __Pyx_PyObject_IsTrue(py_result);
-        Py_DECREF(py_result);
-        return result;
-    }
-return_eq:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_EQ);
-return_ne:
-    #if PY_MAJOR_VERSION < 3
-    Py_XDECREF(owned_ref);
-    #endif
-    return (equals == Py_NE);
-#endif
-}
-
-static double __Pyx__PyObject_AsDouble(PyObject* obj) {
-    PyObject* float_value;
-#if CYTHON_COMPILING_IN_PYPY
-    float_value = PyNumber_Float(obj);
-#else
-    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
-    if (likely(nb) && likely(nb->nb_float)) {
-        float_value = nb->nb_float(obj);
-        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
-            PyErr_Format(PyExc_TypeError,
-                "__float__ returned non-float (type %.200s)",
-                Py_TYPE(float_value)->tp_name);
-            Py_DECREF(float_value);
-            goto bad;
-        }
-    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
-#if PY_MAJOR_VERSION >= 3
-        float_value = PyFloat_FromString(obj);
-#else
-        float_value = PyFloat_FromString(obj, 0);
-#endif
-    } else {
-        PyObject* args = PyTuple_New(1);
-        if (unlikely(!args)) goto bad;
-        PyTuple_SET_ITEM(args, 0, obj);
-        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
-        PyTuple_SET_ITEM(args, 0, 0);
-        Py_DECREF(args);
-    }
-#endif
-    if (likely(float_value)) {
-        double value = PyFloat_AS_DOUBLE(float_value);
-        Py_DECREF(float_value);
-        return value;
-    }
-bad:
-    return (double)-1;
-}
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
-    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
-}
-
-#if !CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
-    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL)
-}
-#endif
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
-        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
-        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
-        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
-    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
-    if (likely(ms && ms->sq_slice)) {
-        if (!has_cstart) {
-            if (_py_start && (*_py_start != Py_None)) {
-                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
-                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
-            } else
-                cstart = 0;
-        }
-        if (!has_cstop) {
-            if (_py_stop && (*_py_stop != Py_None)) {
-                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
-                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
-            } else
-                cstop = PY_SSIZE_T_MAX;
-        }
-        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
-            Py_ssize_t l = ms->sq_length(obj);
-            if (likely(l >= 0)) {
-                if (cstop < 0) {
-                    cstop += l;
-                    if (cstop < 0) cstop = 0;
-                }
-                if (cstart < 0) {
-                    cstart += l;
-                    if (cstart < 0) cstart = 0;
-                }
-            } else {
-                if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                    PyErr_Clear();
-                else
-                    goto bad;
-            }
-        }
-        return ms->sq_slice(obj, cstart, cstop);
-    }
-#endif
-    mp = Py_TYPE(obj)->tp_as_mapping;
-    if (likely(mp && mp->mp_subscript))
-#endif
-    {
-        PyObject* result;
-        PyObject *py_slice, *py_start, *py_stop;
-        if (_py_slice) {
-            py_slice = *_py_slice;
-        } else {
-            PyObject* owned_start = NULL;
-            PyObject* owned_stop = NULL;
-            if (_py_start) {
-                py_start = *_py_start;
-            } else {
-                if (has_cstart) {
-                    owned_start = py_start = PyInt_FromSsize_t(cstart);
-                    if (unlikely(!py_start)) goto bad;
-                } else
-                    py_start = Py_None;
-            }
-            if (_py_stop) {
-                py_stop = *_py_stop;
-            } else {
-                if (has_cstop) {
-                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
-                    if (unlikely(!py_stop)) {
-                        Py_XDECREF(owned_start);
-                        goto bad;
-                    }
-                } else
-                    py_stop = Py_None;
-            }
-            py_slice = PySlice_New(py_start, py_stop, Py_None);
-            Py_XDECREF(owned_start);
-            Py_XDECREF(owned_stop);
-            if (unlikely(!py_slice)) goto bad;
-        }
-#if CYTHON_COMPILING_IN_CPYTHON
-        result = mp->mp_subscript(obj, py_slice);
-#else
-        result = PyObject_GetItem(obj, py_slice);
-#endif
-        if (!_py_slice) {
-            Py_DECREF(py_slice);
-        }
-        return result;
-    }
-    PyErr_Format(PyExc_TypeError,
-        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
-bad:
-    return NULL;
-}
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
-    PyErr_Format(PyExc_ValueError,
-                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
-    PyErr_Format(PyExc_ValueError,
-                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
-                 index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    PyThreadState *tstate = PyThreadState_GET();
-    PyObject* exc_type = tstate->curexc_type;
-    if (unlikely(exc_type)) {
-        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
-            PyObject *exc_value, *exc_tb;
-            exc_value = tstate->curexc_value;
-            exc_tb = tstate->curexc_traceback;
-            tstate->curexc_type = 0;
-            tstate->curexc_value = 0;
-            tstate->curexc_traceback = 0;
-            Py_DECREF(exc_type);
-            Py_XDECREF(exc_value);
-            Py_XDECREF(exc_tb);
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#else
-    if (unlikely(PyErr_Occurred())) {
-        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
-            PyErr_Clear();
-            return 0;
-        } else {
-            return -1;
-        }
-    }
-    return 0;
-#endif
-}
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
-    if (unlikely(retval)) {
-        Py_DECREF(retval);
-        __Pyx_RaiseTooManyValuesError(expected);
-        return -1;
-    } else {
-        return __Pyx_IterFinish();
-    }
-    return 0;
-}
-
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
-    Py_ssize_t q = a / b;
-    Py_ssize_t r = a - q*b;
-    q -= ((r != 0) & ((r ^ b) < 0));
-    return q;
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
-    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
-    if (start < 0) {
-        start += length;
-        if (start < 0)
-            start = 0;
-    }
-    if (stop < 0)
-        stop += length;
-    else if (stop > length)
-        stop = length;
-    *_length = stop - start;
-    *_start = start;
-    *_stop = stop;
-}
-static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
-    PyObject *v;
-    Py_ssize_t i;
-    for (i = 0; i < length; i++) {
-        v = dest[i] = src[i];
-        Py_INCREF(v);
-    }
-}
-static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
-            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
-    PyObject* dest;
-    Py_ssize_t length = PyList_GET_SIZE(src);
-    __Pyx_crop_slice(&start, &stop, &length);
-    if (unlikely(length <= 0))
-        return PyList_New(0);
-    dest = PyList_New(length);
-    if (unlikely(!dest))
-        return NULL;
-    __Pyx_copy_object_array(
-        ((PyListObject*)src)->ob_item + start,
-        ((PyListObject*)dest)->ob_item,
-        length);
-    return dest;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
-            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
-    PyObject* dest;
-    Py_ssize_t length = PyTuple_GET_SIZE(src);
-    __Pyx_crop_slice(&start, &stop, &length);
-    if (unlikely(length <= 0))
-        return PyTuple_New(0);
-    dest = PyTuple_New(length);
-    if (unlikely(!dest))
-        return NULL;
-    __Pyx_copy_object_array(
-        ((PyTupleObject*)src)->ob_item + start,
-        ((PyTupleObject*)dest)->ob_item,
-        length);
-    return dest;
-}
-#endif
-
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
-    if (likely(PyList_CheckExact(L))) {
-        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
-    } else {
-        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
-        if (unlikely(!retval))
-            return -1;
-        Py_DECREF(retval);
-    }
-    return 0;
-}
-
-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 CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
-                                             int is_tuple, int has_known_size, int decref_tuple) {
-    Py_ssize_t index;
-    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
-    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
-        iternextfunc iternext;
-        iter = PyObject_GetIter(tuple);
-        if (unlikely(!iter)) goto bad;
-        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
-        iternext = Py_TYPE(iter)->tp_iternext;
-        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
-        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
-        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
-        Py_DECREF(iter);
-    } else {
-        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
-            __Pyx_UnpackTupleError(tuple, 2);
-            goto bad;
-        }
-#if CYTHON_COMPILING_IN_PYPY
-        value1 = PySequence_ITEM(tuple, 0);
-        if (unlikely(!value1)) goto bad;
-        value2 = PySequence_ITEM(tuple, 1);
-        if (unlikely(!value2)) goto bad;
-#else
-        value1 = PyTuple_GET_ITEM(tuple, 0);
-        value2 = PyTuple_GET_ITEM(tuple, 1);
-        Py_INCREF(value1);
-        Py_INCREF(value2);
-#endif
-        if (decref_tuple) { Py_DECREF(tuple); }
-    }
-    *pvalue1 = value1;
-    *pvalue2 = value2;
-    return 0;
-unpacking_failed:
-    if (!has_known_size && __Pyx_IterFinish() == 0)
-        __Pyx_RaiseNeedMoreValuesError(index);
-bad:
-    Py_XDECREF(iter);
-    Py_XDECREF(value1);
-    Py_XDECREF(value2);
-    if (decref_tuple) { Py_XDECREF(tuple); }
-    return -1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
-                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
-    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
-    *p_source_is_dict = is_dict;
-#if !CYTHON_COMPILING_IN_PYPY
-    if (is_dict) {
-        *p_orig_length = PyDict_Size(iterable);
-        Py_INCREF(iterable);
-        return iterable;
-    }
-#endif
-    *p_orig_length = 0;
-    if (method_name) {
-        PyObject* iter;
-        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
-        if (!iterable)
-            return NULL;
-#if !CYTHON_COMPILING_IN_PYPY
-        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
-            return iterable;
-#endif
-        iter = PyObject_GetIter(iterable);
-        Py_DECREF(iterable);
-        return iter;
-    }
-    return PyObject_GetIter(iterable);
-}
-static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos,
-                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
-    PyObject* next_item;
-#if !CYTHON_COMPILING_IN_PYPY
-    if (source_is_dict) {
-        PyObject *key, *value;
-        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
-            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
-            return -1;
-        }
-        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
-            return 0;
-        }
-        if (pitem) {
-            PyObject* tuple = PyTuple_New(2);
-            if (unlikely(!tuple)) {
-                return -1;
-            }
-            Py_INCREF(key);
-            Py_INCREF(value);
-            PyTuple_SET_ITEM(tuple, 0, key);
-            PyTuple_SET_ITEM(tuple, 1, value);
-            *pitem = tuple;
-        } else {
-            if (pkey) {
-                Py_INCREF(key);
-                *pkey = key;
-            }
-            if (pvalue) {
-                Py_INCREF(value);
-                *pvalue = value;
-            }
-        }
-        return 1;
-    } else if (PyTuple_CheckExact(iter_obj)) {
-        Py_ssize_t pos = *ppos;
-        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
-        *ppos = pos + 1;
-        next_item = PyTuple_GET_ITEM(iter_obj, pos);
-        Py_INCREF(next_item);
-    } else if (PyList_CheckExact(iter_obj)) {
-        Py_ssize_t pos = *ppos;
-        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
-        *ppos = pos + 1;
-        next_item = PyList_GET_ITEM(iter_obj, pos);
-        Py_INCREF(next_item);
-    } else
-#endif
-    {
-        next_item = PyIter_Next(iter_obj);
-        if (unlikely(!next_item)) {
-            return __Pyx_IterFinish();
-        }
-    }
-    if (pitem) {
-        *pitem = next_item;
-    } else if (pkey && pvalue) {
-        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
-            return -1;
-    } else if (pkey) {
-        *pkey = next_item;
-    } else {
-        *pvalue = next_item;
-    }
-    return 1;
-}
-
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
-    int r;
-    if (!j) return -1;
-    r = PyObject_SetItem(o, j, v);
-    Py_DECREF(j);
-    return r;
-}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
-                                               int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
-    if (is_list || PyList_CheckExact(o)) {
-        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
-        if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
-            PyObject* old = PyList_GET_ITEM(o, n);
-            Py_INCREF(v);
-            PyList_SET_ITEM(o, n, v);
-            Py_DECREF(old);
-            return 1;
-        }
-    } else {
-        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
-        if (likely(m && m->sq_ass_item)) {
-            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
-                Py_ssize_t l = m->sq_length(o);
-                if (likely(l >= 0)) {
-                    i += l;
-                } else {
-                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
-                        PyErr_Clear();
-                    else
-                        return -1;
-                }
-            }
-            return m->sq_ass_item(o, i, v);
-        }
-    }
-#else
-#if CYTHON_COMPILING_IN_PYPY
-    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
-#else
-    if (is_list || PySequence_Check(o)) {
-#endif
-        return PySequence_SetItem(o, i, v);
-    }
-#endif
-    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
-}
-
-static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
-    PyTypeObject* type = Py_TYPE(obj);
-    while (type && type->tp_dealloc != current_tp_dealloc)
-        type = type->tp_base;
-    while (type && type->tp_dealloc == current_tp_dealloc)
-        type = type->tp_base;
-    if (type)
-        type->tp_dealloc(obj);
-}
-
-static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
-    PyTypeObject* type = Py_TYPE(obj);
-    while (type && type->tp_traverse != current_tp_traverse)
-        type = type->tp_base;
-    while (type && type->tp_traverse == current_tp_traverse)
-        type = type->tp_base;
-    if (type && type->tp_traverse)
-        return type->tp_traverse(obj, v, a);
-    return 0;
-}
-
-static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
-    PyTypeObject* type = Py_TYPE(obj);
-    while (type && type->tp_clear != current_tp_clear)
-        type = type->tp_base;
-    while (type && type->tp_clear == current_tp_clear)
-        type = type->tp_base;
-    if (type && type->tp_clear)
-        type->tp_clear(obj);
-}
-
-static void* __Pyx_GetVtable(PyObject *dict) {
-    void* ptr;
-    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_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;
-}
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
-    PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
-    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
-    if (!ob)
-        goto bad;
-    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
-        goto bad;
-    Py_DECREF(ob);
-    return 0;
-bad:
-    Py_XDECREF(ob);
-    return -1;
-}
-
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
-    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
-    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
-        PyErr_Format(PyExc_ImportError,
-        #if PY_MAJOR_VERSION < 3
-            "cannot import name %.230s", PyString_AS_STRING(name));
-        #else
-            "cannot import name %S", name);
-        #endif
-    }
-    return value;
-}
-
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
-    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
-    for (i=0; i < nbases; i++) {
-        PyTypeObject *tmptype;
-        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
-        tmptype = Py_TYPE(tmp);
-#if PY_MAJOR_VERSION < 3
-        if (tmptype == &PyClass_Type)
-            continue;
-#endif
-        if (!metaclass) {
-            metaclass = tmptype;
-            continue;
-        }
-        if (PyType_IsSubtype(metaclass, tmptype))
-            continue;
-        if (PyType_IsSubtype(tmptype, metaclass)) {
-            metaclass = tmptype;
-            continue;
-        }
-        PyErr_SetString(PyExc_TypeError,
-                        "metaclass conflict: "
-                        "the metaclass of a derived class "
-                        "must be a (non-strict) subclass "
-                        "of the metaclasses of all its bases");
-        return NULL;
-    }
-    if (!metaclass) {
-#if PY_MAJOR_VERSION < 3
-        metaclass = &PyClass_Type;
-#else
-        metaclass = &PyType_Type;
-#endif
-    }
-    Py_INCREF((PyObject*) metaclass);
-    return (PyObject*) metaclass;
-}
-
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
-    PyObject* fake_module;
-    PyTypeObject* cached_type = NULL;
-    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
-    if (!fake_module) return NULL;
-    Py_INCREF(fake_module);
-    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
-    if (cached_type) {
-        if (!PyType_Check((PyObject*)cached_type)) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s is not a type object",
-                type->tp_name);
-            goto bad;
-        }
-        if (cached_type->tp_basicsize != type->tp_basicsize) {
-            PyErr_Format(PyExc_TypeError,
-                "Shared Cython type %.200s has the wrong size, try recompiling",
-                type->tp_name);
-            goto bad;
-        }
-    } else {
-        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
-        PyErr_Clear();
-        if (PyType_Ready(type) < 0) goto bad;
-        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
-            goto bad;
-        Py_INCREF(type);
-        cached_type = type;
-    }
-done:
-    Py_DECREF(fake_module);
-    return cached_type;
-bad:
-    Py_XDECREF(cached_type);
-    cached_type = NULL;
-    goto done;
-}
-
-static PyObject *
-__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
-{
-    if (unlikely(op->func_doc == NULL)) {
-        if (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 (unlikely(op->func_doc == NULL))
-                return NULL;
-        } else {
-            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)
-        value = Py_None; /* Mark as deleted */
-    Py_INCREF(value);
-    op->func_doc = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
-{
-    if (unlikely(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
-        if (unlikely(op->func_name == NULL))
-            return NULL;
-    }
-    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 (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
-    if (unlikely(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_qualname(__pyx_CyFunctionObject *op)
-{
-    Py_INCREF(op->func_qualname);
-    return op->func_qualname;
-}
-static int
-__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
-{
-    PyObject *tmp;
-#if PY_MAJOR_VERSION >= 3
-    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
-#else
-    if (unlikely(value == NULL || !PyString_Check(value))) {
-#endif
-        PyErr_SetString(PyExc_TypeError,
-                        "__qualname__ must be set to a string object");
-        return -1;
-    }
-    tmp = op->func_qualname;
-    Py_INCREF(value);
-    op->func_qualname = 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 (unlikely(op->func_dict == NULL)) {
-        op->func_dict = PyDict_New();
-        if (unlikely(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 (unlikely(value == NULL)) {
-        PyErr_SetString(PyExc_TypeError,
-               "function's dictionary may not be deleted");
-        return -1;
-    }
-    if (unlikely(!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(__pyx_CyFunctionObject *op)
-{
-    Py_INCREF(op->func_globals);
-    return op->func_globals;
-}
-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 int
-__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
-    PyObject *res = op->defaults_getter((PyObject *) op);
-    if (unlikely(!res))
-        return -1;
-    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
-    Py_INCREF(op->defaults_tuple);
-    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
-    Py_INCREF(op->defaults_kwdict);
-    Py_DECREF(res);
-    return 0;
-}
-static int
-__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value) {
-        value = Py_None;
-    } else if (value != Py_None && !PyTuple_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__defaults__ must be set to a tuple object");
-        return -1;
-    }
-    Py_INCREF(value);
-    tmp = op->defaults_tuple;
-    op->defaults_tuple = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->defaults_tuple;
-    if (unlikely(!result)) {
-        if (op->defaults_getter) {
-            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
-            result = op->defaults_tuple;
-        } else {
-            result = Py_None;
-        }
-    }
-    Py_INCREF(result);
-    return result;
-}
-static int
-__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value) {
-        value = Py_None;
-    } else if (value != Py_None && !PyDict_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__kwdefaults__ must be set to a dict object");
-        return -1;
-    }
-    Py_INCREF(value);
-    tmp = op->defaults_kwdict;
-    op->defaults_kwdict = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->defaults_kwdict;
-    if (unlikely(!result)) {
-        if (op->defaults_getter) {
-            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
-            result = op->defaults_kwdict;
-        } else {
-            result = Py_None;
-        }
-    }
-    Py_INCREF(result);
-    return result;
-}
-static int
-__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
-    PyObject* tmp;
-    if (!value || value == Py_None) {
-        value = NULL;
-    } else if (!PyDict_Check(value)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "__annotations__ must be set to a dict object");
-        return -1;
-    }
-    Py_XINCREF(value);
-    tmp = op->func_annotations;
-    op->func_annotations = value;
-    Py_XDECREF(tmp);
-    return 0;
-}
-static PyObject *
-__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
-    PyObject* result = op->func_annotations;
-    if (unlikely(!result)) {
-        result = PyDict_New();
-        if (unlikely(!result)) return NULL;
-        op->func_annotations = result;
-    }
-    Py_INCREF(result);
-    return result;
-}
-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 *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 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, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
-    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
-    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
-    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 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* qualname,
-                                      PyObject *closure, PyObject *module, PyObject* globals, 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;
-    Py_INCREF(qualname);
-    op->func_qualname = qualname;
-    op->func_doc = NULL;
-    op->func_classobj = NULL;
-    op->func_globals = globals;
-    Py_INCREF(op->func_globals);
-    Py_XINCREF(code);
-    op->func_code = code;
-    op->defaults_pyobjects = 0;
-    op->defaults = NULL;
-    op->defaults_tuple = NULL;
-    op->defaults_kwdict = NULL;
-    op->defaults_getter = NULL;
-    op->func_annotations = 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_qualname);
-    Py_CLEAR(m->func_doc);
-    Py_CLEAR(m->func_globals);
-    Py_CLEAR(m->func_code);
-    Py_CLEAR(m->func_classobj);
-    Py_CLEAR(m->defaults_tuple);
-    Py_CLEAR(m->defaults_kwdict);
-    Py_CLEAR(m->func_annotations);
-    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_qualname);
-    Py_VISIT(m->func_doc);
-    Py_VISIT(m->func_globals);
-    Py_VISIT(m->func_code);
-    Py_VISIT(m->func_classobj);
-    Py_VISIT(m->defaults_tuple);
-    Py_VISIT(m->defaults_kwdict);
-    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)
-{
-#if PY_MAJOR_VERSION >= 3
-    return PyUnicode_FromFormat("<cyfunction %U at %p>",
-                                op->func_qualname, (void *)op);
-#else
-    return PyString_FromFormat("<cyfunction %s at %p>",
-                               PyString_AsString(op->func_qualname), (void *)op);
-#endif
-}
-#if CYTHON_COMPILING_IN_PYPY
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-    PyCFunctionObject* f = (PyCFunctionObject*)func;
-    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
-    PyObject *self = PyCFunction_GET_SELF(func);
-    Py_ssize_t size;
-    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
-    case METH_VARARGS:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
-            return (*meth)(self, arg);
-        break;
-    case METH_VARARGS | METH_KEYWORDS:
-        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
-    case METH_NOARGS:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
-            size = PyTuple_GET_SIZE(arg);
-            if (size == 0)
-                return (*meth)(self, NULL);
-            PyErr_Format(PyExc_TypeError,
-                "%.200s() takes no arguments (%zd given)",
-                f->m_ml->ml_name, size);
-            return NULL;
-        }
-        break;
-    case METH_O:
-        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
-            size = PyTuple_GET_SIZE(arg);
-            if (size == 1)
-                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
-            PyErr_Format(PyExc_TypeError,
-                "%.200s() takes exactly one argument (%zd given)",
-                f->m_ml->ml_name, size);
-            return NULL;
-        }
-        break;
-    default:
-        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
-                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
-                        "longer supported!");
-        return NULL;
-    }
-    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
-                 f->m_ml->ml_name);
-    return NULL;
-}
-#else
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
-	return PyCFunction_Call(func, arg, kw);
-}
-#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_CyFunction_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
-#if PY_VERSION_HEX >= 0x030400a1
-    0,                                  /*tp_finalize*/
-#endif
-};
-static int __Pyx_CyFunction_init(void) {
-#if !CYTHON_COMPILING_IN_PYPY
-    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
-#endif
-    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
-    if (__pyx_CyFunctionType == NULL) {
-        return -1;
-    }
-    return 0;
-}
-static CYTHON_INLINE 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, size);
-    m->defaults_pyobjects = pyobjects;
-    return m->defaults;
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->defaults_tuple = tuple;
-    Py_INCREF(tuple);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->defaults_kwdict = dict;
-    Py_INCREF(dict);
-}
-static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
-    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
-    m->func_annotations = dict;
-    Py_INCREF(dict);
-}
-
-static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
-                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
-    PyObject *ns;
-    if (metaclass) {
-        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
-        if (prep) {
-            PyObject *pargs = PyTuple_Pack(2, name, bases);
-            if (unlikely(!pargs)) {
-                Py_DECREF(prep);
-                return NULL;
-            }
-            ns = PyObject_Call(prep, pargs, mkw);
-            Py_DECREF(prep);
-            Py_DECREF(pargs);
-        } else {
-            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
-                return NULL;
-            PyErr_Clear();
-            ns = PyDict_New();
-        }
-    } else {
-        ns = PyDict_New();
-    }
-    if (unlikely(!ns))
-        return NULL;
-    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
-    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
-    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
-    return ns;
-bad:
-    Py_DECREF(ns);
-    return NULL;
-}
-static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
-                                      PyObject *dict, PyObject *mkw,
-                                      int calculate_metaclass, int allow_py2_metaclass) {
-    PyObject *result, *margs;
-    PyObject *owned_metaclass = NULL;
-    if (allow_py2_metaclass) {
-        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
-        if (owned_metaclass) {
-            metaclass = owned_metaclass;
-        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
-            PyErr_Clear();
-        } else {
-            return NULL;
-        }
-    }
-    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
-        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
-        Py_XDECREF(owned_metaclass);
-        if (unlikely(!metaclass))
-            return NULL;
-        owned_metaclass = metaclass;
-    }
-    margs = PyTuple_Pack(3, name, bases, dict);
-    if (unlikely(!margs)) {
-        result = NULL;
-    } else {
-        result = PyObject_Call(metaclass, margs, mkw);
-        Py_DECREF(margs);
-    }
-    Py_XDECREF(owned_metaclass);
-    return result;
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
-    PyObject *empty_list = 0;
-    PyObject *module = 0;
-    PyObject *global_dict = 0;
-    PyObject *empty_dict = 0;
-    PyObject *list;
-    #if PY_VERSION_HEX < 0x03030000
-    PyObject *py_import;
-    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
-    if (!py_import)
-        goto bad;
-    #endif
-    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, '.')) {
-                #if PY_VERSION_HEX < 0x03030000
-                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);
-                #else
-                module = PyImport_ImportModuleLevelObject(
-                    name, global_dict, empty_dict, list, 1);
-                #endif
-                if (!module) {
-                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
-                        goto bad;
-                    PyErr_Clear();
-                }
-            }
-            level = 0; /* try absolute import on failure */
-        }
-        #endif
-        if (!module) {
-            #if PY_VERSION_HEX < 0x03030000
-            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
-            module = PyImport_ImportModuleLevelObject(
-                name, global_dict, empty_dict, list, level);
-            #endif
-        }
-    }
-    #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:
-    #if PY_VERSION_HEX < 0x03030000
-    Py_XDECREF(py_import);
-    #endif
-    Py_XDECREF(empty_list);
-    Py_XDECREF(empty_dict);
-    return module;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(long) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(long) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(long) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(long) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(long),
-                                     little, !is_unsigned);
-    }
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
-    const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-    if (is_unsigned) {
-        if (sizeof(uint32_t) < sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
-            return PyLong_FromUnsignedLong((unsigned long) value);
-        } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
-            return PyLong_FromUnsignedLongLong((unsigned long long) value);
-        }
-    } else {
-        if (sizeof(uint32_t) <= sizeof(long)) {
-            return PyInt_FromLong((long) value);
-        } else if (sizeof(uint32_t) <= sizeof(long long)) {
-            return PyLong_FromLongLong((long long) value);
-        }
-    }
-    {
-        int one = 1; int little = (int)*(unsigned char *)&one;
-        unsigned char *bytes = (unsigned char *)&value;
-        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
-                                     little, !is_unsigned);
-    }
-}
-
-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func)             \
-    {                                                                     \
-        func_type value = func(x);                                        \
-        if (sizeof(target_type) < sizeof(func_type)) {                    \
-            if (unlikely(value != (func_type) (target_type) value)) {     \
-                func_type zero = 0;                                       \
-                PyErr_SetString(PyExc_OverflowError,                      \
-                    (is_unsigned && unlikely(value < zero)) ?             \
-                    "can't convert negative value to " #target_type :     \
-                    "value too large to convert to " #target_type);       \
-                return (target_type) -1;                                  \
-            }                                                             \
-        }                                                                 \
-        return (target_type) value;                                       \
-    }
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
-    const long neg_one = (long) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(long) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
-        } else {
-            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 CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to long");
-                return (long) -1;
-            }
-            if (sizeof(long) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(long) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(long)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(long) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
-            } else if (sizeof(long) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            long val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (long) -1;
-        }
-    } else {
-        long val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (long) -1;
-        val = __Pyx_PyInt_As_long(tmp);
-        Py_DECREF(tmp);
-        return val;
-    }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
-    const int neg_one = (int) -1, const_zero = 0;
-    const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
-    if (likely(PyInt_Check(x))) {
-        if (sizeof(int) < sizeof(long)) {
-            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
-        } else {
-            long val = PyInt_AS_LONG(x);
-            if (is_unsigned && unlikely(val < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            return (int) val;
-        }
-    } else
-#endif
-    if (likely(PyLong_Check(x))) {
-        if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return (int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (unlikely(Py_SIZE(x) < 0)) {
-                PyErr_SetString(PyExc_OverflowError,
-                                "can't convert negative value to int");
-                return (int) -1;
-            }
-            if (sizeof(int) <= sizeof(unsigned long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
-            } else if (sizeof(int) <= sizeof(unsigned long long)) {
-                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
-            }
-        } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-            if (sizeof(digit) <= sizeof(int)) {
-                switch (Py_SIZE(x)) {
-                    case  0: return 0;
-                    case  1: return +(int) ((PyLongObject*)x)->ob_digit[0];
-                    case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
-                }
-            }
- #endif
-#endif
-            if (sizeof(int) <= sizeof(long)) {
-                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
-            } else if (sizeof(int) <= sizeof(long long)) {
-                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
-            }
-        }
-        {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
-            PyErr_SetString(PyExc_RuntimeError,
-                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
-#else
-            int val;
-            PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
-            if (likely(v) && !PyLong_Check(v)) {
-                PyObject *tmp = v;
-                v = PyNumber_Long(tmp);
-                Py_DECREF(tmp);
-            }
- #endif
-            if (likely(v)) {
-                int one = 1; int is_little = (int)*(unsigned char *)&one;
-                unsigned char *bytes = (unsigned char *)&val;
-                int ret = _PyLong_AsByteArray((PyLongObject *)v,
-                                              bytes, sizeof(val),
-                                              is_little, !is_unsigned);
-                Py_DECREF(v);
-                if (likely(!ret))
-                    return val;
-            }
-#endif
-            return (int) -1;
-        }
-    } else {
-        int val;
-        PyObject *tmp = __Pyx_PyNumber_Int(x);
-        if (!tmp) return (int) -1;
-        val = __Pyx_PyInt_As_int(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;
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#else
-    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
-    PyErr_SetExcInfo(*type, *value, *tb);
-#endif
-    *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 PyTypeObject *__pyx_GeneratorType = 0;
-#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
-#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
-#if 1 || PY_VERSION_HEX < 0x030300B0
-static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
-    PyObject *et, *ev, *tb;
-    PyObject *value = NULL;
-    __Pyx_ErrFetch(&et, &ev, &tb);
-    if (!et) {
-        Py_XDECREF(tb);
-        Py_XDECREF(ev);
-        Py_INCREF(Py_None);
-        *pvalue = Py_None;
-        return 0;
-    }
-    if (unlikely(et != PyExc_StopIteration) &&
-            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
-        __Pyx_ErrRestore(et, ev, tb);
-        return -1;
-    }
-    if (likely(et == PyExc_StopIteration)) {
-        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
-            if (!ev) {
-                Py_INCREF(Py_None);
-                ev = Py_None;
-            }
-            Py_XDECREF(tb);
-            Py_DECREF(et);
-            *pvalue = ev;
-            return 0;
-        }
-    }
-    PyErr_NormalizeException(&et, &ev, &tb);
-    if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
-        __Pyx_ErrRestore(et, ev, tb);
-        return -1;
-    }
-    Py_XDECREF(tb);
-    Py_DECREF(et);
-#if PY_VERSION_HEX >= 0x030300A0
-    value = ((PyStopIterationObject *)ev)->value;
-    Py_INCREF(value);
-    Py_DECREF(ev);
-#else
-    {
-        PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args);
-        Py_DECREF(ev);
-        if (likely(args)) {
-            value = PyObject_GetItem(args, 0);
-            Py_DECREF(args);
-        }
-        if (unlikely(!value)) {
-            __Pyx_ErrRestore(NULL, NULL, NULL);
-            Py_INCREF(Py_None);
-            value = Py_None;
-        }
-    }
-#endif
-    *pvalue = value;
-    return 0;
-}
-#endif
-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
-int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
-    if (unlikely(gen->is_running)) {
-        PyErr_SetString(PyExc_ValueError,
-                        "generator already executing");
-        return 1;
-    }
-    return 0;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
-    PyObject *retval;
-    assert(!self->is_running);
-    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) {
-#if CYTHON_COMPILING_IN_PYPY
-#else
-        /* Generators always return to their most recent caller, not
-         * necessarily their creator. */
-        if (self->exc_traceback) {
-            PyThreadState *tstate = PyThreadState_GET();
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_XINCREF(tstate->frame);
-            assert(f->f_back == NULL);
-            f->f_back = tstate->frame;
-        }
-#endif
-        __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);
-#if CYTHON_COMPILING_IN_PYPY
-#else
-        /* Don't keep the reference to f_back any longer than necessary.  It
-         * may keep a chain of frames alive or it could create a reference
-         * cycle. */
-        if (self->exc_traceback) {
-            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
-            PyFrameObject *f = tb->tb_frame;
-            Py_CLEAR(f->f_back);
-        }
-#endif
-    } else {
-        __Pyx_Generator_ExceptionClear(self);
-    }
-    return retval;
-}
-static CYTHON_INLINE
-PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
-    PyObject *ret;
-    PyObject *val = NULL;
-    __Pyx_Generator_Undelegate(gen);
-    __Pyx_PyGen_FetchStopIterationValue(&val);
-    ret = __Pyx_Generator_SendEx(gen, val);
-    Py_XDECREF(val);
-    return ret;
-}
-static PyObject *__Pyx_Generator_Next(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
-    PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        gen->is_running = 1;
-        ret = Py_TYPE(yf)->tp_iternext(yf);
-        gen->is_running = 0;
-        if (likely(ret)) {
-            return ret;
-        }
-        return __Pyx_Generator_FinishDelegation(gen);
-    }
-    return __Pyx_Generator_SendEx(gen, Py_None);
-}
-static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
-    PyObject *yf = gen->yieldfrom;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        gen->is_running = 1;
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Generator_Send(yf, value);
-        } else {
-            if (value == Py_None)
-                ret = PyIter_Next(yf);
-            else
-                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
-        }
-        gen->is_running = 0;
-        if (likely(ret)) {
-            return ret;
-        }
-        return __Pyx_Generator_FinishDelegation(gen);
-    }
-    return __Pyx_Generator_SendEx(gen, value);
-}
-static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
-    PyObject *retval = NULL;
-    int err = 0;
-    if (__Pyx_Generator_CheckExact(yf)) {
-        retval = __Pyx_Generator_Close(yf);
-        if (!retval)
-            return -1;
-    } else {
-        PyObject *meth;
-        gen->is_running = 1;
-        meth = PyObject_GetAttr(yf, __pyx_n_s_close);
-        if (unlikely(!meth)) {
-            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
-                PyErr_WriteUnraisable(yf);
-            }
-            PyErr_Clear();
-        } else {
-            retval = PyObject_CallFunction(meth, NULL);
-            Py_DECREF(meth);
-            if (!retval)
-                err = -1;
-        }
-        gen->is_running = 0;
-    }
-    Py_XDECREF(retval);
-    return err;
-}
-static PyObject *__Pyx_Generator_Close(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
-    PyObject *retval, *raised_exception;
-    PyObject *yf = gen->yieldfrom;
-    int err = 0;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        Py_INCREF(yf);
-        err = __Pyx_Generator_CloseIter(gen, yf);
-        __Pyx_Generator_Undelegate(gen);
-        Py_DECREF(yf);
-    }
-    if (err == 0)
-#if PY_VERSION_HEX < 0x02050000
-        PyErr_SetNone(PyExc_StopIteration);
-#else
-        PyErr_SetNone(PyExc_GeneratorExit);
-#endif
-    retval = __Pyx_Generator_SendEx(gen, NULL);
-    if (retval) {
-        Py_DECREF(retval);
-        PyErr_SetString(PyExc_RuntimeError,
-                        "generator ignored GeneratorExit");
-        return NULL;
-    }
-    raised_exception = PyErr_Occurred();
-    if (!raised_exception
-        || raised_exception == PyExc_StopIteration
-#if PY_VERSION_HEX >= 0x02050000
-        || raised_exception == PyExc_GeneratorExit
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
-#endif
-        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
-    {
-        if (raised_exception) 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 *gen = (__pyx_GeneratorObject *) self;
-    PyObject *typ;
-    PyObject *tb = NULL;
-    PyObject *val = NULL;
-    PyObject *yf = gen->yieldfrom;
-    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
-        return NULL;
-    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
-        return NULL;
-    if (yf) {
-        PyObject *ret;
-        Py_INCREF(yf);
-#if PY_VERSION_HEX >= 0x02050000
-        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
-            int err = __Pyx_Generator_CloseIter(gen, yf);
-            Py_DECREF(yf);
-            __Pyx_Generator_Undelegate(gen);
-            if (err < 0)
-                return __Pyx_Generator_SendEx(gen, NULL);
-            goto throw_here;
-        }
-#endif
-        gen->is_running = 1;
-        if (__Pyx_Generator_CheckExact(yf)) {
-            ret = __Pyx_Generator_Throw(yf, args);
-        } else {
-            PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw);
-            if (unlikely(!meth)) {
-                Py_DECREF(yf);
-                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
-                    gen->is_running = 0;
-                    return NULL;
-                }
-                PyErr_Clear();
-                __Pyx_Generator_Undelegate(gen);
-                gen->is_running = 0;
-                goto throw_here;
-            }
-            ret = PyObject_CallObject(meth, args);
-            Py_DECREF(meth);
-        }
-        gen->is_running = 0;
-        Py_DECREF(yf);
-        if (!ret) {
-            ret = __Pyx_Generator_FinishDelegation(gen);
-        }
-        return ret;
-    }
-throw_here:
-    __Pyx_Raise(typ, val, tb, NULL);
-    return __Pyx_Generator_SendEx(gen, 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->yieldfrom);
-    Py_VISIT(gen->exc_type);
-    Py_VISIT(gen->exc_value);
-    Py_VISIT(gen->exc_traceback);
-    return 0;
-}
-static int __Pyx_Generator_clear(PyObject *self) {
-    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
-    Py_CLEAR(gen->closure);
-    Py_CLEAR(gen->classobj);
-    Py_CLEAR(gen->yieldfrom);
-    Py_CLEAR(gen->exc_type);
-    Py_CLEAR(gen->exc_value);
-    Py_CLEAR(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);
-    if (gen->resume_label > 0) {
-        PyObject_GC_Track(self);
-#if PY_VERSION_HEX >= 0x030400a1
-        if (PyObject_CallFinalizerFromDealloc(self))
-#else
-        Py_TYPE(gen)->tp_del(self);
-        if (self->ob_refcnt > 0)
-#endif
-            return;                     /* resurrected.  :( */
-        PyObject_GC_UnTrack(self);
-    }
-    __Pyx_Generator_clear(self);
-    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 ;
-#if PY_VERSION_HEX < 0x030400a1
-    assert(self->ob_refcnt == 0);
-    self->ob_refcnt = 1;
-#endif
-    __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);
-#if PY_VERSION_HEX < 0x030400a1
-    /* 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;
-    }
-#if CYTHON_COMPILING_IN_CPYTHON
-    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;
-#endif
-    /* 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
-    --Py_TYPE(self)->tp_frees;
-    --Py_TYPE(self)->tp_allocs;
-#endif
-#endif
-}
-static PyMemberDef __pyx_Generator_memberlist[] = {
-    {(char *) "gi_running",
-#if PY_VERSION_HEX >= 0x02060000
-     T_BOOL,
-#else
-     T_BYTE,
-#endif
-     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_type = {
-    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*/
-    0,                                  /*tp_getattro*/
-    0,                                  /*tp_setattro*/
-    0,                                  /*tp_as_buffer*/
-    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /* tp_flags*/
-    0,                                  /*tp_doc*/
-    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
-    0,                                  /*tp_clear*/
-    0,                                  /*tp_richcompare*/
-    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
-    0,                                  /*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*/
-#if PY_VERSION_HEX >= 0x030400a1
-    0,                                  /*tp_del*/
-#else
-    __Pyx_Generator_del,                /*tp_del*/
-#endif
-#if PY_VERSION_HEX >= 0x02060000
-    0,                                  /*tp_version_tag*/
-#endif
-#if PY_VERSION_HEX >= 0x030400a1
-    __Pyx_Generator_del,                /*tp_finalize*/
-#endif
-};
-static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
-                                                  PyObject *closure) {
-    __pyx_GeneratorObject *gen =
-        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
-    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->yieldfrom = 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) {
-    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
-    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
-    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
-    if (__pyx_GeneratorType == NULL) {
-        return -1;
-    }
-    return 0;
-}
-
-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;
-}
-
-#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
-
-#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_ssize_t basicsize;
-#ifdef Py_LIMITED_API
-    PyObject *py_basicsize;
-#endif
-    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,
-            "%.200s.%.200s is not a type object",
-            module_name, class_name);
-        goto bad;
-    }
-#ifndef Py_LIMITED_API
-    basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
-    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
-    if (!py_basicsize)
-        goto bad;
-    basicsize = PyLong_AsSsize_t(py_basicsize);
-    Py_DECREF(py_basicsize);
-    py_basicsize = 0;
-    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
-        goto bad;
-#endif
-    if (!strict && (size_t)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)basicsize != size) {
-        PyErr_Format(PyExc_ValueError,
-            "%.200s.%.200s 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_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,
-            "%.200s does not export expected C function %.200s",
-                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 %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
-             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 %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
-             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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
-    return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
-    Py_ssize_t ignore;
-    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-    if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-            __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
-            PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
-        char* defenc_c;
-        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
-        if (!defenc) return NULL;
-        defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        {
-            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
-            char* c;
-            for (c = defenc_c; c < end; c++) {
-                if ((unsigned char) (*c) >= 128) {
-                    PyUnicode_AsASCIIString(o);
-                    return NULL;
-                }
-            }
-        }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
-        *length = PyBytes_GET_SIZE(defenc);
-        return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
-        if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-        if (PyUnicode_IS_ASCII(o)) {
-            *length = PyUnicode_GET_DATA_SIZE(o);
-            return PyUnicode_AsUTF8(o);
-        } else {
-            PyUnicode_AsASCIIString(o);
-            return NULL;
-        }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-        return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
-    } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
-#if !CYTHON_COMPILING_IN_PYPY
-#if PY_VERSION_HEX >= 0x02060000
-    if (PyByteArray_Check(o)) {
-        *length = PyByteArray_GET_SIZE(o);
-        return PyByteArray_AS_STRING(o);
-    } else
-#endif
-#endif
-    {
-        char* result;
-        int r = PyBytes_AsStringAndSize(o, &result, length);
-        if (unlikely(r < 0)) {
-            return NULL;
-        } else {
-            return result;
-        }
-    }
-}
-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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-  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_MAJOR_VERSION < 3
-    if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
-    if (!PyLong_Check(res)) {
-#endif
-      PyErr_Format(PyExc_TypeError,
-                   "__%.4s__ returned non-%.4s (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;
-}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
-  #include "longintrepr.h"
- #endif
-#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
-  Py_ssize_t ival;
-  PyObject *x;
-#if PY_MAJOR_VERSION < 3
-  if (likely(PyInt_CheckExact(b)))
-      return PyInt_AS_LONG(b);
-#endif
-  if (likely(PyLong_CheckExact(b))) {
-    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-     #if CYTHON_USE_PYLONG_INTERNALS
-       switch (Py_SIZE(b)) {
-       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
-       case  0: return 0;
-       case  1: return ((PyLongObject*)b)->ob_digit[0];
-       }
-     #endif
-    #endif
-  #if PY_VERSION_HEX < 0x02060000
-    return PyInt_AsSsize_t(b);
-  #else
-    return PyLong_AsSsize_t(b);
-  #endif
-  }
-  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
-}
-
-
-#endif /* Py_PYTHON_H */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-pysam.git



More information about the debian-med-commit mailing list