/* Generated by Cython 0.19.1 on Wed Jun 28 05:32:00 2017 */

#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
#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 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_AsInt(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, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_TPFLAGS_HAVE_VERSION_TAG 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_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_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_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) (Py_TYPE(obj) == &PyBaseString_Type)
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif
#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)
    #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__vcfutils
#define __PYX_HAVE_API__vcfutils
#include "string.h"
#include "stdio.h"
#include "pythread.h"
#include "stdlib.h"
#include "math.h"
#include "ctype.h"
#include "stdint.h"
#include "htslib/bgzf.h"
#include "htslib/hts.h"
#include "htslib/sam.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
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#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_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_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);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#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() {
    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 '%s' 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() {
    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[] = {
  "vcfutils.pyx",
  "fastafile.pxd",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
  "htslibWrapper.pxd",
  "variant.pxd",
  "cwindow.pxd",
  "cpopulation.pxd",
  "chaplotype.pxd",
  "cgenotype.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_7variant_VariantCandidateGenerator;
struct __pyx_obj_10chaplotype_Haplotype;
struct __pyx_obj_9fastafile_FastaFile;
struct __pyx_obj_11cpopulation_Population;
struct __pyx_obj_7cwindow_ReadArray;
struct __pyx_obj_13htslibWrapper_Samfile;
struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding;
struct __pyx_obj_9cgenotype_DiploidGenotype;
struct __pyx_obj_9fastafile_FastaIndex;
struct __pyx_obj_9cgenotype_HaploidGenotype;
struct __pyx_obj_13htslibWrapper_ReadIterator;
struct __pyx_obj_7cwindow_bamReadBuffer;
struct __pyx_obj_7variant_Variant;
struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr;
struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr;
struct __pyx_t_13htslibWrapper_cAlignedRead;
typedef struct __pyx_t_13htslibWrapper_cAlignedRead __pyx_t_13htslibWrapper_cAlignedRead;
struct __pyx_opt_args_13htslibWrapper_7Samfile__open;

/* "htslibWrapper.pxd":187
 *     int bam_cigar_oplen(uint32_t c)
 * 
 * ctypedef struct cAlignedRead:             # <<<<<<<<<<<<<<
 *     char* seq
 *     char* qual
 */
struct __pyx_t_13htslibWrapper_cAlignedRead {
  char *seq;
  char *qual;
  short *cigarOps;
  short *hash;
  short mateChromID;
  short cigarLen;
  short chromID;
  short rlen;
  int pos;
  int end;
  int insertSize;
  int matePos;
  int bitFlag;
  unsigned char mapq;
};

/* "htslibWrapper.pxd":211
 *     cdef _hasIndex(self)
 *     cdef void openBAMFile(self, mode)
 *     cpdef _open(self, mode, loadIndex=*)             # <<<<<<<<<<<<<<
 *     cdef char* getrname(self, int tid)
 *     cpdef ReadIterator fetch(self, const char *region)
 */
struct __pyx_opt_args_13htslibWrapper_7Samfile__open {
  int __pyx_n;
  PyObject *loadIndex;
};
struct __pyx_opt_args_11cpopulation_10Population_calculatePosterior;

/* "cpopulation.pxd":47
 *     # Class functions
 *     cdef:
 *         double calculatePosterior(self, Variant var, int flatPrior=*)             # <<<<<<<<<<<<<<
 *         void computeVariantPosteriors(self)
 *         void computeVariantINFO(self)
 */
struct __pyx_opt_args_11cpopulation_10Population_calculatePosterior {
  int __pyx_n;
  int flatPrior;
};
struct __pyx_opt_args_10chaplotype_9Haplotype_getReferenceSequence;

/* "chaplotype.pxd":46
 *         double* alignReads(self, int individualIndex, cAlignedRead** start, cAlignedRead** end, cAlignedRead** badReadStart, cAlignedRead** badReadsEnd, cAlignedRead** brokenReadsStart, cAlignedRead** brokenReadsEnd, int useMapQualCap)
 *         double alignSingleRead(self, cAlignedRead* theRead, int useMapQualCap)
 *         char* getReferenceSequence(self, prefix=*)             # <<<<<<<<<<<<<<
 *         char* getMutatedSequence(self)
 *         char* getShortHaplotypeSequence(self)
 */
struct __pyx_opt_args_10chaplotype_9Haplotype_getReferenceSequence {
  int __pyx_n;
  PyObject *prefix;
};

/* "variant.pxd":44
 * 
 * @cython.final
 * cdef class VariantCandidateGenerator:             # <<<<<<<<<<<<<<
 *     cdef int CIGAR_M
 *     cdef int CIGAR_I
 */
struct __pyx_obj_7variant_VariantCandidateGenerator {
  PyObject_HEAD
  struct __pyx_vtabstruct_7variant_VariantCandidateGenerator *__pyx_vtab;
  int CIGAR_M;
  int CIGAR_I;
  int CIGAR_D;
  int CIGAR_N;
  int CIGAR_S;
  int CIGAR_H;
  int CIGAR_P;
  int CIGAR_EQ;
  int CIGAR_X;
  int minMapQual;
  int minBaseQual;
  int minFlank;
  int refId;
  int maxCoverage;
  int verbosity;
  int genSNPs;
  int genIndels;
  int maxReadLength;
  long rStart;
  long rEnd;
  long refSeqStart;
  long refSeqEnd;
  char *refSeq;
  PyObject *variantHeap;
  PyObject *pyRefSeq;
  PyObject *rname;
  struct __pyx_obj_9fastafile_FastaFile *refFile;
  PyObject *options;
  int qualBinSize;
};


/* "chaplotype.pxd":14
 * 
 * @cython.final
 * cdef class Haplotype:             # <<<<<<<<<<<<<<
 *     cdef:
 *         bytes refName
 */
struct __pyx_obj_10chaplotype_Haplotype {
  PyObject_HEAD
  struct __pyx_vtabstruct_10chaplotype_Haplotype *__pyx_vtab;
  PyObject *refName;
  int startPos;
  int endPos;
  int maxReadLength;
  int minVarPos;
  int maxVarPos;
  PyObject *variants;
  PyObject *haplotypeSequence;
  PyObject *shortHaplotypeSequence;
  char *cHaplotypeSequence;
  struct __pyx_obj_9fastafile_FastaFile *refFile;
  PyObject *options;
  double *likelihoodCache;
  int lenCache;
  int lastIndividualIndex;
  PyObject *referenceSequence;
  PyObject *shortReferenceSequence;
  struct __pyx_obj_7variant_Variant *longVar;
  int hash;
  int hapLen;
  int verbosity;
  int endBufferSize;
  char *cHomopolQ;
  char *localGapOpen;
  short *hapSequenceHash;
  short *hapSequenceNextArray;
  int *mapCounts;
  int mapCountsLen;
};


/* "fastafile.pxd":5
 *     cdef dict getRefs(self, int parseNCBI)
 * 
 * cdef class FastaFile(object):             # <<<<<<<<<<<<<<
 *     cdef object theFile
 *     cdef FastaIndex theIndex
 */
struct __pyx_obj_9fastafile_FastaFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_9fastafile_FastaFile *__pyx_vtab;
  PyObject *theFile;
  struct __pyx_obj_9fastafile_FastaIndex *theIndex;
  PyObject *refs;
  PyObject *cache;
  PyObject *cacheRefName;
  PY_LONG_LONG cacheStartPos;
  PY_LONG_LONG cacheEndPos;
};


/* "cpopulation.pxd":12
 * ###################################################################################################
 * 
 * cdef class Population:             # <<<<<<<<<<<<<<
 * 
 *     # Class variables
 */
struct __pyx_obj_11cpopulation_Population {
  PyObject_HEAD
  struct __pyx_vtabstruct_11cpopulation_Population *__pyx_vtab;
  PyObject *vcfInfo;
  PyObject *vcfFilter;
  PyObject *varsByPos;
  PyObject *variantPosteriors;
  PyObject *genotypeCalls;
  PyObject *variants;
  PyObject *haplotypes;
  PyObject *genotypes;
  double **genotypeLikelihoods;
  double **goodnessOfFitValues;
  double **EMLikelihoods;
  double *frequencies;
  double *newFrequencies;
  int **haplotypeIndexes;
  int *nReads;
  double *maxLogLikelihoods;
  double *freqsPrimeByHapIndex;
  int nVariants;
  int nHaplotypes;
  int nIndividuals;
  int maxHaplotypes;
  int maxGenotypes;
  int nGenotypes;
  int verbosity;
  int useEMLikelihoods;
  PyObject *readBuffers;
  struct __pyx_obj_9fastafile_FastaFile *refFile;
  PyObject *options;
};


/* "cwindow.pxd":13
 * ###################################################################################################
 * 
 * cdef class ReadArray:             # <<<<<<<<<<<<<<
 *     cdef cAlignedRead** array
 *     cdef cAlignedRead** windowStart
 */
struct __pyx_obj_7cwindow_ReadArray {
  PyObject_HEAD
  struct __pyx_vtabstruct_7cwindow_ReadArray *__pyx_vtab;
  __pyx_t_13htslibWrapper_cAlignedRead **array;
  __pyx_t_13htslibWrapper_cAlignedRead **windowStart;
  __pyx_t_13htslibWrapper_cAlignedRead **windowEnd;
  int __pyx___size;
  int __pyx___capacity;
  int __pyx___longestRead;
};


/* "htslibWrapper.pxd":203
 *     unsigned char mapq
 * 
 * cdef class Samfile:             # <<<<<<<<<<<<<<
 *     cdef void clearHeader(self)
 *     cdef void clearIndex(self)
 */
struct __pyx_obj_13htslibWrapper_Samfile {
  PyObject_HEAD
  struct __pyx_vtabstruct_13htslibWrapper_Samfile *__pyx_vtab;
  char *filename;
  samFile *samfile;
  bam_hdr_t *theHeader;
  hts_idx_t *index;
  PyObject *lock;
};


/* "vcfutils.pyx":796
 * 
 * 
 * def trimLeftPadding(vcfDataLine):             # <<<<<<<<<<<<<<
 *     """
 *     This is a small hack to make sure that no un-needed left padding is left
 */
struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding {
  PyObject_HEAD
  PyObject *__pyx_v_alt;
};


/* "cgenotype.pxd":9
 * 
 * @cython.final
 * cdef class DiploidGenotype:             # <<<<<<<<<<<<<<
 *     cdef Haplotype hap1
 *     cdef Haplotype hap2
 */
struct __pyx_obj_9cgenotype_DiploidGenotype {
  PyObject_HEAD
  struct __pyx_vtabstruct_9cgenotype_DiploidGenotype *__pyx_vtab;
  struct __pyx_obj_10chaplotype_Haplotype *hap1;
  struct __pyx_obj_10chaplotype_Haplotype *hap2;
  double hap1Like;
  double hap2Like;
};


/* "fastafile.pxd":1
 * cdef class FastaIndex:             # <<<<<<<<<<<<<<
 *     cdef object theFile
 *     cdef dict getRefs(self, int parseNCBI)
 */
struct __pyx_obj_9fastafile_FastaIndex {
  PyObject_HEAD
  struct __pyx_vtabstruct_9fastafile_FastaIndex *__pyx_vtab;
  PyObject *theFile;
};


/* "cgenotype.pxd":17
 * 
 * @cython.final
 * cdef class HaploidGenotype:             # <<<<<<<<<<<<<<
 *     cdef Haplotype hap1
 *     cdef double calculateDataLikelihood(self, cAlignedRead** start, cAlignedRead** end, int individualIndex, int nIndividuals)
 */
struct __pyx_obj_9cgenotype_HaploidGenotype {
  PyObject_HEAD
  struct __pyx_vtabstruct_9cgenotype_HaploidGenotype *__pyx_vtab;
  struct __pyx_obj_10chaplotype_Haplotype *hap1;
};


/* "htslibWrapper.pxd":222
 *     cdef object lock
 * 
 * cdef class ReadIterator:             # <<<<<<<<<<<<<<
 *     cdef cAlignedRead* get(self, int storeRgID, char** rgID)
 *     cdef int cnext(self) nogil
 */
struct __pyx_obj_13htslibWrapper_ReadIterator {
  PyObject_HEAD
  struct __pyx_vtabstruct_13htslibWrapper_ReadIterator *__pyx_vtab;
  samFile *theSamfile;
  hts_itr_t *theIterator;
  bam1_t *b;
};


/* "cwindow.pxd":29
 * ###################################################################################################
 * 
 * cdef class bamReadBuffer:             # <<<<<<<<<<<<<<
 *     cdef char* chrom
 *     cdef int chromID
 */
struct __pyx_obj_7cwindow_bamReadBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_7cwindow_bamReadBuffer *__pyx_vtab;
  char *chrom;
  int chromID;
  int *filteredReadCountsByType;
  int isSorted;
  int startBase;
  int endBase;
  int windowStartBase;
  int windowEndBase;
  int maxReads;
  int minMapQual;
  int minBaseQual;
  int minFlank;
  int trimReadFlank;
  int verbosity;
  int minGoodBases;
  int trimOverlapping;
  int trimAdapter;
  int trimSoftClipped;
  __pyx_t_13htslibWrapper_cAlignedRead *lastRead;
  PyObject *sample;
  struct __pyx_obj_7cwindow_ReadArray *reads;
  struct __pyx_obj_7cwindow_ReadArray *badReads;
  struct __pyx_obj_7cwindow_ReadArray *brokenMates;
};


/* "variant.pxd":17
 * 
 * @cython.final
 * cdef class Variant:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public bytes refName
 */
struct __pyx_obj_7variant_Variant {
  PyObject_HEAD
  struct __pyx_vtabstruct_7variant_Variant *__pyx_vtab;
  PyObject *refName;
  PyObject *added;
  PyObject *removed;
  PyObject *bamAdded;
  PyObject *bamRemoved;
  int refPos;
  int bamMinPos;
  int bamMaxPos;
  int minRefPos;
  int maxRefPos;
  int nSupportingReads;
  int varSource;
  int hashValue;
  int nAdded;
  int nRemoved;
  int varType;
};


/* "vcfutils.pyx":816
 * 
 *             firstAltChars = list(set(allele[0].upper() for allele in alt))
 *             secondAltChars = list(set(allele[1].upper() for allele in alt if len(allele) > 1))             # <<<<<<<<<<<<<<
 *             firstRefChar = ref[0].upper()
 * 
 */
struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *__pyx_outer_scope;
  PyObject *__pyx_v_allele;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "vcfutils.pyx":815
 *         for i in range(1, minLenRefAlt):
 * 
 *             firstAltChars = list(set(allele[0].upper() for allele in alt))             # <<<<<<<<<<<<<<
 *             secondAltChars = list(set(allele[1].upper() for allele in alt if len(allele) > 1))
 *             firstRefChar = ref[0].upper()
 */
struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *__pyx_outer_scope;
  PyObject *__pyx_v_allele;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};



/* "cwindow.pxd":13
 * ###################################################################################################
 * 
 * cdef class ReadArray:             # <<<<<<<<<<<<<<
 *     cdef cAlignedRead** array
 *     cdef cAlignedRead** windowStart
 */

struct __pyx_vtabstruct_7cwindow_ReadArray {
  int (*getSize)(struct __pyx_obj_7cwindow_ReadArray *);
  void (*append)(struct __pyx_obj_7cwindow_ReadArray *, __pyx_t_13htslibWrapper_cAlignedRead *);
  void (*setWindowPointers)(struct __pyx_obj_7cwindow_ReadArray *, int, int);
  void (*setWindowPointersBasedOnMatePos)(struct __pyx_obj_7cwindow_ReadArray *, int, int);
  int (*getLengthOfLongestRead)(struct __pyx_obj_7cwindow_ReadArray *);
  int (*countReadsCoveringRegion)(struct __pyx_obj_7cwindow_ReadArray *, int, int);
};
static struct __pyx_vtabstruct_7cwindow_ReadArray *__pyx_vtabptr_7cwindow_ReadArray;


/* "cwindow.pxd":29
 * ###################################################################################################
 * 
 * cdef class bamReadBuffer:             # <<<<<<<<<<<<<<
 *     cdef char* chrom
 *     cdef int chromID
 */

struct __pyx_vtabstruct_7cwindow_bamReadBuffer {
  void (*setWindowPointers)(struct __pyx_obj_7cwindow_bamReadBuffer *, int, int, int, int, char *, int);
  void (*recompressReadsInCurrentWindow)(struct __pyx_obj_7cwindow_bamReadBuffer *, int, int, char *, int, int);
  void (*addReadToBuffer)(struct __pyx_obj_7cwindow_bamReadBuffer *, __pyx_t_13htslibWrapper_cAlignedRead *);
  int (*countImproperPairs)(struct __pyx_obj_7cwindow_bamReadBuffer *);
  int (*countAlignmentGaps)(struct __pyx_obj_7cwindow_bamReadBuffer *);
  void (*sortReads)(struct __pyx_obj_7cwindow_bamReadBuffer *);
  void (*sortBrokenMates)(struct __pyx_obj_7cwindow_bamReadBuffer *);
  void (*logFilterSummary)(struct __pyx_obj_7cwindow_bamReadBuffer *);
  int (*countReadsCoveringRegion)(struct __pyx_obj_7cwindow_bamReadBuffer *, int, int);
};
static struct __pyx_vtabstruct_7cwindow_bamReadBuffer *__pyx_vtabptr_7cwindow_bamReadBuffer;


/* "fastafile.pxd":1
 * cdef class FastaIndex:             # <<<<<<<<<<<<<<
 *     cdef object theFile
 *     cdef dict getRefs(self, int parseNCBI)
 */

struct __pyx_vtabstruct_9fastafile_FastaIndex {
  PyObject *(*getRefs)(struct __pyx_obj_9fastafile_FastaIndex *, int);
};
static struct __pyx_vtabstruct_9fastafile_FastaIndex *__pyx_vtabptr_9fastafile_FastaIndex;


/* "chaplotype.pxd":14
 * 
 * @cython.final
 * cdef class Haplotype:             # <<<<<<<<<<<<<<
 *     cdef:
 *         bytes refName
 */

struct __pyx_vtabstruct_10chaplotype_Haplotype {
  double *(*alignReads)(struct __pyx_obj_10chaplotype_Haplotype *, int, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, int);
  double (*alignSingleRead)(struct __pyx_obj_10chaplotype_Haplotype *, __pyx_t_13htslibWrapper_cAlignedRead *, int);
  char *(*getReferenceSequence)(struct __pyx_obj_10chaplotype_Haplotype *, struct __pyx_opt_args_10chaplotype_9Haplotype_getReferenceSequence *__pyx_optional_args);
  char *(*getMutatedSequence)(struct __pyx_obj_10chaplotype_Haplotype *);
  char *(*getShortHaplotypeSequence)(struct __pyx_obj_10chaplotype_Haplotype *);
  PyObject *(*vcfINFO)(struct __pyx_obj_10chaplotype_Haplotype *);
  PyObject *(*getSequenceContext)(struct __pyx_obj_10chaplotype_Haplotype *, struct __pyx_obj_7variant_Variant *);
  int (*homopolymerLengthForOneVariant)(struct __pyx_obj_10chaplotype_Haplotype *, struct __pyx_obj_7variant_Variant *);
  PyObject *(*homopolymerLengths)(struct __pyx_obj_10chaplotype_Haplotype *);
  void (*annotateWithGapOpen)(struct __pyx_obj_10chaplotype_Haplotype *);
};
static struct __pyx_vtabstruct_10chaplotype_Haplotype *__pyx_vtabptr_10chaplotype_Haplotype;


/* "fastafile.pxd":5
 *     cdef dict getRefs(self, int parseNCBI)
 * 
 * cdef class FastaFile(object):             # <<<<<<<<<<<<<<
 *     cdef object theFile
 *     cdef FastaIndex theIndex
 */

struct __pyx_vtabstruct_9fastafile_FastaFile {
  PyObject *(*getCharacter)(struct __pyx_obj_9fastafile_FastaFile *, PyObject *, PY_LONG_LONG);
  PyObject *(*getSequence)(struct __pyx_obj_9fastafile_FastaFile *, PyObject *, PY_LONG_LONG, PY_LONG_LONG);
  void (*setCacheSequence)(struct __pyx_obj_9fastafile_FastaFile *, PyObject *, PY_LONG_LONG, PY_LONG_LONG);
};
static struct __pyx_vtabstruct_9fastafile_FastaFile *__pyx_vtabptr_9fastafile_FastaFile;


/* "variant.pxd":17
 * 
 * @cython.final
 * cdef class Variant:             # <<<<<<<<<<<<<<
 *     cdef:
 *         public bytes refName
 */

struct __pyx_vtabstruct_7variant_Variant {
  double (*indelPrior)(struct __pyx_obj_7variant_Variant *, struct __pyx_obj_9fastafile_FastaFile *, int);
  double (*calculatePrior)(struct __pyx_obj_7variant_Variant *, struct __pyx_obj_9fastafile_FastaFile *);
  void (*addVariant)(struct __pyx_obj_7variant_Variant *, struct __pyx_obj_7variant_Variant *);
  int (*overlaps)(struct __pyx_obj_7variant_Variant *, struct __pyx_obj_7variant_Variant *);
};
static struct __pyx_vtabstruct_7variant_Variant *__pyx_vtabptr_7variant_Variant;


/* "cgenotype.pxd":9
 * 
 * @cython.final
 * cdef class DiploidGenotype:             # <<<<<<<<<<<<<<
 *     cdef Haplotype hap1
 *     cdef Haplotype hap2
 */

struct __pyx_vtabstruct_9cgenotype_DiploidGenotype {
  double (*calculateDataLikelihood)(struct __pyx_obj_9cgenotype_DiploidGenotype *, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, int, int, double *, int);
};
static struct __pyx_vtabstruct_9cgenotype_DiploidGenotype *__pyx_vtabptr_9cgenotype_DiploidGenotype;


/* "cpopulation.pxd":12
 * ###################################################################################################
 * 
 * cdef class Population:             # <<<<<<<<<<<<<<
 * 
 *     # Class variables
 */

struct __pyx_vtabstruct_11cpopulation_Population {
  double (*calculatePosterior)(struct __pyx_obj_11cpopulation_Population *, struct __pyx_obj_7variant_Variant *, struct __pyx_opt_args_11cpopulation_10Population_calculatePosterior *__pyx_optional_args);
  void (*computeVariantPosteriors)(struct __pyx_obj_11cpopulation_Population *);
  void (*computeVariantINFO)(struct __pyx_obj_11cpopulation_Population *);
  void (*reset)(struct __pyx_obj_11cpopulation_Population *);
  void (*computeVariantFILTER)(struct __pyx_obj_11cpopulation_Population *);
  void (*callGenotypes)(struct __pyx_obj_11cpopulation_Population *);
  void (*call)(struct __pyx_obj_11cpopulation_Population *, int, int);
  double (*EMiteration)(struct __pyx_obj_11cpopulation_Population *, double *, double *);
  void (*setup)(struct __pyx_obj_11cpopulation_Population *, PyObject *, PyObject *, PyObject *, int, int, PyObject *);
};
static struct __pyx_vtabstruct_11cpopulation_Population *__pyx_vtabptr_11cpopulation_Population;


/* "htslibWrapper.pxd":203
 *     unsigned char mapq
 * 
 * cdef class Samfile:             # <<<<<<<<<<<<<<
 *     cdef void clearHeader(self)
 *     cdef void clearIndex(self)
 */

struct __pyx_vtabstruct_13htslibWrapper_Samfile {
  void (*clearHeader)(struct __pyx_obj_13htslibWrapper_Samfile *);
  void (*clearIndex)(struct __pyx_obj_13htslibWrapper_Samfile *);
  int (*_isBam)(struct __pyx_obj_13htslibWrapper_Samfile *);
  int (*_isCram)(struct __pyx_obj_13htslibWrapper_Samfile *);
  int (*_isOpen)(struct __pyx_obj_13htslibWrapper_Samfile *);
  PyObject *(*_hasIndex)(struct __pyx_obj_13htslibWrapper_Samfile *);
  void (*openBAMFile)(struct __pyx_obj_13htslibWrapper_Samfile *, PyObject *);
  PyObject *(*_open)(struct __pyx_obj_13htslibWrapper_Samfile *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_13htslibWrapper_7Samfile__open *__pyx_optional_args);
  char *(*getrname)(struct __pyx_obj_13htslibWrapper_Samfile *, int);
  struct __pyx_obj_13htslibWrapper_ReadIterator *(*fetch)(struct __pyx_obj_13htslibWrapper_Samfile *, char const *, int __pyx_skip_dispatch);
  PyObject *(*close)(struct __pyx_obj_13htslibWrapper_Samfile *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_13htslibWrapper_Samfile *__pyx_vtabptr_13htslibWrapper_Samfile;


/* "htslibWrapper.pxd":222
 *     cdef object lock
 * 
 * cdef class ReadIterator:             # <<<<<<<<<<<<<<
 *     cdef cAlignedRead* get(self, int storeRgID, char** rgID)
 *     cdef int cnext(self) nogil
 */

struct __pyx_vtabstruct_13htslibWrapper_ReadIterator {
  __pyx_t_13htslibWrapper_cAlignedRead *(*get)(struct __pyx_obj_13htslibWrapper_ReadIterator *, int, char **);
  int (*cnext)(struct __pyx_obj_13htslibWrapper_ReadIterator *);
  char (*_getBase)(struct __pyx_obj_13htslibWrapper_ReadIterator *, uint8_t *, int);
};
static struct __pyx_vtabstruct_13htslibWrapper_ReadIterator *__pyx_vtabptr_13htslibWrapper_ReadIterator;


/* "variant.pxd":44
 * 
 * @cython.final
 * cdef class VariantCandidateGenerator:             # <<<<<<<<<<<<<<
 *     cdef int CIGAR_M
 *     cdef int CIGAR_I
 */

struct __pyx_vtabstruct_7variant_VariantCandidateGenerator {
  void (*addVariantToList)(struct __pyx_obj_7variant_VariantCandidateGenerator *, struct __pyx_obj_7variant_Variant *);
  void (*getSnpCandidatesFromReadSegment)(struct __pyx_obj_7variant_VariantCandidateGenerator *, __pyx_t_13htslibWrapper_cAlignedRead *, char *, char *, int, int, int, int, int);
  void (*getVariantCandidatesFromSingleRead)(struct __pyx_obj_7variant_VariantCandidateGenerator *, __pyx_t_13htslibWrapper_cAlignedRead *);
  void (*addCandidatesFromReads)(struct __pyx_obj_7variant_VariantCandidateGenerator *, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **);
  PyObject *(*getCandidates)(struct __pyx_obj_7variant_VariantCandidateGenerator *, int);
};
static struct __pyx_vtabstruct_7variant_VariantCandidateGenerator *__pyx_vtabptr_7variant_VariantCandidateGenerator;


/* "cgenotype.pxd":17
 * 
 * @cython.final
 * cdef class HaploidGenotype:             # <<<<<<<<<<<<<<
 *     cdef Haplotype hap1
 *     cdef double calculateDataLikelihood(self, cAlignedRead** start, cAlignedRead** end, int individualIndex, int nIndividuals)
 */

struct __pyx_vtabstruct_9cgenotype_HaploidGenotype {
  double (*calculateDataLikelihood)(struct __pyx_obj_9cgenotype_HaploidGenotype *, __pyx_t_13htslibWrapper_cAlignedRead **, __pyx_t_13htslibWrapper_cAlignedRead **, int, int);
};
static struct __pyx_vtabstruct_9cgenotype_HaploidGenotype *__pyx_vtabptr_9cgenotype_HaploidGenotype;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#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 int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*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 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_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename); /*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

#if PY_MAJOR_VERSION >= 3
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); /*proto*/
#else
#define __Pyx_PyDict_Keys(d) PyDict_Keys(d)
#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 int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/

#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 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 CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/

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

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

#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
    (((size) <= sizeof(Py_ssize_t)) ? \
    __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \
    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
    (((size) <= sizeof(Py_ssize_t)) ? \
    __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \
    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
    (((size) <= sizeof(Py_ssize_t)) ? \
    __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \
    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
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_RaiseClosureNameError(const char *varname);

#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) \
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, 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 PY_MAJOR_VERSION >= 3
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); /*proto*/
#else
#define __Pyx_PyDict_Values(d) PyDict_Values(d)
#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 = 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_PyObject_Append(PyObject* L, PyObject* x); /*proto*/

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

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

#define __Pyx_SetItemInt(o, i, v, size, to_py_func, is_list, wraparound, boundscheck) \
    (((size) <= sizeof(Py_ssize_t)) ? \
    __Pyx_SetItemInt_Fast(o, i, v, is_list, wraparound, boundscheck) : \
    __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 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 PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /*proto*/

#include <string.h>

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

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

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

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

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

#define __Pyx_Generator_USED
#include <structmember.h>
#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;  // using T_BOOL for property below requires char value
} __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);

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*/

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

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

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

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

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


/* Module declarations from 'fastafile' */
static PyTypeObject *__pyx_ptype_9fastafile_FastaIndex = 0;
static PyTypeObject *__pyx_ptype_9fastafile_FastaFile = 0;

/* Module declarations from 'cython' */

/* 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 'htslibWrapper' */
static PyTypeObject *__pyx_ptype_13htslibWrapper_Samfile = 0;
static PyTypeObject *__pyx_ptype_13htslibWrapper_ReadIterator = 0;
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsReverse(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsPaired(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsProperPair(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsDuplicate(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsUnmapped(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_MateIsUnmapped(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_MateIsReverse(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsQCFail(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsReadOne(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsSecondaryAlignment(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/
static CYTHON_INLINE void __pyx_f_13htslibWrapper_Read_SetQCFail(__pyx_t_13htslibWrapper_cAlignedRead *); /*proto*/

/* Module declarations from 'variant' */
static PyTypeObject *__pyx_ptype_7variant_Variant = 0;
static PyTypeObject *__pyx_ptype_7variant_VariantCandidateGenerator = 0;
static int *__pyx_vp_7variant_PLATYPUS_VAR = 0;
#define __pyx_v_7variant_PLATYPUS_VAR (*__pyx_vp_7variant_PLATYPUS_VAR)
static int *__pyx_vp_7variant_FILE_VAR = 0;
#define __pyx_v_7variant_FILE_VAR (*__pyx_vp_7variant_FILE_VAR)
static int *__pyx_vp_7variant_ASSEMBLER_VAR = 0;
#define __pyx_v_7variant_ASSEMBLER_VAR (*__pyx_vp_7variant_ASSEMBLER_VAR)

/* Module declarations from 'cwindow' */
static PyTypeObject *__pyx_ptype_7cwindow_ReadArray = 0;
static PyTypeObject *__pyx_ptype_7cwindow_bamReadBuffer = 0;

/* Module declarations from 'cpopulation' */
static PyTypeObject *__pyx_ptype_11cpopulation_Population = 0;

/* Module declarations from 'chaplotype' */
static PyTypeObject *__pyx_ptype_10chaplotype_Haplotype = 0;

/* Module declarations from 'cgenotype' */
static PyTypeObject *__pyx_ptype_9cgenotype_DiploidGenotype = 0;
static PyTypeObject *__pyx_ptype_9cgenotype_HaploidGenotype = 0;

/* Module declarations from 'platypusutils' */
static double (*__pyx_f_13platypusutils_binomial)(int, int, double); /*proto*/
static double (*__pyx_f_13platypusutils_betaBinomialCDF)(int, int, int, int); /*proto*/

/* Module declarations from 'vcfutils' */
static PyTypeObject *__pyx_ptype_8vcfutils___pyx_scope_struct__trimLeftPadding = 0;
static PyTypeObject *__pyx_ptype_8vcfutils___pyx_scope_struct_2_genexpr = 0;
static PyTypeObject *__pyx_ptype_8vcfutils___pyx_scope_struct_1_genexpr = 0;
static double __pyx_v_8vcfutils_LOG10_E;
static int __pyx_v_8vcfutils_CIGAR_M;
static int __pyx_v_8vcfutils_CIGAR_I;
static int __pyx_v_8vcfutils_CIGAR_D;
static int __pyx_v_8vcfutils_CIGAR_N;
static int __pyx_v_8vcfutils_CIGAR_S;
static int __pyx_v_8vcfutils_CIGAR_H;
static int __pyx_v_8vcfutils_CIGAR_P;
static int __pyx_v_8vcfutils_CIGAR_EQ;
static int __pyx_v_8vcfutils_CIGAR_X;
static PyObject *__pyx_f_8vcfutils_refAndAlt(char *, int, PyObject *, struct __pyx_obj_9fastafile_FastaFile *); /*proto*/
static PyObject *__pyx_f_8vcfutils_computeGenotypeCallAndLikelihoods(int, PyObject *, PyObject *, int, double *, double **, double **, int **, int **, PyObject *, int *, int, PyObject *); /*proto*/
static int __pyx_f_8vcfutils_readOverlapsVariant(__pyx_t_13htslibWrapper_cAlignedRead *, int, int); /*proto*/
static int __pyx_f_8vcfutils_readQualIsGoodVariantPosition(__pyx_t_13htslibWrapper_cAlignedRead *, int, int, int); /*proto*/
static int __pyx_f_8vcfutils_variantSupportedByRead(__pyx_t_13htslibWrapper_cAlignedRead *, int, int, struct __pyx_obj_7variant_Variant *, int); /*proto*/
static int __pyx_f_8vcfutils_computeHaplotypeScore(PyObject *); /*proto*/
static PyObject *__pyx_f_8vcfutils_getHaplotypeInfo(PyObject *, PyObject *, double *, int); /*proto*/
static double __pyx_f_8vcfutils_computeAlleleBiasPValue(int, int); /*proto*/
static double __pyx_f_8vcfutils_computeStrandBiasPValue(int, int, int, int); /*proto*/
static double __pyx_f_8vcfutils_computeSCValue(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "vcfutils"
int __pyx_module_is_main_vcfutils = 0;

/* Implementation of 'vcfutils' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_min;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_pf_8vcfutils_outputSingleLineOfVCF(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_outputFile, PyObject *__pyx_v_vcfFile, CYTHON_UNUSED PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8vcfutils_15trimLeftPadding_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8vcfutils_15trimLeftPadding_3genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8vcfutils_2trimLeftPadding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vcfDataLine); /* proto */
static PyObject *__pyx_tp_new_8vcfutils___pyx_scope_struct__trimLeftPadding(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8vcfutils___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8vcfutils___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_1[] = "Haps are %s";
static char __pyx_k_2[] = "Logging mutated sequences...";
static char __pyx_k_4[] = "Lengths are %s";
static char __pyx_k_6[] = "Unfiltered variants are %s";
static char __pyx_k_7[] = "Var info = %s";
static char __pyx_k_8[] = "Unfiltered variant info is %s";
static char __pyx_k_9[] = "NVariants = %s";
static char __pyx_k_10[] = ".";
static char __pyx_k_11[] = "GT:GL:GOF:GQ:NR:NV";
static char __pyx_k_12[] = "/";
static char __pyx_k_13[] = "Sample %s has genotype posterior = %s. non-ref posterior = %s. Ref posterior = %s.";
static char __pyx_k_17[] = "Skipping output for call %s:%s %s --> %s, as the reference sequence contains non-canonical bases (i.e. not A,C,T,G)";
static char __pyx_k_18[] = "outputSingleLineOfVCF";
static char __pyx_k_19[] = "Start output to vcf";
static char __pyx_k_21[] = "";
static char __pyx_k_22[] = "Individual\t%d\t%d\t%d:%d-%d\n";
static char __pyx_k_23[] = "%d %d %s\n";
static char __pyx_k_24[] = "%s\n";
static char __pyx_k_25[] = "\t";
static char __pyx_k_26[] = "GT:GL:NR:NV1:NV2";
static char __pyx_k_27[] = "WS=";
static char __pyx_k_28[] = ";WE=";
static char __pyx_k_29[] = ";Size=";
static char __pyx_k_30[] = ";varSource=";
static char __pyx_k_31[] = ",";
static char __pyx_k_32[] = ":";
static char __pyx_k_33[] = "Out vcf writing";
static char __pyx_k_37[] = "%.0f";
static char __pyx_k_38[] = "countOnlyExactIndelMatches";
static char __pyx_k_39[] = "%1.4f";
static char __pyx_k_41[] = "\nUtility code for Platypus. This is mostly concerned with processing needed to produce\nVCF output from the various data structures used by Platypus.\n";
static char __pyx_k_43[] = "Estimated population frequency of variant";
static char __pyx_k_45[] = "Posterior probability (phred scaled) that this variant segregates";
static char __pyx_k_47[] = "Total coverage at this locus";
static char __pyx_k_49[] = "Starting position of calling window";
static char __pyx_k_51[] = "End position of calling window";
static char __pyx_k_53[] = "Total reverse strand coverage at this locus";
static char __pyx_k_55[] = "Total forward strand coverage at this locus";
static char __pyx_k_57[] = "Total number of reads containing this variant";
static char __pyx_k_59[] = "Total number of forward reads containing this variant";
static char __pyx_k_61[] = "Total number of reverse reads containing this variant";
static char __pyx_k_63[] = "Worst goodness-of-fit value reported across all samples";
static char __pyx_k_65[] = "Genomic sequence 10 bases either side of variant position";
static char __pyx_k_67[] = "Homopolymer run length around variant locus";
static char __pyx_k_69[] = "Fraction of reads around this variant that failed filters";
static char __pyx_k_71[] = "Median minimum base quality for bases around variant";
static char __pyx_k_73[] = "Variant-quality/read-depth for this variant";
static char __pyx_k_75[] = "Was this variant suggested by Playtypus, Assembler, or from a VCF?";
static char __pyx_k_77[] = "Start position of reference call block";
static char __pyx_k_79[] = "End position of reference call block";
static char __pyx_k_81[] = "Size of reference call block";
static char __pyx_k_83[] = "Haplotype score measuring the number of haplotypes the variant is segregating into in a window";
static char __pyx_k_85[] = "Root mean square of mapping qualities of reads at the variant position";
static char __pyx_k_87[] = "Fisher's exact test for strand bias (Phred scale)";
static char __pyx_k_89[] = "Binomial P-value for strand bias test";
static char __pyx_k_91[] = "Mann-Whitney Rank sum test for difference between in positions of variants in reads from ref and alt";
static char __pyx_k_93[] = "Variant frequency is lower than expected for het";
static char __pyx_k_95[] = "Variant fails strand-bias filter";
static char __pyx_k_97[] = "Variant supported only by reads with low quality bases close to variant position, and not present on both strands.";
static char __pyx_k_99[] = "Root-mean-square mapping quality across calling region is low.";
static char __pyx_k__0[] = "0";
static char __pyx_k__A[] = "A";
static char __pyx_k__C[] = "C";
static char __pyx_k__G[] = "G";
static char __pyx_k__T[] = "T";
static char __pyx_k__a[] = "a";
static char __pyx_k__i[] = "i";
static char __pyx_k_101[] = "Variant quality is below 20.";
static char __pyx_k_103[] = "Too many haplotypes are supported by the data in this region.";
static char __pyx_k_105[] = "Variant quality/Read depth ratio is low.";
static char __pyx_k_107[] = "Variant fails goodness-of-fit test.";
static char __pyx_k_109[] = "Flanking sequence contains homopolymer of length 10 or greater";
static char __pyx_k_111[] = "This line represents a homozygous reference call";
static char __pyx_k_113[] = "Variants fail quality/depth filter.";
static char __pyx_k_115[] = "Variants fail sequence-context filter. Surrounding sequence is low-complexity";
static char __pyx_k_117[] = "Unphased genotypes";
static char __pyx_k_119[] = "Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites";
static char __pyx_k_121[] = "Genotype quality as phred score";
static char __pyx_k_123[] = "Goodness of fit value";
static char __pyx_k_125[] = "Number of reads covering variant location in this sample";
static char __pyx_k_127[] = "Number of reads containing variant in this sample";
static char __pyx_k_131[] = "/home/chapmanb/bio/Platypus/src/cython/vcfutils.pyx";
static char __pyx_k__FR[] = "FR";
static char __pyx_k__FS[] = "FS";
static char __pyx_k__GL[] = "GL";
static char __pyx_k__GQ[] = "GQ";
static char __pyx_k__GT[] = "GT";
static char __pyx_k__HP[] = "HP";
static char __pyx_k__MQ[] = "MQ";
static char __pyx_k__NF[] = "NF";
static char __pyx_k__NR[] = "NR";
static char __pyx_k__NV[] = "NV";
static char __pyx_k__PP[] = "PP";
static char __pyx_k__QD[] = "QD";
static char __pyx_k__SC[] = "SC";
static char __pyx_k__TC[] = "TC";
static char __pyx_k__TR[] = "TR";
static char __pyx_k__WE[] = "WE";
static char __pyx_k__WS[] = "WS";
static char __pyx_k__id[] = "id";
static char __pyx_k__BRF[] = "BRF";
static char __pyx_k__END[] = "END";
static char __pyx_k__GOF[] = "GOF";
static char __pyx_k__Log[] = "Log";
static char __pyx_k__Q20[] = "Q20";
static char __pyx_k__TCF[] = "TCF";
static char __pyx_k__TCR[] = "TCR";
static char __pyx_k__alt[] = "alt";
static char __pyx_k__get[] = "get";
static char __pyx_k__len[] = "len";
static char __pyx_k__map[] = "map";
static char __pyx_k__max[] = "max";
static char __pyx_k__min[] = "min";
static char __pyx_k__pop[] = "pop";
static char __pyx_k__pos[] = "pos";
static char __pyx_k__ref[] = "ref";
static char __pyx_k__sum[] = "sum";
static char __pyx_k__vcf[] = "vcf";
static char __pyx_k__ABPV[] = "ABPV";
static char __pyx_k__File[] = "File";
static char __pyx_k__Flag[] = "Flag";
static char __pyx_k__MGOF[] = "MGOF";
static char __pyx_k__MMLQ[] = "MMLQ";
static char __pyx_k__PASS[] = "PASS";
static char __pyx_k__Size[] = "Size";
static char __pyx_k__args[] = "args";
static char __pyx_k__data[] = "data";
static char __pyx_k__hp10[] = "hp10";
static char __pyx_k__info[] = "info";
static char __pyx_k__join[] = "join";
static char __pyx_k__keys[] = "keys";
static char __pyx_k__open[] = "open";
static char __pyx_k__qual[] = "qual";
static char __pyx_k__send[] = "send";
static char __pyx_k__Float[] = "Float";
static char __pyx_k__START[] = "START";
static char __pyx_k__chrom[] = "chrom";
static char __pyx_k__close[] = "close";
static char __pyx_k__debug[] = "debug";
static char __pyx_k__index[] = "index";
static char __pyx_k__range[] = "range";
static char __pyx_k__round[] = "round";
static char __pyx_k__throw[] = "throw";
static char __pyx_k__upper[] = "upper";
static char __pyx_k__write[] = "write";
static char __pyx_k__FORMAT[] = "FORMAT";
static char __pyx_k__SbPval[] = "SbPval";
static char __pyx_k__Source[] = "Source";
static char __pyx_k__String[] = "String";
static char __pyx_k__allele[] = "allele";
static char __pyx_k__append[] = "append";
static char __pyx_k__extend[] = "extend";
static char __pyx_k__filter[] = "filter";
static char __pyx_k__format[] = "format";
static char __pyx_k__logger[] = "logger";
static char __pyx_k__maxGOF[] = "maxGOF";
static char __pyx_k__sorted[] = "sorted";
static char __pyx_k__values[] = "values";
static char __pyx_k__xrange[] = "xrange";
static char __pyx_k__Integer[] = "Integer";
static char __pyx_k__REFCALL[] = "REFCALL";
static char __pyx_k__genexpr[] = "genexpr";
static char __pyx_k__logging[] = "logging";
static char __pyx_k__options[] = "options";
static char __pyx_k__refName[] = "refName";
static char __pyx_k__reverse[] = "reverse";
static char __pyx_k__vcfFile[] = "vcfFile";
static char __pyx_k__warning[] = "warning";
static char __pyx_k__HapScore[] = "HapScore";
static char __pyx_k__Platypus[] = "Platypus";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__badReads[] = "badReads";
static char __pyx_k__minReads[] = "minReads";
static char __pyx_k__vcfutils[] = "vcfutils";
static char __pyx_k__Assembler[] = "Assembler";
static char __pyx_k__HLATyping[] = "HLATyping";
static char __pyx_k__QualDepth[] = "QualDepth";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k__getLogger[] = "getLogger";
static char __pyx_k__getfilter[] = "getfilter";
static char __pyx_k__iteritems[] = "iteritems";
static char __pyx_k__maxRefPos[] = "maxRefPos";
static char __pyx_k__minRefPos[] = "minRefPos";
static char __pyx_k__verbosity[] = "verbosity";
static char __pyx_k____import__[] = "__import__";
static char __pyx_k__alleleBias[] = "alleleBias";
static char __pyx_k__maxLenDiff[] = "maxLenDiff";
static char __pyx_k__minMapQual[] = "minMapQual";
static char __pyx_k__outputFile[] = "outputFile";
static char __pyx_k__strandBias[] = "strandBias";
static char __pyx_k__write_data[] = "write_data";
static char __pyx_k__abThreshold[] = "abThreshold";
static char __pyx_k__minBaseQual[] = "minBaseQual";
static char __pyx_k__qdThreshold[] = "qdThreshold";
static char __pyx_k__sbThreshold[] = "sbThreshold";
static char __pyx_k__scThreshold[] = "scThreshold";
static char __pyx_k__vcfDataLine[] = "vcfDataLine";
static char __pyx_k__firstRefChar[] = "firstRefChar";
static char __pyx_k__minLenRefAlt[] = "minLenRefAlt";
static char __pyx_k__minPosterior[] = "minPosterior";
static char __pyx_k__firstAltChars[] = "firstAltChars";
static char __pyx_k__ReadPosRankSum[] = "ReadPosRankSum";
static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__";
static char __pyx_k__alignScoreFile[] = "alignScoreFile";
static char __pyx_k__badReadsWindow[] = "badReadsWindow";
static char __pyx_k__canonicalBases[] = "canonicalBases";
static char __pyx_k__outputRefCalls[] = "outputRefCalls";
static char __pyx_k__rmsmqThreshold[] = "rmsmqThreshold";
static char __pyx_k__secondAltChars[] = "secondAltChars";
static char __pyx_k__nReadsPerSample[] = "nReadsPerSample";
static char __pyx_k__trimLeftPadding[] = "trimLeftPadding";
static char __pyx_k__vcfInfoSignature[] = "vcfInfoSignature";
static char __pyx_k__badReadsThreshold[] = "badReadsThreshold";
static char __pyx_k__filteredReadsFrac[] = "filteredReadsFrac";
static char __pyx_k__hapScoreThreshold[] = "hapScoreThreshold";
static char __pyx_k__nVarReadsPerSample[] = "nVarReadsPerSample";
static char __pyx_k__vcfFilterSignature[] = "vcfFilterSignature";
static char __pyx_k__vcfFormatSignature[] = "vcfFormatSignature";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_101;
static PyObject *__pyx_kp_s_103;
static PyObject *__pyx_kp_s_105;
static PyObject *__pyx_kp_s_107;
static PyObject *__pyx_kp_s_109;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_111;
static PyObject *__pyx_kp_s_113;
static PyObject *__pyx_kp_s_115;
static PyObject *__pyx_kp_s_117;
static PyObject *__pyx_kp_s_119;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_121;
static PyObject *__pyx_kp_s_123;
static PyObject *__pyx_kp_s_125;
static PyObject *__pyx_kp_s_127;
static PyObject *__pyx_kp_s_13;
static PyObject *__pyx_kp_s_131;
static PyObject *__pyx_kp_s_17;
static PyObject *__pyx_n_s_18;
static PyObject *__pyx_kp_s_19;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_22;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_24;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_27;
static PyObject *__pyx_kp_s_28;
static PyObject *__pyx_kp_s_29;
static PyObject *__pyx_kp_s_30;
static PyObject *__pyx_kp_s_31;
static PyObject *__pyx_kp_s_32;
static PyObject *__pyx_kp_s_33;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_n_s_38;
static PyObject *__pyx_kp_s_39;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_47;
static PyObject *__pyx_kp_s_49;
static PyObject *__pyx_kp_s_51;
static PyObject *__pyx_kp_s_53;
static PyObject *__pyx_kp_s_55;
static PyObject *__pyx_kp_s_57;
static PyObject *__pyx_kp_s_59;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_61;
static PyObject *__pyx_kp_s_63;
static PyObject *__pyx_kp_s_65;
static PyObject *__pyx_kp_s_67;
static PyObject *__pyx_kp_s_69;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_71;
static PyObject *__pyx_kp_s_73;
static PyObject *__pyx_kp_s_75;
static PyObject *__pyx_kp_s_77;
static PyObject *__pyx_kp_s_79;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_kp_s_81;
static PyObject *__pyx_kp_s_83;
static PyObject *__pyx_kp_s_85;
static PyObject *__pyx_kp_s_87;
static PyObject *__pyx_kp_s_89;
static PyObject *__pyx_kp_s_9;
static PyObject *__pyx_kp_s_91;
static PyObject *__pyx_kp_s_93;
static PyObject *__pyx_kp_s_95;
static PyObject *__pyx_kp_s_97;
static PyObject *__pyx_kp_s_99;
static PyObject *__pyx_kp_s__0;
static PyObject *__pyx_n_s__A;
static PyObject *__pyx_n_s__ABPV;
static PyObject *__pyx_n_s__Assembler;
static PyObject *__pyx_n_s__BRF;
static PyObject *__pyx_n_s__C;
static PyObject *__pyx_n_s__END;
static PyObject *__pyx_n_s__FORMAT;
static PyObject *__pyx_n_s__FR;
static PyObject *__pyx_n_s__FS;
static PyObject *__pyx_n_s__File;
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__GOF;
static PyObject *__pyx_n_s__GQ;
static PyObject *__pyx_n_s__GT;
static PyObject *__pyx_n_s__HLATyping;
static PyObject *__pyx_n_s__HP;
static PyObject *__pyx_n_s__HapScore;
static PyObject *__pyx_n_s__Integer;
static PyObject *__pyx_n_s__Log;
static PyObject *__pyx_n_s__MGOF;
static PyObject *__pyx_n_s__MMLQ;
static PyObject *__pyx_n_s__MQ;
static PyObject *__pyx_n_s__NF;
static PyObject *__pyx_n_s__NR;
static PyObject *__pyx_n_s__NV;
static PyObject *__pyx_n_s__PASS;
static PyObject *__pyx_n_s__PP;
static PyObject *__pyx_n_s__Platypus;
static PyObject *__pyx_n_s__Q20;
static PyObject *__pyx_n_s__QD;
static PyObject *__pyx_n_s__QualDepth;
static PyObject *__pyx_n_s__REFCALL;
static PyObject *__pyx_n_s__ReadPosRankSum;
static PyObject *__pyx_n_s__SC;
static PyObject *__pyx_n_s__START;
static PyObject *__pyx_n_s__SbPval;
static PyObject *__pyx_n_s__Size;
static PyObject *__pyx_n_s__Source;
static PyObject *__pyx_n_s__String;
static PyObject *__pyx_n_s__T;
static PyObject *__pyx_n_s__TC;
static PyObject *__pyx_n_s__TCF;
static PyObject *__pyx_n_s__TCR;
static PyObject *__pyx_n_s__TR;
static PyObject *__pyx_n_s__WE;
static PyObject *__pyx_n_s__WS;
static PyObject *__pyx_n_s____import__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____pyx_vtable__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__a;
static PyObject *__pyx_n_s__abThreshold;
static PyObject *__pyx_n_s__alignScoreFile;
static PyObject *__pyx_n_s__allele;
static PyObject *__pyx_n_s__alleleBias;
static PyObject *__pyx_n_s__alt;
static PyObject *__pyx_n_s__append;
static PyObject *__pyx_n_s__args;
static PyObject *__pyx_n_s__badReads;
static PyObject *__pyx_n_s__badReadsThreshold;
static PyObject *__pyx_n_s__badReadsWindow;
static PyObject *__pyx_n_s__canonicalBases;
static PyObject *__pyx_n_s__chrom;
static PyObject *__pyx_n_s__close;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__debug;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__extend;
static PyObject *__pyx_n_s__filter;
static PyObject *__pyx_n_s__filteredReadsFrac;
static PyObject *__pyx_n_s__firstAltChars;
static PyObject *__pyx_n_s__firstRefChar;
static PyObject *__pyx_n_s__format;
static PyObject *__pyx_n_s__genexpr;
static PyObject *__pyx_n_s__get;
static PyObject *__pyx_n_s__getLogger;
static PyObject *__pyx_n_s__getfilter;
static PyObject *__pyx_n_s__hapScoreThreshold;
static PyObject *__pyx_n_s__hp10;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__id;
static PyObject *__pyx_n_s__index;
static PyObject *__pyx_n_s__info;
static PyObject *__pyx_n_s__iteritems;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__keys;
static PyObject *__pyx_n_s__len;
static PyObject *__pyx_n_s__logger;
static PyObject *__pyx_n_s__logging;
static PyObject *__pyx_n_s__map;
static PyObject *__pyx_n_s__max;
static PyObject *__pyx_n_s__maxGOF;
static PyObject *__pyx_n_s__maxLenDiff;
static PyObject *__pyx_n_s__maxRefPos;
static PyObject *__pyx_n_s__min;
static PyObject *__pyx_n_s__minBaseQual;
static PyObject *__pyx_n_s__minLenRefAlt;
static PyObject *__pyx_n_s__minMapQual;
static PyObject *__pyx_n_s__minPosterior;
static PyObject *__pyx_n_s__minReads;
static PyObject *__pyx_n_s__minRefPos;
static PyObject *__pyx_n_s__nReadsPerSample;
static PyObject *__pyx_n_s__nVarReadsPerSample;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__options;
static PyObject *__pyx_n_s__outputFile;
static PyObject *__pyx_n_s__outputRefCalls;
static PyObject *__pyx_n_s__pop;
static PyObject *__pyx_n_s__pos;
static PyObject *__pyx_n_s__qdThreshold;
static PyObject *__pyx_n_s__qual;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__ref;
static PyObject *__pyx_n_s__refName;
static PyObject *__pyx_n_s__reverse;
static PyObject *__pyx_n_s__rmsmqThreshold;
static PyObject *__pyx_n_s__round;
static PyObject *__pyx_n_s__sbThreshold;
static PyObject *__pyx_n_s__scThreshold;
static PyObject *__pyx_n_s__secondAltChars;
static PyObject *__pyx_n_s__send;
static PyObject *__pyx_n_s__sorted;
static PyObject *__pyx_n_s__strandBias;
static PyObject *__pyx_n_s__sum;
static PyObject *__pyx_n_s__throw;
static PyObject *__pyx_n_s__trimLeftPadding;
static PyObject *__pyx_n_s__upper;
static PyObject *__pyx_n_s__values;
static PyObject *__pyx_n_s__vcf;
static PyObject *__pyx_n_s__vcfDataLine;
static PyObject *__pyx_n_s__vcfFile;
static PyObject *__pyx_n_s__vcfFilterSignature;
static PyObject *__pyx_n_s__vcfFormatSignature;
static PyObject *__pyx_n_s__vcfInfoSignature;
static PyObject *__pyx_n_s__vcfutils;
static PyObject *__pyx_n_s__verbosity;
static PyObject *__pyx_n_s__warning;
static PyObject *__pyx_n_s__write;
static PyObject *__pyx_n_s__write_data;
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_neg_1;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_50;
static PyObject *__pyx_int_neg_50;
static PyObject *__pyx_int_100;
static PyObject *__pyx_k_slice_5;
static PyObject *__pyx_k_tuple_3;
static PyObject *__pyx_k_slice_35;
static PyObject *__pyx_k_slice_36;
static PyObject *__pyx_k_slice_40;
static PyObject *__pyx_k_tuple_14;
static PyObject *__pyx_k_tuple_15;
static PyObject *__pyx_k_tuple_16;
static PyObject *__pyx_k_tuple_20;
static PyObject *__pyx_k_tuple_34;
static PyObject *__pyx_k_tuple_42;
static PyObject *__pyx_k_tuple_44;
static PyObject *__pyx_k_tuple_46;
static PyObject *__pyx_k_tuple_48;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_52;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_56;
static PyObject *__pyx_k_tuple_58;
static PyObject *__pyx_k_tuple_60;
static PyObject *__pyx_k_tuple_62;
static PyObject *__pyx_k_tuple_64;
static PyObject *__pyx_k_tuple_66;
static PyObject *__pyx_k_tuple_68;
static PyObject *__pyx_k_tuple_70;
static PyObject *__pyx_k_tuple_72;
static PyObject *__pyx_k_tuple_74;
static PyObject *__pyx_k_tuple_76;
static PyObject *__pyx_k_tuple_78;
static PyObject *__pyx_k_tuple_80;
static PyObject *__pyx_k_tuple_82;
static PyObject *__pyx_k_tuple_84;
static PyObject *__pyx_k_tuple_86;
static PyObject *__pyx_k_tuple_88;
static PyObject *__pyx_k_tuple_90;
static PyObject *__pyx_k_tuple_92;
static PyObject *__pyx_k_tuple_94;
static PyObject *__pyx_k_tuple_96;
static PyObject *__pyx_k_tuple_98;
static PyObject *__pyx_k_tuple_100;
static PyObject *__pyx_k_tuple_102;
static PyObject *__pyx_k_tuple_104;
static PyObject *__pyx_k_tuple_106;
static PyObject *__pyx_k_tuple_108;
static PyObject *__pyx_k_tuple_110;
static PyObject *__pyx_k_tuple_112;
static PyObject *__pyx_k_tuple_114;
static PyObject *__pyx_k_tuple_116;
static PyObject *__pyx_k_tuple_118;
static PyObject *__pyx_k_tuple_120;
static PyObject *__pyx_k_tuple_122;
static PyObject *__pyx_k_tuple_124;
static PyObject *__pyx_k_tuple_126;
static PyObject *__pyx_k_tuple_128;
static PyObject *__pyx_k_tuple_129;
static PyObject *__pyx_k_tuple_132;
static PyObject *__pyx_k_codeobj_130;
static PyObject *__pyx_k_codeobj_133;

/* Python wrapper */
static PyObject *__pyx_pw_8vcfutils_1outputSingleLineOfVCF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8vcfutils_outputSingleLineOfVCF[] = "\n    ";
static PyMethodDef __pyx_mdef_8vcfutils_1outputSingleLineOfVCF = {__Pyx_NAMESTR("outputSingleLineOfVCF"), (PyCFunction)__pyx_pw_8vcfutils_1outputSingleLineOfVCF, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8vcfutils_outputSingleLineOfVCF)};
static PyObject *__pyx_pw_8vcfutils_1outputSingleLineOfVCF(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_outputFile = 0;
  PyObject *__pyx_v_vcfFile = 0;
  CYTHON_UNUSED PyObject *__pyx_v_options = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("outputSingleLineOfVCF (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__outputFile,&__pyx_n_s__vcfFile,&__pyx_n_s__options,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__data)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__outputFile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outputSingleLineOfVCF", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vcfFile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outputSingleLineOfVCF", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__options)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("outputSingleLineOfVCF", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "outputSingleLineOfVCF") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __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_data = ((PyObject*)values[0]);
    __pyx_v_outputFile = values[1];
    __pyx_v_vcfFile = values[2];
    __pyx_v_options = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("outputSingleLineOfVCF", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("vcfutils.outputSingleLineOfVCF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyDict_Type), 1, "data", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_8vcfutils_outputSingleLineOfVCF(__pyx_self, __pyx_v_data, __pyx_v_outputFile, __pyx_v_vcfFile, __pyx_v_options);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":127
 * ###################################################################################################
 * 
 * def outputSingleLineOfVCF(dict data, object outputFile, object vcfFile, options):             # <<<<<<<<<<<<<<
 *     """
 *     """
 */

static PyObject *__pyx_pf_8vcfutils_outputSingleLineOfVCF(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_outputFile, PyObject *__pyx_v_vcfFile, CYTHON_UNUSED PyObject *__pyx_v_options) {
  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("outputSingleLineOfVCF", 0);

  /* "vcfutils.pyx":133
 *     # Write variant call info to VCF file.
 * 
 *     vcfFile.write_data(outputFile, data)             # <<<<<<<<<<<<<<
 * 
 *     #theChrom = data['chrom']
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vcfFile, __pyx_n_s__write_data); 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_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_outputFile);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_outputFile);
  __Pyx_GIVEREF(__pyx_v_outputFile);
  __Pyx_INCREF(((PyObject *)__pyx_v_data));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_data));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  __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("vcfutils.outputSingleLineOfVCF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":147
 * ###################################################################################################
 * 
 * cdef int testGenotype(Variant var, int hapIsRefAtVarPos, set varsInHap):             # <<<<<<<<<<<<<<
 * 
 *     if var is None:
 */

static int __pyx_f_8vcfutils_testGenotype(struct __pyx_obj_7variant_Variant *__pyx_v_var, int __pyx_v_hapIsRefAtVarPos, PyObject *__pyx_v_varsInHap) {
  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_RefNannySetupContext("testGenotype", 0);

  /* "vcfutils.pyx":149
 * cdef int testGenotype(Variant var, int hapIsRefAtVarPos, set varsInHap):
 * 
 *     if var is None:             # <<<<<<<<<<<<<<
 * 
 *         if hapIsRefAtVarPos:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_var) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "vcfutils.pyx":151
 *     if var is None:
 * 
 *         if hapIsRefAtVarPos:             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
    __pyx_t_2 = (__pyx_v_hapIsRefAtVarPos != 0);
    if (__pyx_t_2) {

      /* "vcfutils.pyx":152
 * 
 *         if hapIsRefAtVarPos:
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
      __pyx_r = 1;
      goto __pyx_L0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "vcfutils.pyx":154
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 *     else:
 *         if var in varsInHap:
 */
      __pyx_r = 0;
      goto __pyx_L0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "vcfutils.pyx":156
 *             return False
 *     else:
 *         if var in varsInHap:             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
    __pyx_t_2 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_var), ((PyObject *)__pyx_v_varsInHap), Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "vcfutils.pyx":157
 *     else:
 *         if var in varsInHap:
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
      __pyx_r = 1;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "vcfutils.pyx":159
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
      __pyx_r = 0;
      goto __pyx_L0;
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("vcfutils.testGenotype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":163
 * ###################################################################################################
 * 
 * cdef tuple computeGenotypeCallAndLikelihoods(int variantPosition, list haplotypes, list genotypes, int sampleIndex, double* haplotypeFrequencies, double** genotypeLikelihoods, double** gofValues, int** haplotypeIndexes, int** varInHap, list variantsThisPos, int* haplotypeIsRefAtThisPos, int nIndividuals, thisSample):             # <<<<<<<<<<<<<<
 *     """
 *     """
 */

static PyObject *__pyx_f_8vcfutils_computeGenotypeCallAndLikelihoods(CYTHON_UNUSED int __pyx_v_variantPosition, PyObject *__pyx_v_haplotypes, PyObject *__pyx_v_genotypes, int __pyx_v_sampleIndex, double *__pyx_v_haplotypeFrequencies, double **__pyx_v_genotypeLikelihoods, double **__pyx_v_gofValues, int **__pyx_v_haplotypeIndexes, int **__pyx_v_varInHap, PyObject *__pyx_v_variantsThisPos, int *__pyx_v_haplotypeIsRefAtThisPos, int __pyx_v_nIndividuals, CYTHON_UNUSED PyObject *__pyx_v_thisSample) {
  double __pyx_v_marginalGenotypeLikelihood;
  double __pyx_v_currentLikelihood;
  double __pyx_v_sumLikelihoods;
  double __pyx_v_factor;
  double __pyx_v_bestGoodnessOfFitValue;
  double __pyx_v_haplotypeFrequency1;
  double __pyx_v_haplotypeFrequency2;
  double __pyx_v_bestLikelihood;
  double __pyx_v_nonRefPosterior;
  double __pyx_v_refPosterior;
  CYTHON_UNUSED int __pyx_v_bestVarIndex1;
  CYTHON_UNUSED int __pyx_v_bestVarIndex2;
  int __pyx_v_index1;
  int __pyx_v_index2;
  int __pyx_v_genotypeIndex;
  int __pyx_v_hap1Index;
  int __pyx_v_hap2Index;
  int __pyx_v_hap1IsRefAtVarPos;
  int __pyx_v_hap2IsRefAtVarPos;
  CYTHON_UNUSED struct __pyx_obj_9cgenotype_DiploidGenotype *__pyx_v_genotype = 0;
  CYTHON_UNUSED struct __pyx_obj_7variant_Variant *__pyx_v_variant = 0;
  CYTHON_UNUSED struct __pyx_obj_10chaplotype_Haplotype *__pyx_v_hap2 = 0;
  PyObject *__pyx_v_likelihoods = 0;
  int __pyx_v_matchingGenotype;
  int __pyx_v_var1InHap1;
  int __pyx_v_var1InHap2;
  int __pyx_v_var2InHap1;
  int __pyx_v_var2InHap2;
  int __pyx_v_nVariants;
  int __pyx_v_nGenotypes;
  CYTHON_UNUSED int __pyx_v_nHaplotypes;
  int __pyx_v_phasedIndex1;
  int __pyx_v_phasedIndex2;
  double __pyx_v_phasedMaxLike;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  long __pyx_t_3;
  int __pyx_t_4;
  long __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  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;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("computeGenotypeCallAndLikelihoods", 0);

  /* "vcfutils.pyx":170
 *     # in VCF.
 * 
 *     cdef double marginalGenotypeLikelihood = 0.0             # <<<<<<<<<<<<<<
 *     cdef double currentLikelihood = 0.0
 *     cdef double sumLikelihoods = 0.0
 */
  __pyx_v_marginalGenotypeLikelihood = 0.0;

  /* "vcfutils.pyx":171
 * 
 *     cdef double marginalGenotypeLikelihood = 0.0
 *     cdef double currentLikelihood = 0.0             # <<<<<<<<<<<<<<
 *     cdef double sumLikelihoods = 0.0
 *     cdef double factor = 0.0
 */
  __pyx_v_currentLikelihood = 0.0;

  /* "vcfutils.pyx":172
 *     cdef double marginalGenotypeLikelihood = 0.0
 *     cdef double currentLikelihood = 0.0
 *     cdef double sumLikelihoods = 0.0             # <<<<<<<<<<<<<<
 *     cdef double factor = 0.0
 *     cdef double bestGoodnessOfFitValue = 1e6
 */
  __pyx_v_sumLikelihoods = 0.0;

  /* "vcfutils.pyx":173
 *     cdef double currentLikelihood = 0.0
 *     cdef double sumLikelihoods = 0.0
 *     cdef double factor = 0.0             # <<<<<<<<<<<<<<
 *     cdef double bestGoodnessOfFitValue = 1e6
 *     cdef double haplotypeFrequency1 = 1.0 # Leave as 1.0 until we fix the EM calculations
 */
  __pyx_v_factor = 0.0;

  /* "vcfutils.pyx":174
 *     cdef double sumLikelihoods = 0.0
 *     cdef double factor = 0.0
 *     cdef double bestGoodnessOfFitValue = 1e6             # <<<<<<<<<<<<<<
 *     cdef double haplotypeFrequency1 = 1.0 # Leave as 1.0 until we fix the EM calculations
 *     cdef double haplotypeFrequency2 = 1.0 # Leave as 1.0 until we fix the EM calculations
 */
  __pyx_v_bestGoodnessOfFitValue = 1e6;

  /* "vcfutils.pyx":175
 *     cdef double factor = 0.0
 *     cdef double bestGoodnessOfFitValue = 1e6
 *     cdef double haplotypeFrequency1 = 1.0 # Leave as 1.0 until we fix the EM calculations             # <<<<<<<<<<<<<<
 *     cdef double haplotypeFrequency2 = 1.0 # Leave as 1.0 until we fix the EM calculations
 *     cdef double bestLikelihood = -1.0
 */
  __pyx_v_haplotypeFrequency1 = 1.0;

  /* "vcfutils.pyx":176
 *     cdef double bestGoodnessOfFitValue = 1e6
 *     cdef double haplotypeFrequency1 = 1.0 # Leave as 1.0 until we fix the EM calculations
 *     cdef double haplotypeFrequency2 = 1.0 # Leave as 1.0 until we fix the EM calculations             # <<<<<<<<<<<<<<
 *     cdef double bestLikelihood = -1.0
 *     cdef double nonRefPosterior = 0.0 # Sum of 1/0 and 1/1 posteriors for bi-allelic sites
 */
  __pyx_v_haplotypeFrequency2 = 1.0;

  /* "vcfutils.pyx":177
 *     cdef double haplotypeFrequency1 = 1.0 # Leave as 1.0 until we fix the EM calculations
 *     cdef double haplotypeFrequency2 = 1.0 # Leave as 1.0 until we fix the EM calculations
 *     cdef double bestLikelihood = -1.0             # <<<<<<<<<<<<<<
 *     cdef double nonRefPosterior = 0.0 # Sum of 1/0 and 1/1 posteriors for bi-allelic sites
 *     cdef double refPosterior = 0.0 # 0/0 posterior for bi-allelic sites
 */
  __pyx_v_bestLikelihood = -1.0;

  /* "vcfutils.pyx":178
 *     cdef double haplotypeFrequency2 = 1.0 # Leave as 1.0 until we fix the EM calculations
 *     cdef double bestLikelihood = -1.0
 *     cdef double nonRefPosterior = 0.0 # Sum of 1/0 and 1/1 posteriors for bi-allelic sites             # <<<<<<<<<<<<<<
 *     cdef double refPosterior = 0.0 # 0/0 posterior for bi-allelic sites
 *     cdef int bestVarIndex1 = -1
 */
  __pyx_v_nonRefPosterior = 0.0;

  /* "vcfutils.pyx":179
 *     cdef double bestLikelihood = -1.0
 *     cdef double nonRefPosterior = 0.0 # Sum of 1/0 and 1/1 posteriors for bi-allelic sites
 *     cdef double refPosterior = 0.0 # 0/0 posterior for bi-allelic sites             # <<<<<<<<<<<<<<
 *     cdef int bestVarIndex1 = -1
 *     cdef int bestVarIndex2 = -1
 */
  __pyx_v_refPosterior = 0.0;

  /* "vcfutils.pyx":180
 *     cdef double nonRefPosterior = 0.0 # Sum of 1/0 and 1/1 posteriors for bi-allelic sites
 *     cdef double refPosterior = 0.0 # 0/0 posterior for bi-allelic sites
 *     cdef int bestVarIndex1 = -1             # <<<<<<<<<<<<<<
 *     cdef int bestVarIndex2 = -1
 *     cdef int index1,index2,genotypeIndex,hap1Index,hap2Index = -1
 */
  __pyx_v_bestVarIndex1 = -1;

  /* "vcfutils.pyx":181
 *     cdef double refPosterior = 0.0 # 0/0 posterior for bi-allelic sites
 *     cdef int bestVarIndex1 = -1
 *     cdef int bestVarIndex2 = -1             # <<<<<<<<<<<<<<
 *     cdef int index1,index2,genotypeIndex,hap1Index,hap2Index = -1
 *     cdef int hap1IsRefAtVarPos = -1
 */
  __pyx_v_bestVarIndex2 = -1;

  /* "vcfutils.pyx":182
 *     cdef int bestVarIndex1 = -1
 *     cdef int bestVarIndex2 = -1
 *     cdef int index1,index2,genotypeIndex,hap1Index,hap2Index = -1             # <<<<<<<<<<<<<<
 *     cdef int hap1IsRefAtVarPos = -1
 *     cdef int hap2IsRefAtVarPos = -1
 */
  __pyx_v_hap2Index = -1;

  /* "vcfutils.pyx":183
 *     cdef int bestVarIndex2 = -1
 *     cdef int index1,index2,genotypeIndex,hap1Index,hap2Index = -1
 *     cdef int hap1IsRefAtVarPos = -1             # <<<<<<<<<<<<<<
 *     cdef int hap2IsRefAtVarPos = -1
 * 
 */
  __pyx_v_hap1IsRefAtVarPos = -1;

  /* "vcfutils.pyx":184
 *     cdef int index1,index2,genotypeIndex,hap1Index,hap2Index = -1
 *     cdef int hap1IsRefAtVarPos = -1
 *     cdef int hap2IsRefAtVarPos = -1             # <<<<<<<<<<<<<<
 * 
 *     cdef DiploidGenotype genotype = None
 */
  __pyx_v_hap2IsRefAtVarPos = -1;

  /* "vcfutils.pyx":186
 *     cdef int hap2IsRefAtVarPos = -1
 * 
 *     cdef DiploidGenotype genotype = None             # <<<<<<<<<<<<<<
 *     cdef Variant var1,var2,variant = None
 *     cdef Haplotype haplotype,hap1,hap2 = None
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_genotype = ((struct __pyx_obj_9cgenotype_DiploidGenotype *)Py_None);

  /* "vcfutils.pyx":187
 * 
 *     cdef DiploidGenotype genotype = None
 *     cdef Variant var1,var2,variant = None             # <<<<<<<<<<<<<<
 *     cdef Haplotype haplotype,hap1,hap2 = None
 *     cdef list likelihoods = []
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_variant = ((struct __pyx_obj_7variant_Variant *)Py_None);

  /* "vcfutils.pyx":188
 *     cdef DiploidGenotype genotype = None
 *     cdef Variant var1,var2,variant = None
 *     cdef Haplotype haplotype,hap1,hap2 = None             # <<<<<<<<<<<<<<
 *     cdef list likelihoods = []
 *     cdef set varsHap1
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_hap2 = ((struct __pyx_obj_10chaplotype_Haplotype *)Py_None);

  /* "vcfutils.pyx":189
 *     cdef Variant var1,var2,variant = None
 *     cdef Haplotype haplotype,hap1,hap2 = None
 *     cdef list likelihoods = []             # <<<<<<<<<<<<<<
 *     cdef set varsHap1
 *     cdef set varsHap2
 */
  __pyx_t_1 = PyList_New(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_v_likelihoods = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":193
 *     cdef set varsHap2
 * 
 *     cdef bint matchingGenotype = False             # <<<<<<<<<<<<<<
 *     cdef bint var1InHap1 = False
 *     cdef bint var1InHap2 = False
 */
  __pyx_v_matchingGenotype = 0;

  /* "vcfutils.pyx":194
 * 
 *     cdef bint matchingGenotype = False
 *     cdef bint var1InHap1 = False             # <<<<<<<<<<<<<<
 *     cdef bint var1InHap2 = False
 *     cdef bint var2InHap1 = False
 */
  __pyx_v_var1InHap1 = 0;

  /* "vcfutils.pyx":195
 *     cdef bint matchingGenotype = False
 *     cdef bint var1InHap1 = False
 *     cdef bint var1InHap2 = False             # <<<<<<<<<<<<<<
 *     cdef bint var2InHap1 = False
 *     cdef bint var2InHap2 = False
 */
  __pyx_v_var1InHap2 = 0;

  /* "vcfutils.pyx":196
 *     cdef bint var1InHap1 = False
 *     cdef bint var1InHap2 = False
 *     cdef bint var2InHap1 = False             # <<<<<<<<<<<<<<
 *     cdef bint var2InHap2 = False
 * 
 */
  __pyx_v_var2InHap1 = 0;

  /* "vcfutils.pyx":197
 *     cdef bint var1InHap2 = False
 *     cdef bint var2InHap1 = False
 *     cdef bint var2InHap2 = False             # <<<<<<<<<<<<<<
 * 
 *     cdef int nVariants = len(variantsThisPos)
 */
  __pyx_v_var2InHap2 = 0;

  /* "vcfutils.pyx":199
 *     cdef bint var2InHap2 = False
 * 
 *     cdef int nVariants = len(variantsThisPos)             # <<<<<<<<<<<<<<
 *     cdef int nGenotypes = len(genotypes)
 *     cdef int nHaplotypes = len(haplotypes)
 */
  if (unlikely(((PyObject *)__pyx_v_variantsThisPos) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_variantsThisPos)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nVariants = __pyx_t_2;

  /* "vcfutils.pyx":200
 * 
 *     cdef int nVariants = len(variantsThisPos)
 *     cdef int nGenotypes = len(genotypes)             # <<<<<<<<<<<<<<
 *     cdef int nHaplotypes = len(haplotypes)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_genotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_genotypes)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nGenotypes = __pyx_t_2;

  /* "vcfutils.pyx":201
 *     cdef int nVariants = len(variantsThisPos)
 *     cdef int nGenotypes = len(genotypes)
 *     cdef int nHaplotypes = len(haplotypes)             # <<<<<<<<<<<<<<
 * 
 *     cdef int phasedIndex1 = -1
 */
  if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_haplotypes)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nHaplotypes = __pyx_t_2;

  /* "vcfutils.pyx":203
 *     cdef int nHaplotypes = len(haplotypes)
 * 
 *     cdef int phasedIndex1 = -1             # <<<<<<<<<<<<<<
 *     cdef int phasedIndex2 = -1
 *     cdef double phasedMaxLike = -1e6
 */
  __pyx_v_phasedIndex1 = -1;

  /* "vcfutils.pyx":204
 * 
 *     cdef int phasedIndex1 = -1
 *     cdef int phasedIndex2 = -1             # <<<<<<<<<<<<<<
 *     cdef double phasedMaxLike = -1e6
 * 
 */
  __pyx_v_phasedIndex2 = -1;

  /* "vcfutils.pyx":205
 *     cdef int phasedIndex1 = -1
 *     cdef int phasedIndex2 = -1
 *     cdef double phasedMaxLike = -1e6             # <<<<<<<<<<<<<<
 * 
 *     for index1 in range(nVariants + 1):
 */
  __pyx_v_phasedMaxLike = -1e6;

  /* "vcfutils.pyx":207
 *     cdef double phasedMaxLike = -1e6
 * 
 *     for index1 in range(nVariants + 1):             # <<<<<<<<<<<<<<
 *         for index2 in range(nVariants + 1):
 * 
 */
  __pyx_t_3 = (__pyx_v_nVariants + 1);
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_index1 = __pyx_t_4;

    /* "vcfutils.pyx":208
 * 
 *     for index1 in range(nVariants + 1):
 *         for index2 in range(nVariants + 1):             # <<<<<<<<<<<<<<
 * 
 *             if index2 > index1:
 */
    __pyx_t_5 = (__pyx_v_nVariants + 1);
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_index2 = __pyx_t_6;

      /* "vcfutils.pyx":210
 *         for index2 in range(nVariants + 1):
 * 
 *             if index2 > index1:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_7 = ((__pyx_v_index2 > __pyx_v_index1) != 0);
      if (__pyx_t_7) {

        /* "vcfutils.pyx":211
 * 
 *             if index2 > index1:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             marginalGenotypeLikelihood = 0.0
 */
        goto __pyx_L6_break;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "vcfutils.pyx":213
 *                 break
 * 
 *             marginalGenotypeLikelihood = 0.0             # <<<<<<<<<<<<<<
 * 
 *             for genotypeIndex in range(nGenotypes):
 */
      __pyx_v_marginalGenotypeLikelihood = 0.0;

      /* "vcfutils.pyx":215
 *             marginalGenotypeLikelihood = 0.0
 * 
 *             for genotypeIndex in range(nGenotypes):             # <<<<<<<<<<<<<<
 * 
 *                 # Use pre-cached haplotype indices
 */
      __pyx_t_8 = __pyx_v_nGenotypes;
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
        __pyx_v_genotypeIndex = __pyx_t_9;

        /* "vcfutils.pyx":218
 * 
 *                 # Use pre-cached haplotype indices
 *                 hap1Index = haplotypeIndexes[genotypeIndex][0]             # <<<<<<<<<<<<<<
 *                 hap2Index = haplotypeIndexes[genotypeIndex][1]
 *                 hap1IsRefAtVarPos = haplotypeIsRefAtThisPos[hap1Index]
 */
        __pyx_v_hap1Index = ((__pyx_v_haplotypeIndexes[__pyx_v_genotypeIndex])[0]);

        /* "vcfutils.pyx":219
 *                 # Use pre-cached haplotype indices
 *                 hap1Index = haplotypeIndexes[genotypeIndex][0]
 *                 hap2Index = haplotypeIndexes[genotypeIndex][1]             # <<<<<<<<<<<<<<
 *                 hap1IsRefAtVarPos = haplotypeIsRefAtThisPos[hap1Index]
 *                 hap2IsRefAtVarPos = haplotypeIsRefAtThisPos[hap2Index]
 */
        __pyx_v_hap2Index = ((__pyx_v_haplotypeIndexes[__pyx_v_genotypeIndex])[1]);

        /* "vcfutils.pyx":220
 *                 hap1Index = haplotypeIndexes[genotypeIndex][0]
 *                 hap2Index = haplotypeIndexes[genotypeIndex][1]
 *                 hap1IsRefAtVarPos = haplotypeIsRefAtThisPos[hap1Index]             # <<<<<<<<<<<<<<
 *                 hap2IsRefAtVarPos = haplotypeIsRefAtThisPos[hap2Index]
 * 
 */
        __pyx_v_hap1IsRefAtVarPos = (__pyx_v_haplotypeIsRefAtThisPos[__pyx_v_hap1Index]);

        /* "vcfutils.pyx":221
 *                 hap2Index = haplotypeIndexes[genotypeIndex][1]
 *                 hap1IsRefAtVarPos = haplotypeIsRefAtThisPos[hap1Index]
 *                 hap2IsRefAtVarPos = haplotypeIsRefAtThisPos[hap2Index]             # <<<<<<<<<<<<<<
 * 
 *                 if hap1Index != hap2Index:
 */
        __pyx_v_hap2IsRefAtVarPos = (__pyx_v_haplotypeIsRefAtThisPos[__pyx_v_hap2Index]);

        /* "vcfutils.pyx":223
 *                 hap2IsRefAtVarPos = haplotypeIsRefAtThisPos[hap2Index]
 * 
 *                 if hap1Index != hap2Index:             # <<<<<<<<<<<<<<
 *                     factor = 2.0
 *                 else:
 */
        __pyx_t_7 = ((__pyx_v_hap1Index != __pyx_v_hap2Index) != 0);
        if (__pyx_t_7) {

          /* "vcfutils.pyx":224
 * 
 *                 if hap1Index != hap2Index:
 *                     factor = 2.0             # <<<<<<<<<<<<<<
 *                 else:
 *                     factor = 1.0
 */
          __pyx_v_factor = 2.0;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "vcfutils.pyx":226
 *                     factor = 2.0
 *                 else:
 *                     factor = 1.0             # <<<<<<<<<<<<<<
 * 
 *                 # Use EM frequencies
 */
          __pyx_v_factor = 1.0;
        }
        __pyx_L10:;

        /* "vcfutils.pyx":229
 * 
 *                 # Use EM frequencies
 *                 haplotypeFrequency1 = haplotypeFrequencies[hap1Index]             # <<<<<<<<<<<<<<
 *                 haplotypeFrequency2 = haplotypeFrequencies[hap2Index]
 * 
 */
        __pyx_v_haplotypeFrequency1 = (__pyx_v_haplotypeFrequencies[__pyx_v_hap1Index]);

        /* "vcfutils.pyx":230
 *                 # Use EM frequencies
 *                 haplotypeFrequency1 = haplotypeFrequencies[hap1Index]
 *                 haplotypeFrequency2 = haplotypeFrequencies[hap2Index]             # <<<<<<<<<<<<<<
 * 
 *                 matchingGenotype = False
 */
        __pyx_v_haplotypeFrequency2 = (__pyx_v_haplotypeFrequencies[__pyx_v_hap2Index]);

        /* "vcfutils.pyx":232
 *                 haplotypeFrequency2 = haplotypeFrequencies[hap2Index]
 * 
 *                 matchingGenotype = False             # <<<<<<<<<<<<<<
 * 
 *                 # Ref/Ref genotype
 */
        __pyx_v_matchingGenotype = 0;

        /* "vcfutils.pyx":235
 * 
 *                 # Ref/Ref genotype
 *                 if index1 == 0 and index2 == 0:             # <<<<<<<<<<<<<<
 *                     if (hap1IsRefAtVarPos and hap2IsRefAtVarPos):
 *                         #logger.debug("hom ref genotype = %s. Pos = %s." %(genotypes[genotypeIndex], variantPosition))
 */
        __pyx_t_7 = ((__pyx_v_index1 == 0) != 0);
        if (__pyx_t_7) {
          __pyx_t_10 = ((__pyx_v_index2 == 0) != 0);
          __pyx_t_11 = __pyx_t_10;
        } else {
          __pyx_t_11 = __pyx_t_7;
        }
        if (__pyx_t_11) {

          /* "vcfutils.pyx":236
 *                 # Ref/Ref genotype
 *                 if index1 == 0 and index2 == 0:
 *                     if (hap1IsRefAtVarPos and hap2IsRefAtVarPos):             # <<<<<<<<<<<<<<
 *                         #logger.debug("hom ref genotype = %s. Pos = %s." %(genotypes[genotypeIndex], variantPosition))
 *                         matchingGenotype = True
 */
          if ((__pyx_v_hap1IsRefAtVarPos != 0)) {
            __pyx_t_11 = (__pyx_v_hap2IsRefAtVarPos != 0);
          } else {
            __pyx_t_11 = (__pyx_v_hap1IsRefAtVarPos != 0);
          }
          if (__pyx_t_11) {

            /* "vcfutils.pyx":238
 *                     if (hap1IsRefAtVarPos and hap2IsRefAtVarPos):
 *                         #logger.debug("hom ref genotype = %s. Pos = %s." %(genotypes[genotypeIndex], variantPosition))
 *                         matchingGenotype = True             # <<<<<<<<<<<<<<
 * 
 *                 # Het genotype (always 1/0, 2/0 etc)
 */
            __pyx_v_matchingGenotype = 1;
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }

        /* "vcfutils.pyx":241
 * 
 *                 # Het genotype (always 1/0, 2/0 etc)
 *                 elif index2 == 0:             # <<<<<<<<<<<<<<
 * 
 *                     var1InHap1 = varInHap[hap1Index][index1-1]
 */
        __pyx_t_11 = ((__pyx_v_index2 == 0) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":243
 *                 elif index2 == 0:
 * 
 *                     var1InHap1 = varInHap[hap1Index][index1-1]             # <<<<<<<<<<<<<<
 *                     var1InHap2 = varInHap[hap2Index][index1-1]
 * 
 */
          __pyx_v_var1InHap1 = ((__pyx_v_varInHap[__pyx_v_hap1Index])[(__pyx_v_index1 - 1)]);

          /* "vcfutils.pyx":244
 * 
 *                     var1InHap1 = varInHap[hap1Index][index1-1]
 *                     var1InHap2 = varInHap[hap2Index][index1-1]             # <<<<<<<<<<<<<<
 * 
 *                     if (hap2IsRefAtVarPos and var1InHap1) or (hap1IsRefAtVarPos and var1InHap2):
 */
          __pyx_v_var1InHap2 = ((__pyx_v_varInHap[__pyx_v_hap2Index])[(__pyx_v_index1 - 1)]);

          /* "vcfutils.pyx":246
 *                     var1InHap2 = varInHap[hap2Index][index1-1]
 * 
 *                     if (hap2IsRefAtVarPos and var1InHap1) or (hap1IsRefAtVarPos and var1InHap2):             # <<<<<<<<<<<<<<
 *                         #logger.debug("het ref genotype = %s. Pos = %s." %(genotypes[genotypeIndex], variantPosition))
 *                         matchingGenotype = True
 */
          if ((__pyx_v_hap2IsRefAtVarPos != 0)) {
            __pyx_t_11 = __pyx_v_var1InHap1;
            __pyx_t_7 = __pyx_t_11;
          } else {
            __pyx_t_7 = (__pyx_v_hap2IsRefAtVarPos != 0);
          }
          if (!__pyx_t_7) {
            if ((__pyx_v_hap1IsRefAtVarPos != 0)) {
              __pyx_t_11 = __pyx_v_var1InHap2;
              __pyx_t_10 = __pyx_t_11;
            } else {
              __pyx_t_10 = (__pyx_v_hap1IsRefAtVarPos != 0);
            }
            __pyx_t_11 = __pyx_t_10;
          } else {
            __pyx_t_11 = __pyx_t_7;
          }
          if (__pyx_t_11) {

            /* "vcfutils.pyx":248
 *                     if (hap2IsRefAtVarPos and var1InHap1) or (hap1IsRefAtVarPos and var1InHap2):
 *                         #logger.debug("het ref genotype = %s. Pos = %s." %(genotypes[genotypeIndex], variantPosition))
 *                         matchingGenotype = True             # <<<<<<<<<<<<<<
 * 
 *                 # Both alleles are non-ref
 */
            __pyx_v_matchingGenotype = 1;
            goto __pyx_L13;
          }
          __pyx_L13:;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "vcfutils.pyx":252
 *                 # Both alleles are non-ref
 *                 else:
 *                     var1InHap1 = varInHap[hap1Index][index1-1]             # <<<<<<<<<<<<<<
 *                     var1InHap2 = varInHap[hap2Index][index1-1]
 *                     var2InHap1 = varInHap[hap1Index][index2-1]
 */
          __pyx_v_var1InHap1 = ((__pyx_v_varInHap[__pyx_v_hap1Index])[(__pyx_v_index1 - 1)]);

          /* "vcfutils.pyx":253
 *                 else:
 *                     var1InHap1 = varInHap[hap1Index][index1-1]
 *                     var1InHap2 = varInHap[hap2Index][index1-1]             # <<<<<<<<<<<<<<
 *                     var2InHap1 = varInHap[hap1Index][index2-1]
 *                     var2InHap2 = varInHap[hap2Index][index2-1]
 */
          __pyx_v_var1InHap2 = ((__pyx_v_varInHap[__pyx_v_hap2Index])[(__pyx_v_index1 - 1)]);

          /* "vcfutils.pyx":254
 *                     var1InHap1 = varInHap[hap1Index][index1-1]
 *                     var1InHap2 = varInHap[hap2Index][index1-1]
 *                     var2InHap1 = varInHap[hap1Index][index2-1]             # <<<<<<<<<<<<<<
 *                     var2InHap2 = varInHap[hap2Index][index2-1]
 * 
 */
          __pyx_v_var2InHap1 = ((__pyx_v_varInHap[__pyx_v_hap1Index])[(__pyx_v_index2 - 1)]);

          /* "vcfutils.pyx":255
 *                     var1InHap2 = varInHap[hap2Index][index1-1]
 *                     var2InHap1 = varInHap[hap1Index][index2-1]
 *                     var2InHap2 = varInHap[hap2Index][index2-1]             # <<<<<<<<<<<<<<
 * 
 *                     if (var1InHap1 and var2InHap2) or (var2InHap1 and var1InHap2):
 */
          __pyx_v_var2InHap2 = ((__pyx_v_varInHap[__pyx_v_hap2Index])[(__pyx_v_index2 - 1)]);

          /* "vcfutils.pyx":257
 *                     var2InHap2 = varInHap[hap2Index][index2-1]
 * 
 *                     if (var1InHap1 and var2InHap2) or (var2InHap1 and var1InHap2):             # <<<<<<<<<<<<<<
 *                         #logger.debug("hom var genotype = %s. Pos = %s." %(genotypes[genotypeIndex], variantPosition))
 *                         matchingGenotype = True
 */
          if ((__pyx_v_var1InHap1 != 0)) {
            __pyx_t_11 = (__pyx_v_var2InHap2 != 0);
          } else {
            __pyx_t_11 = (__pyx_v_var1InHap1 != 0);
          }
          if (!__pyx_t_11) {
            if ((__pyx_v_var2InHap1 != 0)) {
              __pyx_t_7 = (__pyx_v_var1InHap2 != 0);
            } else {
              __pyx_t_7 = (__pyx_v_var2InHap1 != 0);
            }
            __pyx_t_10 = __pyx_t_7;
          } else {
            __pyx_t_10 = __pyx_t_11;
          }
          if (__pyx_t_10) {

            /* "vcfutils.pyx":259
 *                     if (var1InHap1 and var2InHap2) or (var2InHap1 and var1InHap2):
 *                         #logger.debug("hom var genotype = %s. Pos = %s." %(genotypes[genotypeIndex], variantPosition))
 *                         matchingGenotype = True             # <<<<<<<<<<<<<<
 * 
 *                 # Accumulate likelihoods for matching genotypes
 */
            __pyx_v_matchingGenotype = 1;
            goto __pyx_L14;
          }
          __pyx_L14:;
        }
        __pyx_L11:;

        /* "vcfutils.pyx":262
 * 
 *                 # Accumulate likelihoods for matching genotypes
 *                 if matchingGenotype:             # <<<<<<<<<<<<<<
 * 
 *                     # TODO: Fix this properly.
 */
        __pyx_t_10 = (__pyx_v_matchingGenotype != 0);
        if (__pyx_t_10) {

          /* "vcfutils.pyx":266
 *                     # TODO: Fix this properly.
 *                     # Only use EM frequencies for large-ish populations.
 *                     if nIndividuals > 25:             # <<<<<<<<<<<<<<
 *                         currentLikelihood = (factor*haplotypeFrequency1*haplotypeFrequency2*genotypeLikelihoods[sampleIndex][genotypeIndex])
 *                     else:
 */
          __pyx_t_10 = ((__pyx_v_nIndividuals > 25) != 0);
          if (__pyx_t_10) {

            /* "vcfutils.pyx":267
 *                     # Only use EM frequencies for large-ish populations.
 *                     if nIndividuals > 25:
 *                         currentLikelihood = (factor*haplotypeFrequency1*haplotypeFrequency2*genotypeLikelihoods[sampleIndex][genotypeIndex])             # <<<<<<<<<<<<<<
 *                     else:
 *                         currentLikelihood = (factor*genotypeLikelihoods[sampleIndex][genotypeIndex])
 */
            __pyx_v_currentLikelihood = (((__pyx_v_factor * __pyx_v_haplotypeFrequency1) * __pyx_v_haplotypeFrequency2) * ((__pyx_v_genotypeLikelihoods[__pyx_v_sampleIndex])[__pyx_v_genotypeIndex]));
            goto __pyx_L16;
          }
          /*else*/ {

            /* "vcfutils.pyx":269
 *                         currentLikelihood = (factor*haplotypeFrequency1*haplotypeFrequency2*genotypeLikelihoods[sampleIndex][genotypeIndex])
 *                     else:
 *                         currentLikelihood = (factor*genotypeLikelihoods[sampleIndex][genotypeIndex])             # <<<<<<<<<<<<<<
 * 
 *                     marginalGenotypeLikelihood += currentLikelihood
 */
            __pyx_v_currentLikelihood = (__pyx_v_factor * ((__pyx_v_genotypeLikelihoods[__pyx_v_sampleIndex])[__pyx_v_genotypeIndex]));
          }
          __pyx_L16:;

          /* "vcfutils.pyx":271
 *                         currentLikelihood = (factor*genotypeLikelihoods[sampleIndex][genotypeIndex])
 * 
 *                     marginalGenotypeLikelihood += currentLikelihood             # <<<<<<<<<<<<<<
 * 
 *                     # Phase using maximum likelihood genotypes
 */
          __pyx_v_marginalGenotypeLikelihood = (__pyx_v_marginalGenotypeLikelihood + __pyx_v_currentLikelihood);

          /* "vcfutils.pyx":274
 * 
 *                     # Phase using maximum likelihood genotypes
 *                     if currentLikelihood > phasedMaxLike:             # <<<<<<<<<<<<<<
 *                         phasedMaxLike = currentLikelihood
 * 
 */
          __pyx_t_10 = ((__pyx_v_currentLikelihood > __pyx_v_phasedMaxLike) != 0);
          if (__pyx_t_10) {

            /* "vcfutils.pyx":275
 *                     # Phase using maximum likelihood genotypes
 *                     if currentLikelihood > phasedMaxLike:
 *                         phasedMaxLike = currentLikelihood             # <<<<<<<<<<<<<<
 * 
 *                         # Hom Ref
 */
            __pyx_v_phasedMaxLike = __pyx_v_currentLikelihood;

            /* "vcfutils.pyx":278
 * 
 *                         # Hom Ref
 *                         if index1 == 0 and index2 == 0:             # <<<<<<<<<<<<<<
 *                             phasedIndex1 = index1
 *                             phasedIndex2 = index2
 */
            __pyx_t_10 = ((__pyx_v_index1 == 0) != 0);
            if (__pyx_t_10) {
              __pyx_t_11 = ((__pyx_v_index2 == 0) != 0);
              __pyx_t_7 = __pyx_t_11;
            } else {
              __pyx_t_7 = __pyx_t_10;
            }
            if (__pyx_t_7) {

              /* "vcfutils.pyx":279
 *                         # Hom Ref
 *                         if index1 == 0 and index2 == 0:
 *                             phasedIndex1 = index1             # <<<<<<<<<<<<<<
 *                             phasedIndex2 = index2
 * 
 */
              __pyx_v_phasedIndex1 = __pyx_v_index1;

              /* "vcfutils.pyx":280
 *                         if index1 == 0 and index2 == 0:
 *                             phasedIndex1 = index1
 *                             phasedIndex2 = index2             # <<<<<<<<<<<<<<
 * 
 *                         # Het. Make sure genotype call is phased correctly.
 */
              __pyx_v_phasedIndex2 = __pyx_v_index2;
              goto __pyx_L18;
            }

            /* "vcfutils.pyx":283
 * 
 *                         # Het. Make sure genotype call is phased correctly.
 *                         elif index2 == 0 and index1 != 0:             # <<<<<<<<<<<<<<
 * 
 *                             if var1InHap1:
 */
            __pyx_t_7 = ((__pyx_v_index2 == 0) != 0);
            if (__pyx_t_7) {
              __pyx_t_10 = ((__pyx_v_index1 != 0) != 0);
              __pyx_t_11 = __pyx_t_10;
            } else {
              __pyx_t_11 = __pyx_t_7;
            }
            if (__pyx_t_11) {

              /* "vcfutils.pyx":285
 *                         elif index2 == 0 and index1 != 0:
 * 
 *                             if var1InHap1:             # <<<<<<<<<<<<<<
 *                                 phasedIndex1 = index1
 *                                 phasedIndex2 = index2
 */
              __pyx_t_11 = (__pyx_v_var1InHap1 != 0);
              if (__pyx_t_11) {

                /* "vcfutils.pyx":286
 * 
 *                             if var1InHap1:
 *                                 phasedIndex1 = index1             # <<<<<<<<<<<<<<
 *                                 phasedIndex2 = index2
 *                             elif var1InHap2:
 */
                __pyx_v_phasedIndex1 = __pyx_v_index1;

                /* "vcfutils.pyx":287
 *                             if var1InHap1:
 *                                 phasedIndex1 = index1
 *                                 phasedIndex2 = index2             # <<<<<<<<<<<<<<
 *                             elif var1InHap2:
 *                                 phasedIndex1 = index2
 */
                __pyx_v_phasedIndex2 = __pyx_v_index2;
                goto __pyx_L19;
              }

              /* "vcfutils.pyx":288
 *                                 phasedIndex1 = index1
 *                                 phasedIndex2 = index2
 *                             elif var1InHap2:             # <<<<<<<<<<<<<<
 *                                 phasedIndex1 = index2
 *                                 phasedIndex2 = index1
 */
              __pyx_t_11 = (__pyx_v_var1InHap2 != 0);
              if (__pyx_t_11) {

                /* "vcfutils.pyx":289
 *                                 phasedIndex2 = index2
 *                             elif var1InHap2:
 *                                 phasedIndex1 = index2             # <<<<<<<<<<<<<<
 *                                 phasedIndex2 = index1
 *                             # This will happen on the way
 */
                __pyx_v_phasedIndex1 = __pyx_v_index2;

                /* "vcfutils.pyx":290
 *                             elif var1InHap2:
 *                                 phasedIndex1 = index2
 *                                 phasedIndex2 = index1             # <<<<<<<<<<<<<<
 *                             # This will happen on the way
 *                             else:
 */
                __pyx_v_phasedIndex2 = __pyx_v_index1;
                goto __pyx_L19;
              }
              /*else*/ {
              }
              __pyx_L19:;
              goto __pyx_L18;
            }

            /* "vcfutils.pyx":296
 * 
 *                         # Hom Var. Don't need to phase
 *                         elif index2 == index1 and index1 > 0:             # <<<<<<<<<<<<<<
 *                             phasedIndex1 = index1
 *                             phasedIndex2 = index2
 */
            __pyx_t_11 = ((__pyx_v_index2 == __pyx_v_index1) != 0);
            if (__pyx_t_11) {
              __pyx_t_7 = ((__pyx_v_index1 > 0) != 0);
              __pyx_t_10 = __pyx_t_7;
            } else {
              __pyx_t_10 = __pyx_t_11;
            }
            if (__pyx_t_10) {

              /* "vcfutils.pyx":297
 *                         # Hom Var. Don't need to phase
 *                         elif index2 == index1 and index1 > 0:
 *                             phasedIndex1 = index1             # <<<<<<<<<<<<<<
 *                             phasedIndex2 = index2
 * 
 */
              __pyx_v_phasedIndex1 = __pyx_v_index1;

              /* "vcfutils.pyx":298
 *                         elif index2 == index1 and index1 > 0:
 *                             phasedIndex1 = index1
 *                             phasedIndex2 = index2             # <<<<<<<<<<<<<<
 * 
 *                         # Multi-allelic het. Make sure call is phased correctly.
 */
              __pyx_v_phasedIndex2 = __pyx_v_index2;
              goto __pyx_L18;
            }

            /* "vcfutils.pyx":301
 * 
 *                         # Multi-allelic het. Make sure call is phased correctly.
 *                         elif index2 > 0 and index1 > 0 and index2 != index1:             # <<<<<<<<<<<<<<
 * 
 *                             if var1InHap1 and var2InHap2:
 */
            __pyx_t_10 = ((__pyx_v_index2 > 0) != 0);
            if (__pyx_t_10) {
              __pyx_t_11 = ((__pyx_v_index1 > 0) != 0);
              if (__pyx_t_11) {
                __pyx_t_7 = ((__pyx_v_index2 != __pyx_v_index1) != 0);
                __pyx_t_12 = __pyx_t_7;
              } else {
                __pyx_t_12 = __pyx_t_11;
              }
              __pyx_t_11 = __pyx_t_12;
            } else {
              __pyx_t_11 = __pyx_t_10;
            }
            if (__pyx_t_11) {

              /* "vcfutils.pyx":303
 *                         elif index2 > 0 and index1 > 0 and index2 != index1:
 * 
 *                             if var1InHap1 and var2InHap2:             # <<<<<<<<<<<<<<
 *                                 phasedIndex1 = index1
 *                                 phasedIndex2 = index2
 */
              if ((__pyx_v_var1InHap1 != 0)) {
                __pyx_t_11 = (__pyx_v_var2InHap2 != 0);
              } else {
                __pyx_t_11 = (__pyx_v_var1InHap1 != 0);
              }
              if (__pyx_t_11) {

                /* "vcfutils.pyx":304
 * 
 *                             if var1InHap1 and var2InHap2:
 *                                 phasedIndex1 = index1             # <<<<<<<<<<<<<<
 *                                 phasedIndex2 = index2
 *                             elif var1InHap2 and var2InHap1:
 */
                __pyx_v_phasedIndex1 = __pyx_v_index1;

                /* "vcfutils.pyx":305
 *                             if var1InHap1 and var2InHap2:
 *                                 phasedIndex1 = index1
 *                                 phasedIndex2 = index2             # <<<<<<<<<<<<<<
 *                             elif var1InHap2 and var2InHap1:
 *                                 phasedIndex1 = index2
 */
                __pyx_v_phasedIndex2 = __pyx_v_index2;
                goto __pyx_L20;
              }

              /* "vcfutils.pyx":306
 *                                 phasedIndex1 = index1
 *                                 phasedIndex2 = index2
 *                             elif var1InHap2 and var2InHap1:             # <<<<<<<<<<<<<<
 *                                 phasedIndex1 = index2
 *                                 phasedIndex2 = index1
 */
              if ((__pyx_v_var1InHap2 != 0)) {
                __pyx_t_11 = (__pyx_v_var2InHap1 != 0);
              } else {
                __pyx_t_11 = (__pyx_v_var1InHap2 != 0);
              }
              if (__pyx_t_11) {

                /* "vcfutils.pyx":307
 *                                 phasedIndex2 = index2
 *                             elif var1InHap2 and var2InHap1:
 *                                 phasedIndex1 = index2             # <<<<<<<<<<<<<<
 *                                 phasedIndex2 = index1
 *                             # This will happen on the way
 */
                __pyx_v_phasedIndex1 = __pyx_v_index2;

                /* "vcfutils.pyx":308
 *                             elif var1InHap2 and var2InHap1:
 *                                 phasedIndex1 = index2
 *                                 phasedIndex2 = index1             # <<<<<<<<<<<<<<
 *                             # This will happen on the way
 *                             else:
 */
                __pyx_v_phasedIndex2 = __pyx_v_index1;
                goto __pyx_L20;
              }
              /*else*/ {
              }
              __pyx_L20:;
              goto __pyx_L18;
            }
            __pyx_L18:;
            goto __pyx_L17;
          }
          __pyx_L17:;

          /* "vcfutils.pyx":313
 *                                 pass
 * 
 *                     if gofValues[genotypeIndex][sampleIndex] < bestGoodnessOfFitValue:             # <<<<<<<<<<<<<<
 *                         bestGoodnessOfFitValue = gofValues[genotypeIndex][sampleIndex]
 * 
 */
          __pyx_t_11 = ((((__pyx_v_gofValues[__pyx_v_genotypeIndex])[__pyx_v_sampleIndex]) < __pyx_v_bestGoodnessOfFitValue) != 0);
          if (__pyx_t_11) {

            /* "vcfutils.pyx":314
 * 
 *                     if gofValues[genotypeIndex][sampleIndex] < bestGoodnessOfFitValue:
 *                         bestGoodnessOfFitValue = gofValues[genotypeIndex][sampleIndex]             # <<<<<<<<<<<<<<
 * 
 *             # Pick the best variant pair for this site
 */
            __pyx_v_bestGoodnessOfFitValue = ((__pyx_v_gofValues[__pyx_v_genotypeIndex])[__pyx_v_sampleIndex]);
            goto __pyx_L21;
          }
          __pyx_L21:;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }

      /* "vcfutils.pyx":317
 * 
 *             # Pick the best variant pair for this site
 *             if marginalGenotypeLikelihood > bestLikelihood:             # <<<<<<<<<<<<<<
 * 
 *                 bestLikelihood = marginalGenotypeLikelihood
 */
      __pyx_t_11 = ((__pyx_v_marginalGenotypeLikelihood > __pyx_v_bestLikelihood) != 0);
      if (__pyx_t_11) {

        /* "vcfutils.pyx":319
 *             if marginalGenotypeLikelihood > bestLikelihood:
 * 
 *                 bestLikelihood = marginalGenotypeLikelihood             # <<<<<<<<<<<<<<
 *                 bestVarIndex1 = index1
 *                 bestVarIndex2 = index2
 */
        __pyx_v_bestLikelihood = __pyx_v_marginalGenotypeLikelihood;

        /* "vcfutils.pyx":320
 * 
 *                 bestLikelihood = marginalGenotypeLikelihood
 *                 bestVarIndex1 = index1             # <<<<<<<<<<<<<<
 *                 bestVarIndex2 = index2
 * 
 */
        __pyx_v_bestVarIndex1 = __pyx_v_index1;

        /* "vcfutils.pyx":321
 *                 bestLikelihood = marginalGenotypeLikelihood
 *                 bestVarIndex1 = index1
 *                 bestVarIndex2 = index2             # <<<<<<<<<<<<<<
 * 
 *             if (index1 == 1 and index2 == 0) or (index1 == 1 and index2 == 1):
 */
        __pyx_v_bestVarIndex2 = __pyx_v_index2;
        goto __pyx_L22;
      }
      __pyx_L22:;

      /* "vcfutils.pyx":323
 *                 bestVarIndex2 = index2
 * 
 *             if (index1 == 1 and index2 == 0) or (index1 == 1 and index2 == 1):             # <<<<<<<<<<<<<<
 *                 nonRefPosterior += marginalGenotypeLikelihood
 *             elif (index1 == 0 and index2 == 0):
 */
      __pyx_t_11 = ((__pyx_v_index1 == 1) != 0);
      if (__pyx_t_11) {
        __pyx_t_10 = ((__pyx_v_index2 == 0) != 0);
        __pyx_t_12 = __pyx_t_10;
      } else {
        __pyx_t_12 = __pyx_t_11;
      }
      if (!__pyx_t_12) {
        __pyx_t_11 = ((__pyx_v_index1 == 1) != 0);
        if (__pyx_t_11) {
          __pyx_t_10 = ((__pyx_v_index2 == 1) != 0);
          __pyx_t_7 = __pyx_t_10;
        } else {
          __pyx_t_7 = __pyx_t_11;
        }
        __pyx_t_11 = __pyx_t_7;
      } else {
        __pyx_t_11 = __pyx_t_12;
      }
      if (__pyx_t_11) {

        /* "vcfutils.pyx":324
 * 
 *             if (index1 == 1 and index2 == 0) or (index1 == 1 and index2 == 1):
 *                 nonRefPosterior += marginalGenotypeLikelihood             # <<<<<<<<<<<<<<
 *             elif (index1 == 0 and index2 == 0):
 *                 refPosterior += marginalGenotypeLikelihood
 */
        __pyx_v_nonRefPosterior = (__pyx_v_nonRefPosterior + __pyx_v_marginalGenotypeLikelihood);
        goto __pyx_L23;
      }

      /* "vcfutils.pyx":325
 *             if (index1 == 1 and index2 == 0) or (index1 == 1 and index2 == 1):
 *                 nonRefPosterior += marginalGenotypeLikelihood
 *             elif (index1 == 0 and index2 == 0):             # <<<<<<<<<<<<<<
 *                 refPosterior += marginalGenotypeLikelihood
 * 
 */
      __pyx_t_11 = ((__pyx_v_index1 == 0) != 0);
      if (__pyx_t_11) {
        __pyx_t_12 = ((__pyx_v_index2 == 0) != 0);
        __pyx_t_7 = __pyx_t_12;
      } else {
        __pyx_t_7 = __pyx_t_11;
      }
      if (__pyx_t_7) {

        /* "vcfutils.pyx":326
 *                 nonRefPosterior += marginalGenotypeLikelihood
 *             elif (index1 == 0 and index2 == 0):
 *                 refPosterior += marginalGenotypeLikelihood             # <<<<<<<<<<<<<<
 * 
 *             sumLikelihoods += marginalGenotypeLikelihood
 */
        __pyx_v_refPosterior = (__pyx_v_refPosterior + __pyx_v_marginalGenotypeLikelihood);
        goto __pyx_L23;
      }
      __pyx_L23:;

      /* "vcfutils.pyx":328
 *                 refPosterior += marginalGenotypeLikelihood
 * 
 *             sumLikelihoods += marginalGenotypeLikelihood             # <<<<<<<<<<<<<<
 *             likelihoods.append(marginalGenotypeLikelihood)
 * 
 */
      __pyx_v_sumLikelihoods = (__pyx_v_sumLikelihoods + __pyx_v_marginalGenotypeLikelihood);

      /* "vcfutils.pyx":329
 * 
 *             sumLikelihoods += marginalGenotypeLikelihood
 *             likelihoods.append(marginalGenotypeLikelihood)             # <<<<<<<<<<<<<<
 * 
 *     #for genotypeIndex in range(nGenotypes):
 */
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_marginalGenotypeLikelihood); 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_t_13 = __Pyx_PyList_Append(__pyx_v_likelihoods, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L6_break:;
  }

  /* "vcfutils.pyx":334
 *     #    logger.debug("GL for sample %s, index %s = %s" %(sampleIndex, genotypeIndex, genotypeLikelihoods[sampleIndex][genotypeIndex]))
 * 
 *     return (phasedIndex1,phasedIndex2,likelihoods,bestLikelihood/sumLikelihoods,nonRefPosterior/sumLikelihoods,refPosterior/sumLikelihoods,bestGoodnessOfFitValue)             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyInt_FromLong(__pyx_v_phasedIndex1); 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_14 = PyInt_FromLong(__pyx_v_phasedIndex2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = PyFloat_FromDouble((__pyx_v_bestLikelihood / __pyx_v_sumLikelihoods)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = PyFloat_FromDouble((__pyx_v_nonRefPosterior / __pyx_v_sumLikelihoods)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = PyFloat_FromDouble((__pyx_v_refPosterior / __pyx_v_sumLikelihoods)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = PyFloat_FromDouble(__pyx_v_bestGoodnessOfFitValue); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = PyTuple_New(7); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_19);
  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_14);
  __Pyx_INCREF(((PyObject *)__pyx_v_likelihoods));
  PyTuple_SET_ITEM(__pyx_t_19, 2, ((PyObject *)__pyx_v_likelihoods));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_likelihoods));
  PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_19, 4, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_16);
  PyTuple_SET_ITEM(__pyx_t_19, 5, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_17);
  PyTuple_SET_ITEM(__pyx_t_19, 6, __pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_18);
  __pyx_t_1 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  __pyx_r = ((PyObject*)__pyx_t_19);
  __pyx_t_19 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("vcfutils.computeGenotypeCallAndLikelihoods", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_genotype);
  __Pyx_XDECREF((PyObject *)__pyx_v_variant);
  __Pyx_XDECREF((PyObject *)__pyx_v_hap2);
  __Pyx_XDECREF(__pyx_v_likelihoods);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":338
 * ###################################################################################################
 * 
 * cdef void outputCallToVCF(dict varsByPos, dict vcfInfo, dict vcfFilter, list haplotypes, list genotypes, double* haplotypeFrequencies, double** genotypeLikelihoods, double** gofValues, int** haplotypeIndexes, list readBuffers, int nIndividuals, vcfFile, FastaFile refFile, outputFile, options, list allVariants, int windowStart, int windowEnd):             # <<<<<<<<<<<<<<
 *     """
 *     Output a call to a vcf file. Uses the signature of the callingModule.
 */

static void __pyx_f_8vcfutils_outputCallToVCF(PyObject *__pyx_v_varsByPos, PyObject *__pyx_v_vcfInfo, PyObject *__pyx_v_vcfFilter, PyObject *__pyx_v_haplotypes, PyObject *__pyx_v_genotypes, double *__pyx_v_haplotypeFrequencies, double **__pyx_v_genotypeLikelihoods, double **__pyx_v_gofValues, int **__pyx_v_haplotypeIndexes, PyObject *__pyx_v_readBuffers, int __pyx_v_nIndividuals, PyObject *__pyx_v_vcfFile, struct __pyx_obj_9fastafile_FastaFile *__pyx_v_refFile, PyObject *__pyx_v_outputFile, PyObject *__pyx_v_options, PyObject *__pyx_v_allVariants, int __pyx_v_windowStart, int __pyx_v_windowEnd) {
  struct __pyx_obj_10chaplotype_Haplotype *__pyx_v_haplotype = 0;
  struct __pyx_obj_7cwindow_bamReadBuffer *__pyx_v_theBuffer = 0;
  PyObject *__pyx_v_info = 0;
  PyObject *__pyx_v_lineinfo = 0;
  PyObject *__pyx_v_normalisedGLs = 0;
  PyObject *__pyx_v_FR = 0;
  PyObject *__pyx_v_PP = 0;
  PyObject *__pyx_v_NF = 0;
  PyObject *__pyx_v_NR = 0;
  PyObject *__pyx_v_TR = 0;
  PyObject *__pyx_v_GT = 0;
  PyObject *__pyx_v_linefilter = 0;
  CYTHON_UNUSED int __pyx_v_gofThreshold;
  int __pyx_v_i;
  CYTHON_UNUSED int __pyx_v_variantIndex;
  int __pyx_v_nVariants;
  CYTHON_UNUSED int __pyx_v_nVarsHap1;
  CYTHON_UNUSED int __pyx_v_nVarsHap2;
  CYTHON_UNUSED int __pyx_v_tnReadsThisIndividual;
  int __pyx_v_index1;
  int __pyx_v_index2;
  int __pyx_v_hapIndex;
  CYTHON_UNUSED double __pyx_v_mLTOT;
  double __pyx_v_genotypePosterior;
  double __pyx_v_nonRefPosterior;
  double __pyx_v_refPosterior;
  double __pyx_v_maxLikelihood;
  double __pyx_v_gofValue;
  double __pyx_v_maxGofValue;
  double __pyx_v_minGofValue;
  PyObject *__pyx_v_thisSample = 0;
  PyObject *__pyx_v_sortedPositions = 0;
  PyObject *__pyx_v_variants = 0;
  PyObject *__pyx_v_likelihoods = 0;
  PyObject *__pyx_v_variantsThisPos = 0;
  int **__pyx_v_varThisPosInHap;
  int *__pyx_v_haplotypeIsRefAtThisPos;
  CYTHON_UNUSED int __pyx_v_hapIsRef;
  PyObject *__pyx_v_POS = NULL;
  PyObject *__pyx_v_variant = NULL;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_ref = NULL;
  PyObject *__pyx_v_alt = NULL;
  PyObject *__pyx_v_theId = NULL;
  PyObject *__pyx_v_qual = NULL;
  PyObject *__pyx_v_format = NULL;
  PyObject *__pyx_v_var = NULL;
  PyObject *__pyx_v_freq = NULL;
  PyObject *__pyx_v_posterior = NULL;
  PyObject *__pyx_v_varTR = NULL;
  PyObject *__pyx_v_varNF = NULL;
  PyObject *__pyx_v_varNR = NULL;
  PyObject *__pyx_v_vcfDataLine = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_theVar = NULL;
  PyObject *__pyx_v_gofsThisPos = NULL;
  PyObject *__pyx_v_nNonRefCalls = NULL;
  PyObject *__pyx_v_phredPosterior = NULL;
  PyObject *__pyx_v_phredNonRefPosterior = NULL;
  PyObject *__pyx_v_phredRefPosterior = NULL;
  PyObject *__pyx_v_readsPerSample = NULL;
  PyObject *__pyx_v_varReadsPerSample = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_theChrom = NULL;
  PyObject *__pyx_v_thePos = NULL;
  PyObject *__pyx_v_theRef = NULL;
  PyObject *__pyx_v_theAlt = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_f = NULL;
  PyObject *__pyx_v_pp = NULL;
  PyObject *__pyx_v_x = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  char *__pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_t_22;
  double __pyx_t_23;
  double __pyx_t_24;
  double __pyx_t_25;
  double __pyx_t_26;
  int __pyx_t_27;
  int __pyx_t_28;
  long __pyx_t_29;
  int __pyx_t_30;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outputCallToVCF", 0);

  /* "vcfutils.pyx":353
 *     cdef cAlignedRead** endRead
 * 
 *     cdef dict info = vcfInfo             # <<<<<<<<<<<<<<
 *     cdef dict lineinfo
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_vcfInfo));
  __pyx_v_info = __pyx_v_vcfInfo;

  /* "vcfutils.pyx":367
 *     cdef list linefilter
 * 
 *     cdef int gofThreshold = options.maxGOF             # <<<<<<<<<<<<<<
 *     cdef int i = 0
 *     cdef int variantIndex = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__maxGOF); 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_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_gofThreshold = __pyx_t_2;

  /* "vcfutils.pyx":368
 * 
 *     cdef int gofThreshold = options.maxGOF
 *     cdef int i = 0             # <<<<<<<<<<<<<<
 *     cdef int variantIndex = 0
 *     cdef int nVariants = 0
 */
  __pyx_v_i = 0;

  /* "vcfutils.pyx":369
 *     cdef int gofThreshold = options.maxGOF
 *     cdef int i = 0
 *     cdef int variantIndex = 0             # <<<<<<<<<<<<<<
 *     cdef int nVariants = 0
 *     cdef int nVarsHap1 = 0
 */
  __pyx_v_variantIndex = 0;

  /* "vcfutils.pyx":370
 *     cdef int i = 0
 *     cdef int variantIndex = 0
 *     cdef int nVariants = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarsHap1 = 0
 *     cdef int nVarsHap2 = 0
 */
  __pyx_v_nVariants = 0;

  /* "vcfutils.pyx":371
 *     cdef int variantIndex = 0
 *     cdef int nVariants = 0
 *     cdef int nVarsHap1 = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarsHap2 = 0
 *     cdef int tnReadsThisIndividual = 0
 */
  __pyx_v_nVarsHap1 = 0;

  /* "vcfutils.pyx":372
 *     cdef int nVariants = 0
 *     cdef int nVarsHap1 = 0
 *     cdef int nVarsHap2 = 0             # <<<<<<<<<<<<<<
 *     cdef int tnReadsThisIndividual = 0
 *     cdef int index1,index2,hapIndex = 0
 */
  __pyx_v_nVarsHap2 = 0;

  /* "vcfutils.pyx":373
 *     cdef int nVarsHap1 = 0
 *     cdef int nVarsHap2 = 0
 *     cdef int tnReadsThisIndividual = 0             # <<<<<<<<<<<<<<
 *     cdef int index1,index2,hapIndex = 0
 * 
 */
  __pyx_v_tnReadsThisIndividual = 0;

  /* "vcfutils.pyx":374
 *     cdef int nVarsHap2 = 0
 *     cdef int tnReadsThisIndividual = 0
 *     cdef int index1,index2,hapIndex = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef double mLTOT = -0.23025850929940459 # Minus log ten over ten
 */
  __pyx_v_hapIndex = 0;

  /* "vcfutils.pyx":376
 *     cdef int index1,index2,hapIndex = 0
 * 
 *     cdef double mLTOT = -0.23025850929940459 # Minus log ten over ten             # <<<<<<<<<<<<<<
 *     cdef double genotypePosterior = 0.0
 *     cdef double nonRefPosterior = 0.0
 */
  __pyx_v_mLTOT = -0.23025850929940459;

  /* "vcfutils.pyx":377
 * 
 *     cdef double mLTOT = -0.23025850929940459 # Minus log ten over ten
 *     cdef double genotypePosterior = 0.0             # <<<<<<<<<<<<<<
 *     cdef double nonRefPosterior = 0.0
 *     cdef double refPosterior = 0.0
 */
  __pyx_v_genotypePosterior = 0.0;

  /* "vcfutils.pyx":378
 *     cdef double mLTOT = -0.23025850929940459 # Minus log ten over ten
 *     cdef double genotypePosterior = 0.0
 *     cdef double nonRefPosterior = 0.0             # <<<<<<<<<<<<<<
 *     cdef double refPosterior = 0.0
 *     cdef double maxLikelihood = 0.0
 */
  __pyx_v_nonRefPosterior = 0.0;

  /* "vcfutils.pyx":379
 *     cdef double genotypePosterior = 0.0
 *     cdef double nonRefPosterior = 0.0
 *     cdef double refPosterior = 0.0             # <<<<<<<<<<<<<<
 *     cdef double maxLikelihood = 0.0
 *     cdef double gofValue = 0.0
 */
  __pyx_v_refPosterior = 0.0;

  /* "vcfutils.pyx":380
 *     cdef double nonRefPosterior = 0.0
 *     cdef double refPosterior = 0.0
 *     cdef double maxLikelihood = 0.0             # <<<<<<<<<<<<<<
 *     cdef double gofValue = 0.0
 *     cdef double maxGofValue = 0.0
 */
  __pyx_v_maxLikelihood = 0.0;

  /* "vcfutils.pyx":381
 *     cdef double refPosterior = 0.0
 *     cdef double maxLikelihood = 0.0
 *     cdef double gofValue = 0.0             # <<<<<<<<<<<<<<
 *     cdef double maxGofValue = 0.0
 *     cdef double minGofValue = 1e6
 */
  __pyx_v_gofValue = 0.0;

  /* "vcfutils.pyx":382
 *     cdef double maxLikelihood = 0.0
 *     cdef double gofValue = 0.0
 *     cdef double maxGofValue = 0.0             # <<<<<<<<<<<<<<
 *     cdef double minGofValue = 1e6
 * 
 */
  __pyx_v_maxGofValue = 0.0;

  /* "vcfutils.pyx":383
 *     cdef double gofValue = 0.0
 *     cdef double maxGofValue = 0.0
 *     cdef double minGofValue = 1e6             # <<<<<<<<<<<<<<
 * 
 *     cdef bytes thisSample
 */
  __pyx_v_minGofValue = 1e6;

  /* "vcfutils.pyx":386
 * 
 *     cdef bytes thisSample
 *     cdef list sortedPositions = sorted(varsByPos.keys())             # <<<<<<<<<<<<<<
 *     cdef list variants
 *     cdef list likelihoods = None
 */
  if (unlikely(((PyObject *)__pyx_v_varsByPos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_varsByPos); 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), NULL); 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_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_sortedPositions = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":388
 *     cdef list sortedPositions = sorted(varsByPos.keys())
 *     cdef list variants
 *     cdef list likelihoods = None             # <<<<<<<<<<<<<<
 *     cdef list variantsThisPos
 * 
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_likelihoods = ((PyObject*)Py_None);

  /* "vcfutils.pyx":391
 *     cdef list variantsThisPos
 * 
 *     cdef int** varThisPosInHap = <int**>(calloc(len(haplotypes), sizeof(int*)))             # <<<<<<<<<<<<<<
 *     cdef int* haplotypeIsRefAtThisPos = <int*>(calloc(len(haplotypes), sizeof(int)))
 *     cdef int hapIsRef = 0
 */
  if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_haplotypes)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_varThisPosInHap = ((int **)calloc(__pyx_t_4, (sizeof(int *))));

  /* "vcfutils.pyx":392
 * 
 *     cdef int** varThisPosInHap = <int**>(calloc(len(haplotypes), sizeof(int*)))
 *     cdef int* haplotypeIsRefAtThisPos = <int*>(calloc(len(haplotypes), sizeof(int)))             # <<<<<<<<<<<<<<
 *     cdef int hapIsRef = 0
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_haplotypes)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_haplotypeIsRefAtThisPos = ((int *)calloc(__pyx_t_4, (sizeof(int))));

  /* "vcfutils.pyx":393
 *     cdef int** varThisPosInHap = <int**>(calloc(len(haplotypes), sizeof(int*)))
 *     cdef int* haplotypeIsRefAtThisPos = <int*>(calloc(len(haplotypes), sizeof(int)))
 *     cdef int hapIsRef = 0             # <<<<<<<<<<<<<<
 * 
 *     for hapIndex in range(len(haplotypes)):
 */
  __pyx_v_hapIsRef = 0;

  /* "vcfutils.pyx":395
 *     cdef int hapIsRef = 0
 * 
 *     for hapIndex in range(len(haplotypes)):             # <<<<<<<<<<<<<<
 *         varThisPosInHap[hapIndex] = <int*>(calloc(len(allVariants), sizeof(int)))
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_haplotypes)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) {
    __pyx_v_hapIndex = __pyx_t_2;

    /* "vcfutils.pyx":396
 * 
 *     for hapIndex in range(len(haplotypes)):
 *         varThisPosInHap[hapIndex] = <int*>(calloc(len(allVariants), sizeof(int)))             # <<<<<<<<<<<<<<
 * 
 *     for POS in sortedPositions:
 */
    if (unlikely(((PyObject *)__pyx_v_allVariants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_allVariants)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    (__pyx_v_varThisPosInHap[__pyx_v_hapIndex]) = ((int *)calloc(__pyx_t_5, (sizeof(int))));
  }

  /* "vcfutils.pyx":398
 *         varThisPosInHap[hapIndex] = <int*>(calloc(len(allVariants), sizeof(int)))
 * 
 *     for POS in sortedPositions:             # <<<<<<<<<<<<<<
 * 
 *         #logger.info("Variants at position %s = %s" %(POS, varsByPos[POS]))
 */
  if (unlikely(((PyObject *)__pyx_v_sortedPositions) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_sortedPositions); __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 = 398; __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 = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF(__pyx_v_POS);
    __pyx_v_POS = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":402
 *         #logger.info("Variants at position %s = %s" %(POS, varsByPos[POS]))
 * 
 *         maxGofValue = 0.0             # <<<<<<<<<<<<<<
 *         minGofValue = 1e6
 *         variants = varsByPos[POS]
 */
    __pyx_v_maxGofValue = 0.0;

    /* "vcfutils.pyx":403
 * 
 *         maxGofValue = 0.0
 *         minGofValue = 1e6             # <<<<<<<<<<<<<<
 *         variants = varsByPos[POS]
 *         variantsThisPos = variants
 */
    __pyx_v_minGofValue = 1e6;

    /* "vcfutils.pyx":404
 *         maxGofValue = 0.0
 *         minGofValue = 1e6
 *         variants = varsByPos[POS]             # <<<<<<<<<<<<<<
 *         variantsThisPos = variants
 *         nVariants = len(variants)
 */
    if (unlikely(((PyObject *)__pyx_v_varsByPos) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_varsByPos), __pyx_v_POS); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyList_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_variants));
    __pyx_v_variants = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":405
 *         minGofValue = 1e6
 *         variants = varsByPos[POS]
 *         variantsThisPos = variants             # <<<<<<<<<<<<<<
 *         nVariants = len(variants)
 * 
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_variants));
    __Pyx_XDECREF(((PyObject *)__pyx_v_variantsThisPos));
    __pyx_v_variantsThisPos = __pyx_v_variants;

    /* "vcfutils.pyx":406
 *         variants = varsByPos[POS]
 *         variantsThisPos = variants
 *         nVariants = len(variants)             # <<<<<<<<<<<<<<
 * 
 *         # Store boolean flag saying if each haplotype is reference at this position, for use in genotype/likelihood computation
 */
    if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_variants)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nVariants = __pyx_t_5;

    /* "vcfutils.pyx":409
 * 
 *         # Store boolean flag saying if each haplotype is reference at this position, for use in genotype/likelihood computation
 *         for hapIndex,haplotype in enumerate(haplotypes):             # <<<<<<<<<<<<<<
 * 
 *             haplotypeIsRefAtThisPos[hapIndex] = 1
 */
    __pyx_t_2 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_v_haplotypes); __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_haplotype));
      __pyx_v_haplotype = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_v_hapIndex = __pyx_t_2;
      __pyx_t_2 = (__pyx_t_2 + 1);

      /* "vcfutils.pyx":411
 *         for hapIndex,haplotype in enumerate(haplotypes):
 * 
 *             haplotypeIsRefAtThisPos[hapIndex] = 1             # <<<<<<<<<<<<<<
 * 
 *             for variantIndex,variant in enumerate(variants):
 */
      (__pyx_v_haplotypeIsRefAtThisPos[__pyx_v_hapIndex]) = 1;

      /* "vcfutils.pyx":413
 *             haplotypeIsRefAtThisPos[hapIndex] = 1
 * 
 *             for variantIndex,variant in enumerate(variants):             # <<<<<<<<<<<<<<
 * 
 *                 if variant in haplotype.variants:
 */
      __pyx_t_7 = 0;
      __pyx_t_6 = ((PyObject *)__pyx_v_variants); __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
      for (;;) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        __Pyx_XDECREF(__pyx_v_variant);
        __pyx_v_variant = __pyx_t_9;
        __pyx_t_9 = 0;
        __pyx_v_variantIndex = __pyx_t_7;
        __pyx_t_7 = (__pyx_t_7 + 1);

        /* "vcfutils.pyx":415
 *             for variantIndex,variant in enumerate(variants):
 * 
 *                 if variant in haplotype.variants:             # <<<<<<<<<<<<<<
 *                     varThisPosInHap[hapIndex][variantsThisPos.index(variant)] = 1
 * 
 */
        __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_v_variant, ((PyObject *)__pyx_v_haplotype->variants), Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_11 = (__pyx_t_10 != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":416
 * 
 *                 if variant in haplotype.variants:
 *                     varThisPosInHap[hapIndex][variantsThisPos.index(variant)] = 1             # <<<<<<<<<<<<<<
 * 
 *                     if variant.minRefPos <= POS <= variant.maxRefPos:
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_variantsThisPos), __pyx_n_s__index); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_v_variant);
          PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_variant);
          __Pyx_GIVEREF(__pyx_v_variant);
          __pyx_t_13 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_13); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          ((__pyx_v_varThisPosInHap[__pyx_v_hapIndex])[__pyx_t_14]) = 1;

          /* "vcfutils.pyx":418
 *                     varThisPosInHap[hapIndex][variantsThisPos.index(variant)] = 1
 * 
 *                     if variant.minRefPos <= POS <= variant.maxRefPos:             # <<<<<<<<<<<<<<
 *                         haplotypeIsRefAtThisPos[hapIndex] = 0
 *                 else:
 */
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_variant, __pyx_n_s__minRefPos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_12 = PyObject_RichCompare(__pyx_t_13, __pyx_v_POS, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (__Pyx_PyObject_IsTrue(__pyx_t_12)) {
            __Pyx_DECREF(__pyx_t_12);
            __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_variant, __pyx_n_s__maxRefPos); 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_t_12 = PyObject_RichCompare(__pyx_v_POS, __pyx_t_9, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_11) {

            /* "vcfutils.pyx":419
 * 
 *                     if variant.minRefPos <= POS <= variant.maxRefPos:
 *                         haplotypeIsRefAtThisPos[hapIndex] = 0             # <<<<<<<<<<<<<<
 *                 else:
 *                     varThisPosInHap[hapIndex][variantsThisPos.index(variant)] = 0
 */
            (__pyx_v_haplotypeIsRefAtThisPos[__pyx_v_hapIndex]) = 0;
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "vcfutils.pyx":421
 *                         haplotypeIsRefAtThisPos[hapIndex] = 0
 *                 else:
 *                     varThisPosInHap[hapIndex][variantsThisPos.index(variant)] = 0             # <<<<<<<<<<<<<<
 * 
 *             for variantIndex,variant in enumerate(allVariants):
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_variantsThisPos), __pyx_n_s__index); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_v_variant);
          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_variant);
          __Pyx_GIVEREF(__pyx_v_variant);
          __pyx_t_9 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_13), NULL); 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(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          ((__pyx_v_varThisPosInHap[__pyx_v_hapIndex])[__pyx_t_14]) = 0;
        }
        __pyx_L11:;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "vcfutils.pyx":423
 *                     varThisPosInHap[hapIndex][variantsThisPos.index(variant)] = 0
 * 
 *             for variantIndex,variant in enumerate(allVariants):             # <<<<<<<<<<<<<<
 * 
 *                 if variant in haplotype.variants:
 */
      __pyx_t_7 = 0;
      __pyx_t_6 = ((PyObject *)__pyx_v_allVariants); __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
      for (;;) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        __Pyx_XDECREF(__pyx_v_variant);
        __pyx_v_variant = __pyx_t_9;
        __pyx_t_9 = 0;
        __pyx_v_variantIndex = __pyx_t_7;
        __pyx_t_7 = (__pyx_t_7 + 1);

        /* "vcfutils.pyx":425
 *             for variantIndex,variant in enumerate(allVariants):
 * 
 *                 if variant in haplotype.variants:             # <<<<<<<<<<<<<<
 *                     if variant.minRefPos <= POS <= variant.maxRefPos:
 *                         haplotypeIsRefAtThisPos[hapIndex] = 0
 */
        __pyx_t_11 = (__Pyx_PySequence_Contains(__pyx_v_variant, ((PyObject *)__pyx_v_haplotype->variants), Py_EQ)); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = (__pyx_t_11 != 0);
        if (__pyx_t_10) {

          /* "vcfutils.pyx":426
 * 
 *                 if variant in haplotype.variants:
 *                     if variant.minRefPos <= POS <= variant.maxRefPos:             # <<<<<<<<<<<<<<
 *                         haplotypeIsRefAtThisPos[hapIndex] = 0
 * 
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_variant, __pyx_n_s__minRefPos); 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_t_13 = PyObject_RichCompare(__pyx_t_9, __pyx_v_POS, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (__Pyx_PyObject_IsTrue(__pyx_t_13)) {
            __Pyx_DECREF(__pyx_t_13);
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_variant, __pyx_n_s__maxRefPos); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = PyObject_RichCompare(__pyx_v_POS, __pyx_t_12, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_10) {

            /* "vcfutils.pyx":427
 *                 if variant in haplotype.variants:
 *                     if variant.minRefPos <= POS <= variant.maxRefPos:
 *                         haplotypeIsRefAtThisPos[hapIndex] = 0             # <<<<<<<<<<<<<<
 * 
 *         if options.verbosity >= 3:
 */
            (__pyx_v_haplotypeIsRefAtThisPos[__pyx_v_hapIndex]) = 0;
            goto __pyx_L16;
          }
          __pyx_L16:;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "vcfutils.pyx":429
 *                         haplotypeIsRefAtThisPos[hapIndex] = 0
 * 
 *         if options.verbosity >= 3:             # <<<<<<<<<<<<<<
 *             logger.debug("Haps are %s" %(haplotypes))
 *             logger.debug("Logging mutated sequences...")
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__verbosity); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_int_3, Py_GE); __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_3); __pyx_t_3 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 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_10) {

      /* "vcfutils.pyx":430
 * 
 *         if options.verbosity >= 3:
 *             logger.debug("Haps are %s" %(haplotypes))             # <<<<<<<<<<<<<<
 *             logger.debug("Logging mutated sequences...")
 *             logger.debug("Lengths are %s" %([len(str(haplotype.getMutatedSequence())) for haplotype in haplotypes]))
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); 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_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__debug); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_v_haplotypes)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_6));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_13), NULL); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "vcfutils.pyx":431
 *         if options.verbosity >= 3:
 *             logger.debug("Haps are %s" %(haplotypes))
 *             logger.debug("Logging mutated sequences...")             # <<<<<<<<<<<<<<
 *             logger.debug("Lengths are %s" %([len(str(haplotype.getMutatedSequence())) for haplotype in haplotypes]))
 * 
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__debug); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "vcfutils.pyx":432
 *             logger.debug("Haps are %s" %(haplotypes))
 *             logger.debug("Logging mutated sequences...")
 *             logger.debug("Lengths are %s" %([len(str(haplotype.getMutatedSequence())) for haplotype in haplotypes]))             # <<<<<<<<<<<<<<
 * 
 *             for haplotype in haplotypes:
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); 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_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__debug); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyList_New(0); 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);
      if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = ((PyObject *)__pyx_v_haplotypes); __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      for (;;) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_haplotype));
        __pyx_v_haplotype = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyBytes_FromString(((struct __pyx_vtabstruct_10chaplotype_Haplotype *)__pyx_v_haplotype->__pyx_vtab)->getMutatedSequence(__pyx_v_haplotype)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
        __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_9));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
        __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_8 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(((PyObject *)__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 = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "vcfutils.pyx":434
 *             logger.debug("Lengths are %s" %([len(str(haplotype.getMutatedSequence())) for haplotype in haplotypes]))
 * 
 *             for haplotype in haplotypes:             # <<<<<<<<<<<<<<
 *                 logger.debug(str(haplotype.getMutatedSequence())[50:-50])
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = ((PyObject *)__pyx_v_haplotypes); __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      for (;;) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_haplotype));
        __pyx_v_haplotype = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_6);
        __pyx_t_6 = 0;

        /* "vcfutils.pyx":435
 * 
 *             for haplotype in haplotypes:
 *                 logger.debug(str(haplotype.getMutatedSequence())[50:-50])             # <<<<<<<<<<<<<<
 * 
 *             logger.debug("Unfiltered variants are %s" %(sorted(variants)))
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__debug); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyBytes_FromString(((struct __pyx_vtabstruct_10chaplotype_Haplotype *)__pyx_v_haplotype->__pyx_vtab)->getMutatedSequence(__pyx_v_haplotype)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_6));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
        __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_t_6, 50, -50, NULL, NULL, &__pyx_k_slice_5, 1, 1, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __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 = 435; __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);
        __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(((PyObject *)__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;

      /* "vcfutils.pyx":437
 *                 logger.debug(str(haplotype.getMutatedSequence())[50:-50])
 * 
 *             logger.debug("Unfiltered variants are %s" %(sorted(variants)))             # <<<<<<<<<<<<<<
 *             logger.debug("Var info = %s" %(info))
 *             logger.debug("Unfiltered variant info is %s" %([info[v] for v in sorted(variants)]))
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__debug); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __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 = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_variants));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_variants));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_variants));
      __pyx_t_6 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __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 = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), 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_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "vcfutils.pyx":438
 * 
 *             logger.debug("Unfiltered variants are %s" %(sorted(variants)))
 *             logger.debug("Var info = %s" %(info))             # <<<<<<<<<<<<<<
 *             logger.debug("Unfiltered variant info is %s" %([info[v] for v in sorted(variants)]))
 *             logger.debug("NVariants = %s" %(nVariants))
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__debug); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_v_info)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_3));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "vcfutils.pyx":439
 *             logger.debug("Unfiltered variants are %s" %(sorted(variants)))
 *             logger.debug("Var info = %s" %(info))
 *             logger.debug("Unfiltered variant info is %s" %([info[v] for v in sorted(variants)]))             # <<<<<<<<<<<<<<
 *             logger.debug("NVariants = %s" %(nVariants))
 * 
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__debug); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(((PyObject *)__pyx_v_variants));
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_variants));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_variants));
      __pyx_t_13 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      if (PyList_CheckExact(__pyx_t_13) || PyTuple_CheckExact(__pyx_t_13)) {
        __pyx_t_6 = __pyx_t_13; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_15 = Py_TYPE(__pyx_t_6)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      for (;;) {
        if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_6)) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_13 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_13); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_13 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_6)) {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_13); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_13 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_13 = __pyx_t_15(__pyx_t_6);
          if (unlikely(!__pyx_t_13)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_XDECREF(__pyx_v_v);
        __pyx_v_v = __pyx_t_13;
        __pyx_t_13 = 0;
        if (unlikely(((PyObject *)__pyx_v_info) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_info), __pyx_v_v); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      __Pyx_DECREF(((PyObject *)__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 = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "vcfutils.pyx":440
 *             logger.debug("Var info = %s" %(info))
 *             logger.debug("Unfiltered variant info is %s" %([info[v] for v in sorted(variants)]))
 *             logger.debug("NVariants = %s" %(nVariants))             # <<<<<<<<<<<<<<
 * 
 *         chrom = variants[0].refName
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__debug); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyInt_FromLong(__pyx_v_nVariants); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__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 = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_9));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
      __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "vcfutils.pyx":442
 *             logger.debug("NVariants = %s" %(nVariants))
 * 
 *         chrom = variants[0].refName             # <<<<<<<<<<<<<<
 *         ref,alt = refAndAlt(chrom, POS, variants, refFile)
 *         theId = "."
 */
    if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(PyList_GET_ITEM(__pyx_v_variants, 0), __pyx_n_s__refName); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF(__pyx_v_chrom);
    __pyx_v_chrom = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":443
 * 
 *         chrom = variants[0].refName
 *         ref,alt = refAndAlt(chrom, POS, variants, refFile)             # <<<<<<<<<<<<<<
 *         theId = "."
 *         #id = "."#str(-1)
 */
    __pyx_t_16 = __Pyx_PyObject_AsString(__pyx_v_chrom); if (unlikely((!__pyx_t_16) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_POS); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((PyObject *)__pyx_f_8vcfutils_refAndAlt(__pyx_t_16, __pyx_t_2, __pyx_v_variants, __pyx_v_refFile)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    if (likely(PyTuple_CheckExact(__pyx_t_9))) {
      PyObject* sequence = __pyx_t_9;
      #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 = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else if (1) {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_17 = Py_TYPE(__pyx_t_13)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L24_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_13); if (unlikely(!__pyx_t_3)) goto __pyx_L24_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_17 = NULL;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L25_unpacking_done;
      __pyx_L24_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_17 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L25_unpacking_done:;
    }
    __Pyx_XDECREF(__pyx_v_ref);
    __pyx_v_ref = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_v_alt);
    __pyx_v_alt = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":444
 *         chrom = variants[0].refName
 *         ref,alt = refAndAlt(chrom, POS, variants, refFile)
 *         theId = "."             # <<<<<<<<<<<<<<
 *         #id = "."#str(-1)
 *         qual = -1
 */
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
    __Pyx_XDECREF(__pyx_v_theId);
    __pyx_v_theId = ((PyObject *)__pyx_kp_s_10);

    /* "vcfutils.pyx":446
 *         theId = "."
 *         #id = "."#str(-1)
 *         qual = -1             # <<<<<<<<<<<<<<
 *         format = ['GT:GL:GOF:GQ:NR:NV']
 *         linefilter = []
 */
    __Pyx_INCREF(__pyx_int_neg_1);
    __Pyx_XDECREF(__pyx_v_qual);
    __pyx_v_qual = __pyx_int_neg_1;

    /* "vcfutils.pyx":447
 *         #id = "."#str(-1)
 *         qual = -1
 *         format = ['GT:GL:GOF:GQ:NR:NV']             # <<<<<<<<<<<<<<
 *         linefilter = []
 *         lineinfo = info[variants[0]]
 */
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
    PyList_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_11));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11));
    __Pyx_XDECREF(((PyObject *)__pyx_v_format));
    __pyx_v_format = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":448
 *         qual = -1
 *         format = ['GT:GL:GOF:GQ:NR:NV']
 *         linefilter = []             # <<<<<<<<<<<<<<
 *         lineinfo = info[variants[0]]
 *         FR = []             # Can be generalised to all fields of variable length
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF(((PyObject *)__pyx_v_linefilter));
    __pyx_v_linefilter = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":449
 *         format = ['GT:GL:GOF:GQ:NR:NV']
 *         linefilter = []
 *         lineinfo = info[variants[0]]             # <<<<<<<<<<<<<<
 *         FR = []             # Can be generalised to all fields of variable length
 *         PP = []
 */
    if (unlikely(((PyObject *)__pyx_v_info) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_info), PyList_GET_ITEM(__pyx_v_variants, 0)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    if (!(likely(PyDict_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_lineinfo));
    __pyx_v_lineinfo = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":450
 *         linefilter = []
 *         lineinfo = info[variants[0]]
 *         FR = []             # Can be generalised to all fields of variable length             # <<<<<<<<<<<<<<
 *         PP = []
 *         NF = []
 */
    __pyx_t_9 = PyList_New(0); 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_XDECREF(((PyObject *)__pyx_v_FR));
    __pyx_v_FR = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":451
 *         lineinfo = info[variants[0]]
 *         FR = []             # Can be generalised to all fields of variable length
 *         PP = []             # <<<<<<<<<<<<<<
 *         NF = []
 *         NR = []
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF(((PyObject *)__pyx_v_PP));
    __pyx_v_PP = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":452
 *         FR = []             # Can be generalised to all fields of variable length
 *         PP = []
 *         NF = []             # <<<<<<<<<<<<<<
 *         NR = []
 *         TR = []
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF(((PyObject *)__pyx_v_NF));
    __pyx_v_NF = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":453
 *         PP = []
 *         NF = []
 *         NR = []             # <<<<<<<<<<<<<<
 *         TR = []
 * 
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF(((PyObject *)__pyx_v_NR));
    __pyx_v_NR = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":454
 *         NF = []
 *         NR = []
 *         TR = []             # <<<<<<<<<<<<<<
 * 
 *         for var in variants:
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF(((PyObject *)__pyx_v_TR));
    __pyx_v_TR = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":456
 *         TR = []
 * 
 *         for var in variants:             # <<<<<<<<<<<<<<
 * 
 *             #logger.debug("Info for variant %s is %s" %(var, info[var]))
 */
    if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = ((PyObject *)__pyx_v_variants); __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_XDECREF(__pyx_v_var);
      __pyx_v_var = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "vcfutils.pyx":459
 * 
 *             #logger.debug("Info for variant %s is %s" %(var, info[var]))
 *             linefilter.extend( [f for f in vcfFilter[var] if ( f in vcfFile.getfilter() )] )             # <<<<<<<<<<<<<<
 * 
 *             freq = info[var]['FR']
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_linefilter), __pyx_n_s__extend); 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_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(((PyObject *)__pyx_v_vcfFilter) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfFilter), __pyx_v_var); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      if (PyList_CheckExact(__pyx_t_13) || PyTuple_CheckExact(__pyx_t_13)) {
        __pyx_t_12 = __pyx_t_13; __Pyx_INCREF(__pyx_t_12); __pyx_t_8 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_15 = Py_TYPE(__pyx_t_12)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      for (;;) {
        if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_12)) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_12)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_13 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_8); __Pyx_INCREF(__pyx_t_13); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_12)) {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_8); __Pyx_INCREF(__pyx_t_13); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_13 = PySequence_ITEM(__pyx_t_12, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_13 = __pyx_t_15(__pyx_t_12);
          if (unlikely(!__pyx_t_13)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_XDECREF(__pyx_v_f);
        __pyx_v_f = __pyx_t_13;
        __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_vcfFile, __pyx_n_s__getfilter); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_18 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_18);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_10 = (__Pyx_PySequence_Contains(__pyx_v_f, __pyx_t_18, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        __pyx_t_11 = (__pyx_t_10 != 0);
        if (__pyx_t_11) {
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_v_f))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L30;
        }
        __pyx_L30:;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_6));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "vcfutils.pyx":461
 *             linefilter.extend( [f for f in vcfFilter[var] if ( f in vcfFile.getfilter() )] )
 * 
 *             freq = info[var]['FR']             # <<<<<<<<<<<<<<
 *             posterior = info[var]['PP']
 *             varTR = info[var]['TR']
 */
      if (unlikely(((PyObject *)__pyx_v_info) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_info), __pyx_v_var); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = PyObject_GetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__FR)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_v_freq);
      __pyx_v_freq = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "vcfutils.pyx":462
 * 
 *             freq = info[var]['FR']
 *             posterior = info[var]['PP']             # <<<<<<<<<<<<<<
 *             varTR = info[var]['TR']
 *             varNF = info[var]['NF']
 */
      if (unlikely(((PyObject *)__pyx_v_info) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_info), __pyx_v_var); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = PyObject_GetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__PP)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_v_posterior);
      __pyx_v_posterior = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "vcfutils.pyx":463
 *             freq = info[var]['FR']
 *             posterior = info[var]['PP']
 *             varTR = info[var]['TR']             # <<<<<<<<<<<<<<
 *             varNF = info[var]['NF']
 *             varNR = info[var]['NR']
 */
      if (unlikely(((PyObject *)__pyx_v_info) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_info), __pyx_v_var); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = PyObject_GetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__TR)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_v_varTR);
      __pyx_v_varTR = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "vcfutils.pyx":464
 *             posterior = info[var]['PP']
 *             varTR = info[var]['TR']
 *             varNF = info[var]['NF']             # <<<<<<<<<<<<<<
 *             varNR = info[var]['NR']
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_info) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_info), __pyx_v_var); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = PyObject_GetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__NF)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_v_varNF);
      __pyx_v_varNF = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "vcfutils.pyx":465
 *             varTR = info[var]['TR']
 *             varNF = info[var]['NF']
 *             varNR = info[var]['NR']             # <<<<<<<<<<<<<<
 * 
 *             FR.extend(freq)
 */
      if (unlikely(((PyObject *)__pyx_v_info) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_info), __pyx_v_var); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = PyObject_GetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__NR)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_v_varNR);
      __pyx_v_varNR = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "vcfutils.pyx":467
 *             varNR = info[var]['NR']
 * 
 *             FR.extend(freq)             # <<<<<<<<<<<<<<
 *             PP.extend(posterior)
 *             NR.extend(varNR)
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_FR), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_freq);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_freq);
      __Pyx_GIVEREF(__pyx_v_freq);
      __pyx_t_3 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "vcfutils.pyx":468
 * 
 *             FR.extend(freq)
 *             PP.extend(posterior)             # <<<<<<<<<<<<<<
 *             NR.extend(varNR)
 *             NF.extend(varNF)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_PP), __pyx_n_s__extend); 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_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_posterior);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_posterior);
      __Pyx_GIVEREF(__pyx_v_posterior);
      __pyx_t_12 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "vcfutils.pyx":469
 *             FR.extend(freq)
 *             PP.extend(posterior)
 *             NR.extend(varNR)             # <<<<<<<<<<<<<<
 *             NF.extend(varNF)
 *             TR.extend(varTR)
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_NR), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __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);
      __Pyx_INCREF(__pyx_v_varNR);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_varNR);
      __Pyx_GIVEREF(__pyx_v_varNR);
      __pyx_t_3 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "vcfutils.pyx":470
 *             PP.extend(posterior)
 *             NR.extend(varNR)
 *             NF.extend(varNF)             # <<<<<<<<<<<<<<
 *             TR.extend(varTR)
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_NF), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_varNF);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_varNF);
      __Pyx_GIVEREF(__pyx_v_varNF);
      __pyx_t_12 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "vcfutils.pyx":471
 *             NR.extend(varNR)
 *             NF.extend(varNF)
 *             TR.extend(varTR)             # <<<<<<<<<<<<<<
 * 
 *         lineinfo['WS'] = [windowStart]
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_TR), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_varTR);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_varTR);
      __Pyx_GIVEREF(__pyx_v_varTR);
      __pyx_t_3 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "vcfutils.pyx":473
 *             TR.extend(varTR)
 * 
 *         lineinfo['WS'] = [windowStart]             # <<<<<<<<<<<<<<
 *         lineinfo['WE'] = [windowEnd]
 *         lineinfo['FR'] = FR
 */
    __pyx_t_9 = PyInt_FromLong(__pyx_v_windowStart); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_t_9 = 0;
    if (unlikely(((PyObject *)__pyx_v_lineinfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_lineinfo), ((PyObject *)__pyx_n_s__WS), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "vcfutils.pyx":474
 * 
 *         lineinfo['WS'] = [windowStart]
 *         lineinfo['WE'] = [windowEnd]             # <<<<<<<<<<<<<<
 *         lineinfo['FR'] = FR
 *         lineinfo['PP'] = PP
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_windowEnd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_lineinfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_lineinfo), ((PyObject *)__pyx_n_s__WE), ((PyObject *)__pyx_t_9)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;

    /* "vcfutils.pyx":475
 *         lineinfo['WS'] = [windowStart]
 *         lineinfo['WE'] = [windowEnd]
 *         lineinfo['FR'] = FR             # <<<<<<<<<<<<<<
 *         lineinfo['PP'] = PP
 *         lineinfo['NF'] = NF
 */
    if (unlikely(((PyObject *)__pyx_v_lineinfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_lineinfo), ((PyObject *)__pyx_n_s__FR), ((PyObject *)__pyx_v_FR)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":476
 *         lineinfo['WE'] = [windowEnd]
 *         lineinfo['FR'] = FR
 *         lineinfo['PP'] = PP             # <<<<<<<<<<<<<<
 *         lineinfo['NF'] = NF
 *         lineinfo['NR'] = NR
 */
    if (unlikely(((PyObject *)__pyx_v_lineinfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_lineinfo), ((PyObject *)__pyx_n_s__PP), ((PyObject *)__pyx_v_PP)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":477
 *         lineinfo['FR'] = FR
 *         lineinfo['PP'] = PP
 *         lineinfo['NF'] = NF             # <<<<<<<<<<<<<<
 *         lineinfo['NR'] = NR
 *         lineinfo['TR'] = TR
 */
    if (unlikely(((PyObject *)__pyx_v_lineinfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_lineinfo), ((PyObject *)__pyx_n_s__NF), ((PyObject *)__pyx_v_NF)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":478
 *         lineinfo['PP'] = PP
 *         lineinfo['NF'] = NF
 *         lineinfo['NR'] = NR             # <<<<<<<<<<<<<<
 *         lineinfo['TR'] = TR
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_lineinfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_lineinfo), ((PyObject *)__pyx_n_s__NR), ((PyObject *)__pyx_v_NR)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":479
 *         lineinfo['NF'] = NF
 *         lineinfo['NR'] = NR
 *         lineinfo['TR'] = TR             # <<<<<<<<<<<<<<
 * 
 *         linefilter = list(set(linefilter))
 */
    if (unlikely(((PyObject *)__pyx_v_lineinfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (PyDict_SetItem(((PyObject *)__pyx_v_lineinfo), ((PyObject *)__pyx_n_s__TR), ((PyObject *)__pyx_v_TR)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":481
 *         lineinfo['TR'] = TR
 * 
 *         linefilter = list(set(linefilter))             # <<<<<<<<<<<<<<
 *         qual = max([int(pp) for pp in lineinfo['PP']])
 *         vcfDataLine = {'chrom':chrom,'pos':POS,'ref':ref,'alt':alt,'id':theId,'info':lineinfo,'filter':linefilter,'qual':qual,'format':format}
 */
    __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)__pyx_v_linefilter));
    PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_linefilter));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_linefilter));
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__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 = 481; __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 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_v_linefilter));
    __pyx_v_linefilter = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":482
 * 
 *         linefilter = list(set(linefilter))
 *         qual = max([int(pp) for pp in lineinfo['PP']])             # <<<<<<<<<<<<<<
 *         vcfDataLine = {'chrom':chrom,'pos':POS,'ref':ref,'alt':alt,'id':theId,'info':lineinfo,'filter':linefilter,'qual':qual,'format':format}
 * 
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(((PyObject *)__pyx_v_lineinfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_lineinfo), ((PyObject *)__pyx_n_s__PP)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __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_6 = __pyx_t_9; __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_15 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    for (;;) {
      if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_9 = __pyx_t_15(__pyx_t_6);
        if (unlikely(!__pyx_t_9)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF(__pyx_v_pp);
      __pyx_v_pp = __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 = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_pp);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_pp);
      __Pyx_GIVEREF(__pyx_v_pp);
      __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __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 = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_v_qual);
    __pyx_v_qual = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":483
 *         linefilter = list(set(linefilter))
 *         qual = max([int(pp) for pp in lineinfo['PP']])
 *         vcfDataLine = {'chrom':chrom,'pos':POS,'ref':ref,'alt':alt,'id':theId,'info':lineinfo,'filter':linefilter,'qual':qual,'format':format}             # <<<<<<<<<<<<<<
 * 
 *         # Now pull out the genotype informations for each sample, and compute genotype likelihoods and
 */
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__chrom), __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__pos), __pyx_v_POS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ref), __pyx_v_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__alt), __pyx_v_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__id), __pyx_v_theId) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__info), ((PyObject *)__pyx_v_lineinfo)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__filter), ((PyObject *)__pyx_v_linefilter)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__qual), __pyx_v_qual) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__format), ((PyObject *)__pyx_v_format)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_vcfDataLine));
    __pyx_v_vcfDataLine = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":487
 *         # Now pull out the genotype informations for each sample, and compute genotype likelihoods and
 *         # Phred-based qualities scores.
 *         theVar = variants[0]             # <<<<<<<<<<<<<<
 *         gofsThisPos = []
 *         nNonRefCalls = 0
 */
    if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = PyList_GET_ITEM(__pyx_v_variants, 0);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_v_theVar);
    __pyx_v_theVar = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":488
 *         # Phred-based qualities scores.
 *         theVar = variants[0]
 *         gofsThisPos = []             # <<<<<<<<<<<<<<
 *         nNonRefCalls = 0
 * 
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF(((PyObject *)__pyx_v_gofsThisPos));
    __pyx_v_gofsThisPos = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":489
 *         theVar = variants[0]
 *         gofsThisPos = []
 *         nNonRefCalls = 0             # <<<<<<<<<<<<<<
 * 
 *         for i from 0 <= i < nIndividuals:
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_nNonRefCalls);
    __pyx_v_nNonRefCalls = __pyx_int_0;

    /* "vcfutils.pyx":491
 *         nNonRefCalls = 0
 * 
 *         for i from 0 <= i < nIndividuals:             # <<<<<<<<<<<<<<
 * 
 *             theBuffer = readBuffers[i]
 */
    __pyx_t_2 = __pyx_v_nIndividuals;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

      /* "vcfutils.pyx":493
 *         for i from 0 <= i < nIndividuals:
 * 
 *             theBuffer = readBuffers[i]             # <<<<<<<<<<<<<<
 *             thisSample = theBuffer.sample
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_readBuffers) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_readBuffers), __pyx_v_i, sizeof(int), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7cwindow_bamReadBuffer))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_theBuffer));
      __pyx_v_theBuffer = ((struct __pyx_obj_7cwindow_bamReadBuffer *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "vcfutils.pyx":494
 * 
 *             theBuffer = readBuffers[i]
 *             thisSample = theBuffer.sample             # <<<<<<<<<<<<<<
 * 
 *             # Missing genotype call. Probably due to zero coverage for this individual.
 */
      __pyx_t_3 = ((PyObject *)__pyx_v_theBuffer->sample);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XDECREF(((PyObject *)__pyx_v_thisSample));
      __pyx_v_thisSample = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "vcfutils.pyx":497
 * 
 *             # Missing genotype call. Probably due to zero coverage for this individual.
 *             if theBuffer.reads.windowEnd - theBuffer.reads.windowStart == 0:             # <<<<<<<<<<<<<<
 *                 vcfDataLine[thisSample] = dict(GT=[[".", "/", "."]], GL=[0,0,0], GQ=[0],GOF=[0],NR=[0], NV=[0])
 *                 continue
 */
      __pyx_t_11 = (((__pyx_v_theBuffer->reads->windowEnd - __pyx_v_theBuffer->reads->windowStart) == 0) != 0);
      if (__pyx_t_11) {

        /* "vcfutils.pyx":498
 *             # Missing genotype call. Probably due to zero coverage for this individual.
 *             if theBuffer.reads.windowEnd - theBuffer.reads.windowStart == 0:
 *                 vcfDataLine[thisSample] = dict(GT=[[".", "/", "."]], GL=[0,0,0], GQ=[0],GOF=[0],NR=[0], NV=[0])             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
        __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
        PyList_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_10));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
        PyList_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_kp_s_12));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
        PyList_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_kp_s_10));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
        __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        PyList_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_6));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
        __pyx_t_6 = 0;
        if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GT), ((PyObject *)__pyx_t_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_12 = PyList_New(3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_12, 1, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_12, 2, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GL), ((PyObject *)__pyx_t_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GQ), ((PyObject *)__pyx_t_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GOF), ((PyObject *)__pyx_t_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__NR), ((PyObject *)__pyx_t_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_int_0);
        PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0);
        __Pyx_GIVEREF(__pyx_int_0);
        if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__NV), ((PyObject *)__pyx_t_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        if (PyDict_SetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_v_thisSample), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

        /* "vcfutils.pyx":499
 *             if theBuffer.reads.windowEnd - theBuffer.reads.windowStart == 0:
 *                 vcfDataLine[thisSample] = dict(GT=[[".", "/", "."]], GL=[0,0,0], GQ=[0],GOF=[0],NR=[0], NV=[0])
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             # Have genotype. Need to construct call string ("0/1" etc), and compute likelihoods
 */
        goto __pyx_L33_continue;
        goto __pyx_L35;
      }
      /*else*/ {

        /* "vcfutils.pyx":505
 *             else:
 *                 #logger.info("nReads for sample %s = %s" %(thisSample, theBuffer.reads.windowEnd - theBuffer.reads.windowStart))
 *                 (index1,index2,likelihoods,genotypePosterior,nonRefPosterior,refPosterior,gofValue) = computeGenotypeCallAndLikelihoods(POS, haplotypes, genotypes, i, haplotypeFrequencies, genotypeLikelihoods, gofValues, haplotypeIndexes, varThisPosInHap, variantsThisPos, haplotypeIsRefAtThisPos, nIndividuals, thisSample)             # <<<<<<<<<<<<<<
 * 
 *                 if not (index1 == 0 and index2 == 0):
 */
        __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_POS); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_3 = ((PyObject *)__pyx_f_8vcfutils_computeGenotypeCallAndLikelihoods(__pyx_t_7, __pyx_v_haplotypes, __pyx_v_genotypes, __pyx_v_i, __pyx_v_haplotypeFrequencies, __pyx_v_genotypeLikelihoods, __pyx_v_gofValues, __pyx_v_haplotypeIndexes, __pyx_v_varThisPosInHap, __pyx_v_variantsThisPos, __pyx_v_haplotypeIsRefAtThisPos, __pyx_v_nIndividuals, ((PyObject *)__pyx_v_thisSample))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        if (likely(PyTuple_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 != 7)) {
            if (size > 7) __Pyx_RaiseTooManyValuesError(7);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
          __pyx_t_18 = PyTuple_GET_ITEM(sequence, 3); 
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 4); 
          __pyx_t_19 = PyTuple_GET_ITEM(sequence, 5); 
          __pyx_t_20 = PyTuple_GET_ITEM(sequence, 6); 
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_19);
          __Pyx_INCREF(__pyx_t_20);
          #else
          Py_ssize_t i;
          PyObject** temps[7] = {&__pyx_t_12,&__pyx_t_6,&__pyx_t_9,&__pyx_t_18,&__pyx_t_13,&__pyx_t_19,&__pyx_t_20};
          for (i=0; i < 7; i++) {
            PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(item);
            *(temps[i]) = item;
          }
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else if (1) {
          __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        } else
        {
          Py_ssize_t index = -1;
          PyObject** temps[7] = {&__pyx_t_12,&__pyx_t_6,&__pyx_t_9,&__pyx_t_18,&__pyx_t_13,&__pyx_t_19,&__pyx_t_20};
          __pyx_t_21 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_21);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_17 = Py_TYPE(__pyx_t_21)->tp_iternext;
          for (index=0; index < 7; index++) {
            PyObject* item = __pyx_t_17(__pyx_t_21); if (unlikely(!item)) goto __pyx_L36_unpacking_failed;
            __Pyx_GOTREF(item);
            *(temps[index]) = item;
          }
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_21), 7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_17 = NULL;
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          goto __pyx_L37_unpacking_done;
          __pyx_L36_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
          __pyx_t_17 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_L37_unpacking_done:;
        }
        __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_22 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (!(likely(PyList_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_18); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
        __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_25 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_v_index1 = __pyx_t_7;
        __pyx_v_index2 = __pyx_t_22;
        __Pyx_DECREF(((PyObject *)__pyx_v_likelihoods));
        __pyx_v_likelihoods = ((PyObject*)__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_v_genotypePosterior = __pyx_t_23;
        __pyx_v_nonRefPosterior = __pyx_t_24;
        __pyx_v_refPosterior = __pyx_t_25;
        __pyx_v_gofValue = __pyx_t_26;

        /* "vcfutils.pyx":507
 *                 (index1,index2,likelihoods,genotypePosterior,nonRefPosterior,refPosterior,gofValue) = computeGenotypeCallAndLikelihoods(POS, haplotypes, genotypes, i, haplotypeFrequencies, genotypeLikelihoods, gofValues, haplotypeIndexes, varThisPosInHap, variantsThisPos, haplotypeIsRefAtThisPos, nIndividuals, thisSample)
 * 
 *                 if not (index1 == 0 and index2 == 0):             # <<<<<<<<<<<<<<
 *                     gofsThisPos.append(gofValue)
 *                     nNonRefCalls += 1
 */
        __pyx_t_11 = ((__pyx_v_index1 == 0) != 0);
        if (__pyx_t_11) {
          __pyx_t_10 = ((__pyx_v_index2 == 0) != 0);
          __pyx_t_27 = __pyx_t_10;
        } else {
          __pyx_t_27 = __pyx_t_11;
        }
        __pyx_t_11 = ((!__pyx_t_27) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":508
 * 
 *                 if not (index1 == 0 and index2 == 0):
 *                     gofsThisPos.append(gofValue)             # <<<<<<<<<<<<<<
 *                     nNonRefCalls += 1
 * 
 */
          __pyx_t_3 = PyFloat_FromDouble(__pyx_v_gofValue); 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_28 = __Pyx_PyList_Append(__pyx_v_gofsThisPos, __pyx_t_3); if (unlikely(__pyx_t_28 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "vcfutils.pyx":509
 *                 if not (index1 == 0 and index2 == 0):
 *                     gofsThisPos.append(gofValue)
 *                     nNonRefCalls += 1             # <<<<<<<<<<<<<<
 * 
 *                 GT = [str(index1), "/", str(index2)]
 */
          __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nNonRefCalls, __pyx_int_1); 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_v_nNonRefCalls);
          __pyx_v_nNonRefCalls = __pyx_t_3;
          __pyx_t_3 = 0;
          goto __pyx_L38;
        }
        __pyx_L38:;

        /* "vcfutils.pyx":511
 *                     nNonRefCalls += 1
 * 
 *                 GT = [str(index1), "/", str(index2)]             # <<<<<<<<<<<<<<
 *                 phredPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-genotypePosterior)))))
 *                 phredNonRefPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-nonRefPosterior)))))
 */
        __pyx_t_3 = PyInt_FromLong(__pyx_v_index1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
        __pyx_t_20 = PyInt_FromLong(__pyx_v_index2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_20);
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        __pyx_t_19 = PyList_New(3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        PyList_SET_ITEM(__pyx_t_19, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
        PyList_SET_ITEM(__pyx_t_19, 1, ((PyObject *)__pyx_kp_s_12));
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
        PyList_SET_ITEM(__pyx_t_19, 2, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_20);
        __pyx_t_3 = 0;
        __pyx_t_20 = 0;
        __Pyx_XDECREF(((PyObject *)__pyx_v_GT));
        __pyx_v_GT = ((PyObject*)__pyx_t_19);
        __pyx_t_19 = 0;

        /* "vcfutils.pyx":512
 * 
 *                 GT = [str(index1), "/", str(index2)]
 *                 phredPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-genotypePosterior)))))             # <<<<<<<<<<<<<<
 *                 phredNonRefPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-nonRefPosterior)))))
 *                 phredRefPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-refPosterior)))))
 */
        __pyx_t_26 = (1.0 - __pyx_v_genotypePosterior);
        __pyx_t_25 = 1e-10;
        if (((__pyx_t_26 > __pyx_t_25) != 0)) {
          __pyx_t_24 = __pyx_t_26;
        } else {
          __pyx_t_24 = __pyx_t_25;
        }
        __pyx_t_19 = PyFloat_FromDouble((-10.0 * log10(__pyx_t_24))); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_19);
        __pyx_t_19 = 0;
        __pyx_t_19 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
        __pyx_t_29 = 99;
        __pyx_t_3 = PyInt_FromLong(__pyx_t_29); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = PyObject_RichCompare(__pyx_t_19, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__pyx_t_11) {
          __Pyx_INCREF(__pyx_t_19);
          __pyx_t_20 = __pyx_t_19;
        } else {
          __pyx_t_13 = PyInt_FromLong(__pyx_t_29); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_20 = __pyx_t_13;
          __pyx_t_13 = 0;
        }
        __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 = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_INCREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_v_phredPosterior);
        __pyx_v_phredPosterior = __pyx_t_20;
        __pyx_t_20 = 0;

        /* "vcfutils.pyx":513
 *                 GT = [str(index1), "/", str(index2)]
 *                 phredPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-genotypePosterior)))))
 *                 phredNonRefPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-nonRefPosterior)))))             # <<<<<<<<<<<<<<
 *                 phredRefPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-refPosterior)))))
 * 
 */
        __pyx_t_24 = (1.0 - __pyx_v_nonRefPosterior);
        __pyx_t_26 = 1e-10;
        if (((__pyx_t_24 > __pyx_t_26) != 0)) {
          __pyx_t_25 = __pyx_t_24;
        } else {
          __pyx_t_25 = __pyx_t_26;
        }
        __pyx_t_20 = PyFloat_FromDouble((-10.0 * log10(__pyx_t_25))); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_20);
        __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        __pyx_t_29 = 99;
        __pyx_t_13 = PyInt_FromLong(__pyx_t_29); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_20, __pyx_t_13, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_11) {
          __Pyx_INCREF(__pyx_t_20);
          __pyx_t_19 = __pyx_t_20;
        } else {
          __pyx_t_3 = PyInt_FromLong(__pyx_t_29); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_19 = __pyx_t_3;
          __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_INCREF(__pyx_t_19);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_19);
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_19 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_v_phredNonRefPosterior);
        __pyx_v_phredNonRefPosterior = __pyx_t_19;
        __pyx_t_19 = 0;

        /* "vcfutils.pyx":514
 *                 phredPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-genotypePosterior)))))
 *                 phredNonRefPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-nonRefPosterior)))))
 *                 phredRefPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-refPosterior)))))             # <<<<<<<<<<<<<<
 * 
 *                 if options.verbosity >= 3:
 */
        __pyx_t_25 = (1.0 - __pyx_v_refPosterior);
        __pyx_t_24 = 1e-10;
        if (((__pyx_t_25 > __pyx_t_24) != 0)) {
          __pyx_t_26 = __pyx_t_25;
        } else {
          __pyx_t_26 = __pyx_t_24;
        }
        __pyx_t_19 = PyFloat_FromDouble((-10.0 * log10(__pyx_t_26))); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
        __Pyx_GIVEREF(__pyx_t_19);
        __pyx_t_19 = 0;
        __pyx_t_19 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
        __pyx_t_29 = 99;
        __pyx_t_3 = PyInt_FromLong(__pyx_t_29); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = PyObject_RichCompare(__pyx_t_19, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__pyx_t_11) {
          __Pyx_INCREF(__pyx_t_19);
          __pyx_t_20 = __pyx_t_19;
        } else {
          __pyx_t_13 = PyInt_FromLong(__pyx_t_29); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_20 = __pyx_t_13;
          __pyx_t_13 = 0;
        }
        __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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __Pyx_INCREF(__pyx_t_20);
        PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20);
        __Pyx_GIVEREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_20 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_v_phredRefPosterior);
        __pyx_v_phredRefPosterior = __pyx_t_20;
        __pyx_t_20 = 0;

        /* "vcfutils.pyx":516
 *                 phredRefPosterior = int(min(99, round(-10.0*log10(max(1e-10, 1.0-refPosterior)))))
 * 
 *                 if options.verbosity >= 3:             # <<<<<<<<<<<<<<
 *                     logger.debug("Sample %s has genotype posterior = %s. non-ref posterior = %s. Ref posterior = %s." %(thisSample,phredPosterior, phredNonRefPosterior, phredRefPosterior))
 * 
 */
        __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__verbosity); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_19 = PyObject_RichCompare(__pyx_t_20, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        if (__pyx_t_11) {

          /* "vcfutils.pyx":517
 * 
 *                 if options.verbosity >= 3:
 *                     logger.debug("Sample %s has genotype posterior = %s. non-ref posterior = %s. Ref posterior = %s." %(thisSample,phredPosterior, phredNonRefPosterior, phredRefPosterior))             # <<<<<<<<<<<<<<
 * 
 *                 # Don't make a call if the non-ref posterior is too low
 */
          __pyx_t_19 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s__debug); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_19 = PyTuple_New(4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_INCREF(((PyObject *)__pyx_v_thisSample));
          PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_v_thisSample));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_thisSample));
          __Pyx_INCREF(__pyx_v_phredPosterior);
          PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_phredPosterior);
          __Pyx_GIVEREF(__pyx_v_phredPosterior);
          __Pyx_INCREF(__pyx_v_phredNonRefPosterior);
          PyTuple_SET_ITEM(__pyx_t_19, 2, __pyx_v_phredNonRefPosterior);
          __Pyx_GIVEREF(__pyx_v_phredNonRefPosterior);
          __Pyx_INCREF(__pyx_v_phredRefPosterior);
          PyTuple_SET_ITEM(__pyx_t_19, 3, __pyx_v_phredRefPosterior);
          __Pyx_GIVEREF(__pyx_v_phredRefPosterior);
          __pyx_t_13 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_t_19)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_13));
          __Pyx_DECREF(((PyObject *)__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 = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_t_13));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_t_19), NULL); 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_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L39;
        }
        __pyx_L39:;

        /* "vcfutils.pyx":520
 * 
 *                 # Don't make a call if the non-ref posterior is too low
 *                 if nVariants == 1 and phredNonRefPosterior < options.minPosterior and phredRefPosterior < options.minPosterior:             # <<<<<<<<<<<<<<
 *                     GT = [".", "/", "."]
 *                     maxLikelihood = max(likelihoods)
 */
        __pyx_t_11 = (__pyx_v_nVariants == 1);
        if (__pyx_t_11) {
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__minPosterior); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_19 = PyObject_RichCompare(__pyx_v_phredNonRefPosterior, __pyx_t_13, Py_LT); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          if (__pyx_t_27) {
            __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__minPosterior); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_13 = PyObject_RichCompare(__pyx_v_phredRefPosterior, __pyx_t_19, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_30 = __pyx_t_10;
          } else {
            __pyx_t_30 = __pyx_t_27;
          }
          __pyx_t_27 = __pyx_t_30;
        } else {
          __pyx_t_27 = __pyx_t_11;
        }
        if (__pyx_t_27) {

          /* "vcfutils.pyx":521
 *                 # Don't make a call if the non-ref posterior is too low
 *                 if nVariants == 1 and phredNonRefPosterior < options.minPosterior and phredRefPosterior < options.minPosterior:
 *                     GT = [".", "/", "."]             # <<<<<<<<<<<<<<
 *                     maxLikelihood = max(likelihoods)
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]
 */
          __pyx_t_13 = PyList_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
          PyList_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_kp_s_10));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
          PyList_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_kp_s_12));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
          PyList_SET_ITEM(__pyx_t_13, 2, ((PyObject *)__pyx_kp_s_10));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
          __Pyx_DECREF(((PyObject *)__pyx_v_GT));
          __pyx_v_GT = ((PyObject*)__pyx_t_13);
          __pyx_t_13 = 0;

          /* "vcfutils.pyx":522
 *                 if nVariants == 1 and phredNonRefPosterior < options.minPosterior and phredRefPosterior < options.minPosterior:
 *                     GT = [".", "/", "."]
 *                     maxLikelihood = max(likelihoods)             # <<<<<<<<<<<<<<
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]
 * 
 */
          __pyx_t_13 = PyTuple_New(1); 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_INCREF(((PyObject *)__pyx_v_likelihoods));
          PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_likelihoods));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_likelihoods));
          __pyx_t_19 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_v_maxLikelihood = __pyx_t_26;

          /* "vcfutils.pyx":523
 *                     GT = [".", "/", "."]
 *                     maxLikelihood = max(likelihoods)
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]             # <<<<<<<<<<<<<<
 * 
 *                 elif nVariants == 1 and phredNonRefPosterior < options.minPosterior:
 */
          __pyx_t_19 = PyList_New(0); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          if (unlikely(((PyObject *)__pyx_v_likelihoods) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_13 = ((PyObject *)__pyx_v_likelihoods); __Pyx_INCREF(__pyx_t_13); __pyx_t_5 = 0;
          for (;;) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_13)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_20 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_5); __Pyx_INCREF(__pyx_t_20); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_20 = PySequence_ITEM(__pyx_t_13, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
            __Pyx_XDECREF(__pyx_v_x);
            __pyx_v_x = __pyx_t_20;
            __pyx_t_20 = 0;
            __pyx_t_26 = 1e-300;
            __pyx_t_20 = PyFloat_FromDouble(__pyx_v_maxLikelihood); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_x, __pyx_t_20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_18 = PyFloat_FromDouble(__pyx_t_26); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_18);
            __pyx_t_9 = PyObject_RichCompare(__pyx_t_18, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (__pyx_t_27) {
              __pyx_t_9 = PyFloat_FromDouble(__pyx_t_26); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_20 = __pyx_t_9;
              __pyx_t_9 = 0;
            } else {
              __Pyx_INCREF(__pyx_t_3);
              __pyx_t_20 = __pyx_t_3;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_20 = PyFloat_FromDouble(log10(__pyx_t_26)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20);
            __Pyx_GIVEREF(__pyx_t_20);
            __Pyx_INCREF(__pyx_int_2);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2);
            __Pyx_GIVEREF(__pyx_int_2);
            __pyx_t_20 = 0;
            __pyx_t_20 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_19, (PyObject*)__pyx_t_20))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(((PyObject *)__pyx_v_normalisedGLs));
          __pyx_v_normalisedGLs = ((PyObject*)__pyx_t_19);
          __pyx_t_19 = 0;
          goto __pyx_L40;
        }

        /* "vcfutils.pyx":525
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]
 * 
 *                 elif nVariants == 1 and phredNonRefPosterior < options.minPosterior:             # <<<<<<<<<<<<<<
 *                     GT = ["0", "/", "0"]
 *                     maxLikelihood = max(likelihoods)
 */
        __pyx_t_27 = (__pyx_v_nVariants == 1);
        if (__pyx_t_27) {
          __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__minPosterior); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __pyx_t_13 = PyObject_RichCompare(__pyx_v_phredNonRefPosterior, __pyx_t_19, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_30 = __pyx_t_11;
        } else {
          __pyx_t_30 = __pyx_t_27;
        }
        if (__pyx_t_30) {

          /* "vcfutils.pyx":526
 * 
 *                 elif nVariants == 1 and phredNonRefPosterior < options.minPosterior:
 *                     GT = ["0", "/", "0"]             # <<<<<<<<<<<<<<
 *                     maxLikelihood = max(likelihoods)
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]
 */
          __pyx_t_13 = PyList_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(((PyObject *)__pyx_kp_s__0));
          PyList_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_kp_s__0));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s__0));
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
          PyList_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_kp_s_12));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
          __Pyx_INCREF(((PyObject *)__pyx_kp_s__0));
          PyList_SET_ITEM(__pyx_t_13, 2, ((PyObject *)__pyx_kp_s__0));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s__0));
          __Pyx_DECREF(((PyObject *)__pyx_v_GT));
          __pyx_v_GT = ((PyObject*)__pyx_t_13);
          __pyx_t_13 = 0;

          /* "vcfutils.pyx":527
 *                 elif nVariants == 1 and phredNonRefPosterior < options.minPosterior:
 *                     GT = ["0", "/", "0"]
 *                     maxLikelihood = max(likelihoods)             # <<<<<<<<<<<<<<
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]
 * 
 */
          __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(((PyObject *)__pyx_v_likelihoods));
          PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_likelihoods));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_likelihoods));
          __pyx_t_19 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_v_maxLikelihood = __pyx_t_26;

          /* "vcfutils.pyx":528
 *                     GT = ["0", "/", "0"]
 *                     maxLikelihood = max(likelihoods)
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]             # <<<<<<<<<<<<<<
 * 
 *                 # Only normalise for sites which are not mult-allelic
 */
          __pyx_t_19 = PyList_New(0); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          if (unlikely(((PyObject *)__pyx_v_likelihoods) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_13 = ((PyObject *)__pyx_v_likelihoods); __Pyx_INCREF(__pyx_t_13); __pyx_t_5 = 0;
          for (;;) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_13)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_20 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_5); __Pyx_INCREF(__pyx_t_20); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_20 = PySequence_ITEM(__pyx_t_13, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
            __Pyx_XDECREF(__pyx_v_x);
            __pyx_v_x = __pyx_t_20;
            __pyx_t_20 = 0;
            __pyx_t_26 = 1e-300;
            __pyx_t_20 = PyFloat_FromDouble(__pyx_v_maxLikelihood); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_x, __pyx_t_20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_9 = PyFloat_FromDouble(__pyx_t_26); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_18 = PyObject_RichCompare(__pyx_t_9, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            if (__pyx_t_30) {
              __pyx_t_18 = PyFloat_FromDouble(__pyx_t_26); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_18);
              __pyx_t_20 = __pyx_t_18;
              __pyx_t_18 = 0;
            } else {
              __Pyx_INCREF(__pyx_t_3);
              __pyx_t_20 = __pyx_t_3;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_20 = PyFloat_FromDouble(log10(__pyx_t_26)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20);
            __Pyx_GIVEREF(__pyx_t_20);
            __Pyx_INCREF(__pyx_int_2);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2);
            __Pyx_GIVEREF(__pyx_int_2);
            __pyx_t_20 = 0;
            __pyx_t_20 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_19, (PyObject*)__pyx_t_20))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          }
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(((PyObject *)__pyx_v_normalisedGLs));
          __pyx_v_normalisedGLs = ((PyObject*)__pyx_t_19);
          __pyx_t_19 = 0;
          goto __pyx_L40;
        }

        /* "vcfutils.pyx":531
 * 
 *                 # Only normalise for sites which are not mult-allelic
 *                 elif nVariants == 1:             # <<<<<<<<<<<<<<
 *                     maxLikelihood = max(likelihoods)
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]
 */
        __pyx_t_30 = ((__pyx_v_nVariants == 1) != 0);
        if (__pyx_t_30) {

          /* "vcfutils.pyx":532
 *                 # Only normalise for sites which are not mult-allelic
 *                 elif nVariants == 1:
 *                     maxLikelihood = max(likelihoods)             # <<<<<<<<<<<<<<
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]
 * 
 */
          __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_19);
          __Pyx_INCREF(((PyObject *)__pyx_v_likelihoods));
          PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_v_likelihoods));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_likelihoods));
          __pyx_t_13 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
          __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_v_maxLikelihood = __pyx_t_26;

          /* "vcfutils.pyx":533
 *                 elif nVariants == 1:
 *                     maxLikelihood = max(likelihoods)
 *                     normalisedGLs = [round(log10(max(x / maxLikelihood, 1e-300)),2) for x in likelihoods]             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
          __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          if (unlikely(((PyObject *)__pyx_v_likelihoods) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_19 = ((PyObject *)__pyx_v_likelihoods); __Pyx_INCREF(__pyx_t_19); __pyx_t_5 = 0;
          for (;;) {
            if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_19)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_20 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_5); __Pyx_INCREF(__pyx_t_20); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_20 = PySequence_ITEM(__pyx_t_19, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
            __Pyx_XDECREF(__pyx_v_x);
            __pyx_v_x = __pyx_t_20;
            __pyx_t_20 = 0;
            __pyx_t_26 = 1e-300;
            __pyx_t_20 = PyFloat_FromDouble(__pyx_v_maxLikelihood); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_x, __pyx_t_20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_18 = PyFloat_FromDouble(__pyx_t_26); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_18);
            __pyx_t_9 = PyObject_RichCompare(__pyx_t_18, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (__pyx_t_30) {
              __pyx_t_9 = PyFloat_FromDouble(__pyx_t_26); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_20 = __pyx_t_9;
              __pyx_t_9 = 0;
            } else {
              __Pyx_INCREF(__pyx_t_3);
              __pyx_t_20 = __pyx_t_3;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_26 = __pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_26 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_20 = PyFloat_FromDouble(log10(__pyx_t_26)); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_20);
            __Pyx_GIVEREF(__pyx_t_20);
            __Pyx_INCREF(__pyx_int_2);
            PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2);
            __Pyx_GIVEREF(__pyx_int_2);
            __pyx_t_20 = 0;
            __pyx_t_20 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_20))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          }
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __Pyx_XDECREF(((PyObject *)__pyx_v_normalisedGLs));
          __pyx_v_normalisedGLs = ((PyObject*)__pyx_t_13);
          __pyx_t_13 = 0;
          goto __pyx_L40;
        }
        /*else*/ {

          /* "vcfutils.pyx":537
 *                 else:
 *                     # Multi-allelic site. Don't compute likelihoods here.
 *                     normalisedGLs = [-1,-1,-1]             # <<<<<<<<<<<<<<
 * 
 *                 readsPerSample = [vcfInfo[v]['nReadsPerSample'][i] for v in variants]
 */
          __pyx_t_13 = PyList_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_int_neg_1);
          PyList_SET_ITEM(__pyx_t_13, 0, __pyx_int_neg_1);
          __Pyx_GIVEREF(__pyx_int_neg_1);
          __Pyx_INCREF(__pyx_int_neg_1);
          PyList_SET_ITEM(__pyx_t_13, 1, __pyx_int_neg_1);
          __Pyx_GIVEREF(__pyx_int_neg_1);
          __Pyx_INCREF(__pyx_int_neg_1);
          PyList_SET_ITEM(__pyx_t_13, 2, __pyx_int_neg_1);
          __Pyx_GIVEREF(__pyx_int_neg_1);
          __Pyx_XDECREF(((PyObject *)__pyx_v_normalisedGLs));
          __pyx_v_normalisedGLs = ((PyObject*)__pyx_t_13);
          __pyx_t_13 = 0;
        }
        __pyx_L40:;

        /* "vcfutils.pyx":539
 *                     normalisedGLs = [-1,-1,-1]
 * 
 *                 readsPerSample = [vcfInfo[v]['nReadsPerSample'][i] for v in variants]             # <<<<<<<<<<<<<<
 *                 varReadsPerSample = [vcfInfo[v]['nVarReadsPerSample'][i] for v in variants]
 * 
 */
        __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_19 = ((PyObject *)__pyx_v_variants); __Pyx_INCREF(__pyx_t_19); __pyx_t_5 = 0;
        for (;;) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_19)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_20 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_5); __Pyx_INCREF(__pyx_t_20); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_20 = PySequence_ITEM(__pyx_t_19, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
          __Pyx_XDECREF(__pyx_v_v);
          __pyx_v_v = __pyx_t_20;
          __pyx_t_20 = 0;
          if (unlikely(((PyObject *)__pyx_v_vcfInfo) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_20 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfInfo), __pyx_v_v); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_3 = PyObject_GetItem(__pyx_t_20, ((PyObject *)__pyx_n_s__nReadsPerSample)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_20 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 0); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_20))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(((PyObject *)__pyx_v_readsPerSample));
        __pyx_v_readsPerSample = ((PyObject*)__pyx_t_13);
        __pyx_t_13 = 0;

        /* "vcfutils.pyx":540
 * 
 *                 readsPerSample = [vcfInfo[v]['nReadsPerSample'][i] for v in variants]
 *                 varReadsPerSample = [vcfInfo[v]['nVarReadsPerSample'][i] for v in variants]             # <<<<<<<<<<<<<<
 * 
 *                 #vcfDataLine[thisSample] = dict(GT=[GT], GL=normalisedGLs, GQ=[phredPosterior], GOF=[min(99,int(0.5 + -10.0*log10(max(1e-10, 1.0 - round(gofValue,2)))))],NR=readsPerSample, NV=varReadsPerSample)
 */
        __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_19 = ((PyObject *)__pyx_v_variants); __Pyx_INCREF(__pyx_t_19); __pyx_t_5 = 0;
        for (;;) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_19)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_20 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_5); __Pyx_INCREF(__pyx_t_20); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_20 = PySequence_ITEM(__pyx_t_19, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
          __Pyx_XDECREF(__pyx_v_v);
          __pyx_v_v = __pyx_t_20;
          __pyx_t_20 = 0;
          if (unlikely(((PyObject *)__pyx_v_vcfInfo) == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          __pyx_t_20 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfInfo), __pyx_v_v); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_3 = PyObject_GetItem(__pyx_t_20, ((PyObject *)__pyx_n_s__nVarReadsPerSample)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_20 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 0); if (!__pyx_t_20) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_13, (PyObject*)__pyx_t_20))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        }
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(((PyObject *)__pyx_v_varReadsPerSample));
        __pyx_v_varReadsPerSample = ((PyObject*)__pyx_t_13);
        __pyx_t_13 = 0;

        /* "vcfutils.pyx":545
 * 
 *                 # Actual nReads covering variant locus
 *                 if nVariants == 1 and readsPerSample[0] < options.minReads:             # <<<<<<<<<<<<<<
 *                     vcfDataLine[thisSample] = dict(GT=[[".", "/", "."]], GL=normalisedGLs, GQ=[phredPosterior],GOF=[int(gofValue)],NR=readsPerSample, NV=varReadsPerSample)
 *                 else:
 */
        __pyx_t_30 = (__pyx_v_nVariants == 1);
        if (__pyx_t_30) {
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__minReads); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_19 = PyObject_RichCompare(PyList_GET_ITEM(__pyx_v_readsPerSample, 0), __pyx_t_13, Py_LT); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
          __pyx_t_11 = __pyx_t_27;
        } else {
          __pyx_t_11 = __pyx_t_30;
        }
        if (__pyx_t_11) {

          /* "vcfutils.pyx":546
 *                 # Actual nReads covering variant locus
 *                 if nVariants == 1 and readsPerSample[0] < options.minReads:
 *                     vcfDataLine[thisSample] = dict(GT=[[".", "/", "."]], GL=normalisedGLs, GQ=[phredPosterior],GOF=[int(gofValue)],NR=readsPerSample, NV=varReadsPerSample)             # <<<<<<<<<<<<<<
 *                 else:
 *                     vcfDataLine[thisSample] = dict(GT=[GT], GL=normalisedGLs, GQ=[phredPosterior], GOF=[int(gofValue)],NR=readsPerSample, NV=varReadsPerSample)
 */
          __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_19));
          __pyx_t_13 = PyList_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
          PyList_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_kp_s_10));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_12));
          PyList_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_kp_s_12));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12));
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
          PyList_SET_ITEM(__pyx_t_13, 2, ((PyObject *)__pyx_kp_s_10));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
          __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          PyList_SET_ITEM(__pyx_t_20, 0, ((PyObject *)__pyx_t_13));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
          __pyx_t_13 = 0;
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__GT), ((PyObject *)__pyx_t_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__GL), ((PyObject *)__pyx_v_normalisedGLs)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_INCREF(__pyx_v_phredPosterior);
          PyList_SET_ITEM(__pyx_t_20, 0, __pyx_v_phredPosterior);
          __Pyx_GIVEREF(__pyx_v_phredPosterior);
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__GQ), ((PyObject *)__pyx_t_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
          __pyx_t_20 = PyFloat_FromDouble(__pyx_v_gofValue); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_20);
          __Pyx_GIVEREF(__pyx_t_20);
          __pyx_t_20 = 0;
          __pyx_t_20 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_20);
          __Pyx_GIVEREF(__pyx_t_20);
          __pyx_t_20 = 0;
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__GOF), ((PyObject *)__pyx_t_13)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__NR), ((PyObject *)__pyx_v_readsPerSample)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__NV), ((PyObject *)__pyx_v_varReadsPerSample)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_v_thisSample), ((PyObject *)__pyx_t_19)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
          goto __pyx_L51;
        }
        /*else*/ {

          /* "vcfutils.pyx":548
 *                     vcfDataLine[thisSample] = dict(GT=[[".", "/", "."]], GL=normalisedGLs, GQ=[phredPosterior],GOF=[int(gofValue)],NR=readsPerSample, NV=varReadsPerSample)
 *                 else:
 *                     vcfDataLine[thisSample] = dict(GT=[GT], GL=normalisedGLs, GQ=[phredPosterior], GOF=[int(gofValue)],NR=readsPerSample, NV=varReadsPerSample)             # <<<<<<<<<<<<<<
 * 
 *                 if gofValue > maxGofValue:
 */
          __pyx_t_19 = PyDict_New(); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_19));
          __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(((PyObject *)__pyx_v_GT));
          PyList_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_GT));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_GT));
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__GT), ((PyObject *)__pyx_t_13)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__GL), ((PyObject *)__pyx_v_normalisedGLs)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_v_phredPosterior);
          PyList_SET_ITEM(__pyx_t_13, 0, __pyx_v_phredPosterior);
          __Pyx_GIVEREF(__pyx_v_phredPosterior);
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__GQ), ((PyObject *)__pyx_t_13)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          __pyx_t_13 = PyFloat_FromDouble(__pyx_v_gofValue); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
          __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          PyList_SET_ITEM(__pyx_t_20, 0, __pyx_t_13);
          __Pyx_GIVEREF(__pyx_t_13);
          __pyx_t_13 = 0;
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__GOF), ((PyObject *)__pyx_t_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__NR), ((PyObject *)__pyx_v_readsPerSample)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__NV), ((PyObject *)__pyx_v_varReadsPerSample)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          if (PyDict_SetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_v_thisSample), ((PyObject *)__pyx_t_19)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
        }
        __pyx_L51:;

        /* "vcfutils.pyx":550
 *                     vcfDataLine[thisSample] = dict(GT=[GT], GL=normalisedGLs, GQ=[phredPosterior], GOF=[int(gofValue)],NR=readsPerSample, NV=varReadsPerSample)
 * 
 *                 if gofValue > maxGofValue:             # <<<<<<<<<<<<<<
 *                     maxGofValue = gofValue
 * 
 */
        __pyx_t_11 = ((__pyx_v_gofValue > __pyx_v_maxGofValue) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":551
 * 
 *                 if gofValue > maxGofValue:
 *                     maxGofValue = gofValue             # <<<<<<<<<<<<<<
 * 
 *                 if gofValue < minGofValue:
 */
          __pyx_v_maxGofValue = __pyx_v_gofValue;
          goto __pyx_L52;
        }
        __pyx_L52:;

        /* "vcfutils.pyx":553
 *                     maxGofValue = gofValue
 * 
 *                 if gofValue < minGofValue:             # <<<<<<<<<<<<<<
 *                     minGofValue = gofValue
 * 
 */
        __pyx_t_11 = ((__pyx_v_gofValue < __pyx_v_minGofValue) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":554
 * 
 *                 if gofValue < minGofValue:
 *                     minGofValue = gofValue             # <<<<<<<<<<<<<<
 * 
 *         # These are just temporary values. Don't output them
 */
          __pyx_v_minGofValue = __pyx_v_gofValue;
          goto __pyx_L53;
        }
        __pyx_L53:;
      }
      __pyx_L35:;
      __pyx_L33_continue:;
    }

    /* "vcfutils.pyx":557
 * 
 *         # These are just temporary values. Don't output them
 *         vcfDataLine['info'].pop('nReadsPerSample')             # <<<<<<<<<<<<<<
 *         vcfDataLine['info'].pop('nVarReadsPerSample')
 *         vcfDataLine['info'].pop('ABPV')
 */
    __pyx_t_19 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__info)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s__pop); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

    /* "vcfutils.pyx":558
 *         # These are just temporary values. Don't output them
 *         vcfDataLine['info'].pop('nReadsPerSample')
 *         vcfDataLine['info'].pop('nVarReadsPerSample')             # <<<<<<<<<<<<<<
 *         vcfDataLine['info'].pop('ABPV')
 *         vcfDataLine['info']['MGOF'] = [int(round(maxGofValue, 2))]
 */
    __pyx_t_19 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__info)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s__pop); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

    /* "vcfutils.pyx":559
 *         vcfDataLine['info'].pop('nReadsPerSample')
 *         vcfDataLine['info'].pop('nVarReadsPerSample')
 *         vcfDataLine['info'].pop('ABPV')             # <<<<<<<<<<<<<<
 *         vcfDataLine['info']['MGOF'] = [int(round(maxGofValue, 2))]
 * 
 */
    __pyx_t_19 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__info)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s__pop); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __pyx_t_19 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

    /* "vcfutils.pyx":560
 *         vcfDataLine['info'].pop('nVarReadsPerSample')
 *         vcfDataLine['info'].pop('ABPV')
 *         vcfDataLine['info']['MGOF'] = [int(round(maxGofValue, 2))]             # <<<<<<<<<<<<<<
 * 
 *         gofsThisPos.sort()
 */
    __pyx_t_19 = PyFloat_FromDouble(__pyx_v_maxGofValue); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
    __Pyx_GIVEREF(__pyx_t_19);
    __Pyx_INCREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    __pyx_t_19 = 0;
    __pyx_t_19 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
    __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
    __Pyx_GIVEREF(__pyx_t_19);
    __pyx_t_19 = 0;
    __pyx_t_19 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_20), NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;
    __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_20);
    PyList_SET_ITEM(__pyx_t_20, 0, __pyx_t_19);
    __Pyx_GIVEREF(__pyx_t_19);
    __pyx_t_19 = 0;
    __pyx_t_19 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__info)); if (!__pyx_t_19) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_19);
    if (PyObject_SetItem(__pyx_t_19, ((PyObject *)__pyx_n_s__MGOF), ((PyObject *)__pyx_t_20)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_20)); __pyx_t_20 = 0;

    /* "vcfutils.pyx":562
 *         vcfDataLine['info']['MGOF'] = [int(round(maxGofValue, 2))]
 * 
 *         gofsThisPos.sort()             # <<<<<<<<<<<<<<
 * 
 *         #if minGofValue > gofThreshold:
 */
    __pyx_t_28 = PyList_Sort(((PyObject *)__pyx_v_gofsThisPos)); if (unlikely(__pyx_t_28 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":571
 * 
 *         # Write variant call info to VCF file.
 *         if nNonRefCalls > 0 or options.minPosterior == 0 or options.outputRefCalls == 1:             # <<<<<<<<<<<<<<
 * 
 *             # Slight hack. We pad variant alleles to the left with reference sequence, when
 */
    __pyx_t_20 = PyObject_RichCompare(__pyx_v_nNonRefCalls, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
    if (!__pyx_t_11) {
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__minPosterior); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_19 = PyObject_RichCompare(__pyx_t_20, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_30 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      if (!__pyx_t_30) {
        __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__outputRefCalls); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_20 = PyObject_RichCompare(__pyx_t_19, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_20); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_20); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __pyx_t_10 = __pyx_t_27;
      } else {
        __pyx_t_10 = __pyx_t_30;
      }
      __pyx_t_30 = __pyx_t_10;
    } else {
      __pyx_t_30 = __pyx_t_11;
    }
    if (__pyx_t_30) {

      /* "vcfutils.pyx":579
 *             # left should be un-padded.
 *             #logger.info("Variants = %s" %(variants))
 *             trimLeftPadding(vcfDataLine)             # <<<<<<<<<<<<<<
 * 
 *             # Don't output if the reference bases are non-canonical
 */
      __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s__trimLeftPadding); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_INCREF(((PyObject *)__pyx_v_vcfDataLine));
      PyTuple_SET_ITEM(__pyx_t_19, 0, ((PyObject *)__pyx_v_vcfDataLine));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_vcfDataLine));
      __pyx_t_13 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_t_19), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_19)); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

      /* "vcfutils.pyx":582
 * 
 *             # Don't output if the reference bases are non-canonical
 *             for c in vcfDataLine['ref']:             # <<<<<<<<<<<<<<
 * 
 *                 if c not in canonicalBases:
 */
      __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__ref)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      if (PyList_CheckExact(__pyx_t_13) || PyTuple_CheckExact(__pyx_t_13)) {
        __pyx_t_19 = __pyx_t_13; __Pyx_INCREF(__pyx_t_19); __pyx_t_5 = 0;
        __pyx_t_15 = NULL;
      } else {
        __pyx_t_5 = -1; __pyx_t_19 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_19);
        __pyx_t_15 = Py_TYPE(__pyx_t_19)->tp_iternext;
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      for (;;) {
        if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_19)) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_19)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_13 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_5); __Pyx_INCREF(__pyx_t_13); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_13 = PySequence_ITEM(__pyx_t_19, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_19)) {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_19)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_19, __pyx_t_5); __Pyx_INCREF(__pyx_t_13); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_13 = PySequence_ITEM(__pyx_t_19, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_13 = __pyx_t_15(__pyx_t_19);
          if (unlikely(!__pyx_t_13)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_XDECREF(__pyx_v_c);
        __pyx_v_c = __pyx_t_13;
        __pyx_t_13 = 0;

        /* "vcfutils.pyx":584
 *             for c in vcfDataLine['ref']:
 * 
 *                 if c not in canonicalBases:             # <<<<<<<<<<<<<<
 *                     theChrom = vcfDataLine['chrom']
 *                     thePos = vcfDataLine['pos']
 */
        __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s__canonicalBases); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_30 = (__Pyx_PySequence_Contains(__pyx_v_c, __pyx_t_13, Py_NE)); if (unlikely(__pyx_t_30 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_11 = (__pyx_t_30 != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":585
 * 
 *                 if c not in canonicalBases:
 *                     theChrom = vcfDataLine['chrom']             # <<<<<<<<<<<<<<
 *                     thePos = vcfDataLine['pos']
 *                     theRef = vcfDataLine['ref']
 */
          __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__chrom)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF(__pyx_v_theChrom);
          __pyx_v_theChrom = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "vcfutils.pyx":586
 *                 if c not in canonicalBases:
 *                     theChrom = vcfDataLine['chrom']
 *                     thePos = vcfDataLine['pos']             # <<<<<<<<<<<<<<
 *                     theRef = vcfDataLine['ref']
 *                     theAlt = vcfDataLine['alt']
 */
          __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__pos)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF(__pyx_v_thePos);
          __pyx_v_thePos = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "vcfutils.pyx":587
 *                     theChrom = vcfDataLine['chrom']
 *                     thePos = vcfDataLine['pos']
 *                     theRef = vcfDataLine['ref']             # <<<<<<<<<<<<<<
 *                     theAlt = vcfDataLine['alt']
 *                     logger.warning("Skipping output for call %s:%s %s --> %s, as the reference sequence contains non-canonical bases (i.e. not A,C,T,G)" %(theChrom,thePos,theRef,theAlt))
 */
          __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__ref)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF(__pyx_v_theRef);
          __pyx_v_theRef = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "vcfutils.pyx":588
 *                     thePos = vcfDataLine['pos']
 *                     theRef = vcfDataLine['ref']
 *                     theAlt = vcfDataLine['alt']             # <<<<<<<<<<<<<<
 *                     logger.warning("Skipping output for call %s:%s %s --> %s, as the reference sequence contains non-canonical bases (i.e. not A,C,T,G)" %(theChrom,thePos,theRef,theAlt))
 *                     break
 */
          __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfDataLine), ((PyObject *)__pyx_n_s__alt)); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF(__pyx_v_theAlt);
          __pyx_v_theAlt = __pyx_t_13;
          __pyx_t_13 = 0;

          /* "vcfutils.pyx":589
 *                     theRef = vcfDataLine['ref']
 *                     theAlt = vcfDataLine['alt']
 *                     logger.warning("Skipping output for call %s:%s %s --> %s, as the reference sequence contains non-canonical bases (i.e. not A,C,T,G)" %(theChrom,thePos,theRef,theAlt))             # <<<<<<<<<<<<<<
 *                     break
 *             else:
 */
          __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s__warning); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_v_theChrom);
          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_theChrom);
          __Pyx_GIVEREF(__pyx_v_theChrom);
          __Pyx_INCREF(__pyx_v_thePos);
          PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_thePos);
          __Pyx_GIVEREF(__pyx_v_thePos);
          __Pyx_INCREF(__pyx_v_theRef);
          PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_theRef);
          __Pyx_GIVEREF(__pyx_v_theRef);
          __Pyx_INCREF(__pyx_v_theAlt);
          PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_v_theAlt);
          __Pyx_GIVEREF(__pyx_v_theAlt);
          __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), ((PyObject *)__pyx_t_13)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_3));
          __Pyx_DECREF(((PyObject *)__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 = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_t_3));
          __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
          __pyx_t_3 = 0;
          __pyx_t_3 = PyObject_Call(__pyx_t_20, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "vcfutils.pyx":590
 *                     theAlt = vcfDataLine['alt']
 *                     logger.warning("Skipping output for call %s:%s %s --> %s, as the reference sequence contains non-canonical bases (i.e. not A,C,T,G)" %(theChrom,thePos,theRef,theAlt))
 *                     break             # <<<<<<<<<<<<<<
 *             else:
 *                 outputSingleLineOfVCF(vcfDataLine, outputFile, vcfFile, options)
 */
          goto __pyx_L56_break;
          goto __pyx_L57;
        }
        __pyx_L57:;
      }
      /*else*/ {

        /* "vcfutils.pyx":592
 *                     break
 *             else:
 *                 outputSingleLineOfVCF(vcfDataLine, outputFile, vcfFile, options)             # <<<<<<<<<<<<<<
 * 
 *     # Free memory. (TODO: move this somewhere else).
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_INCREF(((PyObject *)__pyx_v_vcfDataLine));
        PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_v_vcfDataLine));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_vcfDataLine));
        __Pyx_INCREF(__pyx_v_outputFile);
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_outputFile);
        __Pyx_GIVEREF(__pyx_v_outputFile);
        __Pyx_INCREF(__pyx_v_vcfFile);
        PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_v_vcfFile);
        __Pyx_GIVEREF(__pyx_v_vcfFile);
        __Pyx_INCREF(__pyx_v_options);
        PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_v_options);
        __Pyx_GIVEREF(__pyx_v_options);
        __pyx_t_20 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      }
      __pyx_L56_break:;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      goto __pyx_L54;
    }
    __pyx_L54:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vcfutils.pyx":595
 * 
 *     # Free memory. (TODO: move this somewhere else).
 *     for hapIndex in range(len(haplotypes)):             # <<<<<<<<<<<<<<
 *         free(varThisPosInHap[hapIndex])
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_haplotypes)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_4; __pyx_t_2+=1) {
    __pyx_v_hapIndex = __pyx_t_2;

    /* "vcfutils.pyx":596
 *     # Free memory. (TODO: move this somewhere else).
 *     for hapIndex in range(len(haplotypes)):
 *         free(varThisPosInHap[hapIndex])             # <<<<<<<<<<<<<<
 * 
 *     free(varThisPosInHap)
 */
    free((__pyx_v_varThisPosInHap[__pyx_v_hapIndex]));
  }

  /* "vcfutils.pyx":598
 *         free(varThisPosInHap[hapIndex])
 * 
 *     free(varThisPosInHap)             # <<<<<<<<<<<<<<
 *     free(haplotypeIsRefAtThisPos)
 * 
 */
  free(__pyx_v_varThisPosInHap);

  /* "vcfutils.pyx":599
 * 
 *     free(varThisPosInHap)
 *     free(haplotypeIsRefAtThisPos)             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  free(__pyx_v_haplotypeIsRefAtThisPos);

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_WriteUnraisable("vcfutils.outputCallToVCF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_haplotype);
  __Pyx_XDECREF((PyObject *)__pyx_v_theBuffer);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_lineinfo);
  __Pyx_XDECREF(__pyx_v_normalisedGLs);
  __Pyx_XDECREF(__pyx_v_FR);
  __Pyx_XDECREF(__pyx_v_PP);
  __Pyx_XDECREF(__pyx_v_NF);
  __Pyx_XDECREF(__pyx_v_NR);
  __Pyx_XDECREF(__pyx_v_TR);
  __Pyx_XDECREF(__pyx_v_GT);
  __Pyx_XDECREF(__pyx_v_linefilter);
  __Pyx_XDECREF(__pyx_v_thisSample);
  __Pyx_XDECREF(__pyx_v_sortedPositions);
  __Pyx_XDECREF(__pyx_v_variants);
  __Pyx_XDECREF(__pyx_v_likelihoods);
  __Pyx_XDECREF(__pyx_v_variantsThisPos);
  __Pyx_XDECREF(__pyx_v_POS);
  __Pyx_XDECREF(__pyx_v_variant);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_ref);
  __Pyx_XDECREF(__pyx_v_alt);
  __Pyx_XDECREF(__pyx_v_theId);
  __Pyx_XDECREF(__pyx_v_qual);
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_XDECREF(__pyx_v_var);
  __Pyx_XDECREF(__pyx_v_freq);
  __Pyx_XDECREF(__pyx_v_posterior);
  __Pyx_XDECREF(__pyx_v_varTR);
  __Pyx_XDECREF(__pyx_v_varNF);
  __Pyx_XDECREF(__pyx_v_varNR);
  __Pyx_XDECREF(__pyx_v_vcfDataLine);
  __Pyx_XDECREF(__pyx_v_theVar);
  __Pyx_XDECREF(__pyx_v_gofsThisPos);
  __Pyx_XDECREF(__pyx_v_nNonRefCalls);
  __Pyx_XDECREF(__pyx_v_phredPosterior);
  __Pyx_XDECREF(__pyx_v_phredNonRefPosterior);
  __Pyx_XDECREF(__pyx_v_phredRefPosterior);
  __Pyx_XDECREF(__pyx_v_readsPerSample);
  __Pyx_XDECREF(__pyx_v_varReadsPerSample);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_theChrom);
  __Pyx_XDECREF(__pyx_v_thePos);
  __Pyx_XDECREF(__pyx_v_theRef);
  __Pyx_XDECREF(__pyx_v_theAlt);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_pp);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_RefNannyFinishContext();
}

/* "vcfutils.pyx":602
 * 
 * ###################################################################################################
 * cdef void outputHLACallToVCF(list haplotypes, list readBuffers, int nIndividuals, FastaFile refFile, outputFile, options, int windowStart, int windowEnd):             # <<<<<<<<<<<<<<
 *     """
 *     Output a call to a vcf file. Uses the signature of the callingModule.
 */

static void __pyx_f_8vcfutils_outputHLACallToVCF(PyObject *__pyx_v_haplotypes, PyObject *__pyx_v_readBuffers, int __pyx_v_nIndividuals, CYTHON_UNUSED struct __pyx_obj_9fastafile_FastaFile *__pyx_v_refFile, PyObject *__pyx_v_outputFile, PyObject *__pyx_v_options, int __pyx_v_windowStart, int __pyx_v_windowEnd) {
  struct __pyx_obj_10chaplotype_Haplotype *__pyx_v_haplotype = 0;
  struct __pyx_obj_7cwindow_bamReadBuffer *__pyx_v_theBuffer = 0;
  CYTHON_UNUSED PyObject *__pyx_v_thisSample = 0;
  struct __pyx_obj_7variant_Variant *__pyx_v_longVar = 0;
  PyObject *__pyx_v_chrom = NULL;
  PyObject *__pyx_v_alts = NULL;
  int __pyx_v_index;
  PyObject *__pyx_v_indexOfBestGenotype = 0;
  double __pyx_v_likelihoodThisGenotype;
  double __pyx_v_maxEMLikelihood;
  struct __pyx_obj_9cgenotype_DiploidGenotype *__pyx_v_gt = 0;
  int __pyx_v_nHaplotypes;
  int __pyx_v_hapIndex1;
  int __pyx_v_hapIndex2;
  PyObject *__pyx_v_genotypeCalls = 0;
  int __pyx_v_nReads;
  PyObject *__pyx_v_allGTs = 0;
  PyObject *__pyx_v_thisGTs = 0;
  PyObject *__pyx_v_GLs = 0;
  PyObject *__pyx_v_NRs = 0;
  PyObject *__pyx_v_NV1s = 0;
  PyObject *__pyx_v_NV2s = 0;
  PyObject *__pyx_v_CFs = 0;
  PyObject *__pyx_v_secondMaxCandidates = 0;
  double __pyx_v_secondMaxLikelihood;
  int __pyx_v_nv1;
  int __pyx_v_nv2;
  int __pyx_v_readIndex;
  CYTHON_UNUSED int __pyx_v_totalReads;
  int __pyx_v_nBadReads;
  int __pyx_v_nBrokenPairReads;
  double *__pyx_v_alignScoreArr1;
  double *__pyx_v_alignScoreArr2;
  struct __pyx_obj_10chaplotype_Haplotype *__pyx_v_hap1 = 0;
  struct __pyx_obj_10chaplotype_Haplotype *__pyx_v_hap2 = 0;
  PyObject *__pyx_v_thisNV1 = 0;
  PyObject *__pyx_v_thisNV2 = 0;
  double *__pyx_v_gof;
  CYTHON_UNUSED double *__pyx_v_arr;
  PyObject *__pyx_v_varSource = NULL;
  PyObject *__pyx_v_ref = NULL;
  PyObject *__pyx_v_fo = NULL;
  PyObject *__pyx_v_thisStr = NULL;
  PyObject *__pyx_v_LKs = NULL;
  PyObject *__pyx_v_tempIndex = NULL;
  Py_ssize_t __pyx_v_tempIdx;
  PyObject *__pyx_v_gtIndex = NULL;
  char *__pyx_v_alt1;
  char *__pyx_v_alt2;
  PyObject *__pyx_v_altIndex1 = NULL;
  PyObject *__pyx_v_altIndex2 = NULL;
  double __pyx_v_score1;
  double __pyx_v_score2;
  double __pyx_v_confidenceScore;
  PyObject *__pyx_v_theId = NULL;
  PyObject *__pyx_v_qual = NULL;
  PyObject *__pyx_v_format = NULL;
  PyObject *__pyx_v_linefilter = NULL;
  PyObject *__pyx_v_infoLine = NULL;
  PyObject *__pyx_v_theLine = NULL;
  long __pyx_v_i;
  PyObject *__pyx_v_sampleLine = NULL;
  PyObject *__pyx_v_cf = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __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;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  int __pyx_t_16;
  double __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  char *__pyx_t_19;
  char *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("outputHLACallToVCF", 0);

  /* "vcfutils.pyx":617
 *     cdef bytes thisSample
 *     cdef Variant longVar
 *     haplotype = haplotypes[0]             # <<<<<<<<<<<<<<
 *     longVar = haplotype.longVar
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (!(likely(((PyList_GET_ITEM(__pyx_v_haplotypes, 0)) == Py_None) || likely(__Pyx_TypeTest(PyList_GET_ITEM(__pyx_v_haplotypes, 0), __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyList_GET_ITEM(__pyx_v_haplotypes, 0);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_haplotype = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":618
 *     cdef Variant longVar
 *     haplotype = haplotypes[0]
 *     longVar = haplotype.longVar             # <<<<<<<<<<<<<<
 * 
 *     chrom = longVar.refName
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_haplotype->longVar);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_longVar = ((struct __pyx_obj_7variant_Variant *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":620
 *     longVar = haplotype.longVar
 * 
 *     chrom = longVar.refName             # <<<<<<<<<<<<<<
 * 
 *     alts = []
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_longVar->refName);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_chrom = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":622
 *     chrom = longVar.refName
 * 
 *     alts = []             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_alts = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":625
 * 
 *     cdef:
 *         int index = 0             # <<<<<<<<<<<<<<
 *         list indexOfBestGenotype=[]
 *         double likelihoodThisGenotype =0.0
 */
  __pyx_v_index = 0;

  /* "vcfutils.pyx":626
 *     cdef:
 *         int index = 0
 *         list indexOfBestGenotype=[]             # <<<<<<<<<<<<<<
 *         double likelihoodThisGenotype =0.0
 *         double maxEMLikelihood = 0.0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indexOfBestGenotype = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":627
 *         int index = 0
 *         list indexOfBestGenotype=[]
 *         double likelihoodThisGenotype =0.0             # <<<<<<<<<<<<<<
 *         double maxEMLikelihood = 0.0
 *         DiploidGenotype gt
 */
  __pyx_v_likelihoodThisGenotype = 0.0;

  /* "vcfutils.pyx":628
 *         list indexOfBestGenotype=[]
 *         double likelihoodThisGenotype =0.0
 *         double maxEMLikelihood = 0.0             # <<<<<<<<<<<<<<
 *         DiploidGenotype gt
 *         int nHaplotypes = len(haplotypes)
 */
  __pyx_v_maxEMLikelihood = 0.0;

  /* "vcfutils.pyx":630
 *         double maxEMLikelihood = 0.0
 *         DiploidGenotype gt
 *         int nHaplotypes = len(haplotypes)             # <<<<<<<<<<<<<<
 *         list gtIdx
 *         int hapIndex1, hapIndex2
 */
  if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_haplotypes)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_nHaplotypes = __pyx_t_2;

  /* "vcfutils.pyx":634
 *         int hapIndex1, hapIndex2
 * 
 *         list genotypeCalls = [] # Genotype data type genotype calls of all individuals, stored by index in the "genotypes"  list             # <<<<<<<<<<<<<<
 *         int nReads =0
 *         list allGTs =[]   # all genotypes of individuals, indexing  by the order of alts,
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_genotypeCalls = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":635
 * 
 *         list genotypeCalls = [] # Genotype data type genotype calls of all individuals, stored by index in the "genotypes"  list
 *         int nReads =0             # <<<<<<<<<<<<<<
 *         list allGTs =[]   # all genotypes of individuals, indexing  by the order of alts,
 *         list thisGTs = [] # genotype this individual, indexing by the order in the alts list
 */
  __pyx_v_nReads = 0;

  /* "vcfutils.pyx":636
 *         list genotypeCalls = [] # Genotype data type genotype calls of all individuals, stored by index in the "genotypes"  list
 *         int nReads =0
 *         list allGTs =[]   # all genotypes of individuals, indexing  by the order of alts,             # <<<<<<<<<<<<<<
 *         list thisGTs = [] # genotype this individual, indexing by the order in the alts list
 *         list GLs = []     # genotype likelihood of the called genotype
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_allGTs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":637
 *         int nReads =0
 *         list allGTs =[]   # all genotypes of individuals, indexing  by the order of alts,
 *         list thisGTs = [] # genotype this individual, indexing by the order in the alts list             # <<<<<<<<<<<<<<
 *         list GLs = []     # genotype likelihood of the called genotype
 *         list NRs = []     # number of reads supporting first haplotype
 */
  __pyx_t_1 = PyList_New(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_v_thisGTs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":638
 *         list allGTs =[]   # all genotypes of individuals, indexing  by the order of alts,
 *         list thisGTs = [] # genotype this individual, indexing by the order in the alts list
 *         list GLs = []     # genotype likelihood of the called genotype             # <<<<<<<<<<<<<<
 *         list NRs = []     # number of reads supporting first haplotype
 *         list NV1s = []     # number of reads supporting
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_GLs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":639
 *         list thisGTs = [] # genotype this individual, indexing by the order in the alts list
 *         list GLs = []     # genotype likelihood of the called genotype
 *         list NRs = []     # number of reads supporting first haplotype             # <<<<<<<<<<<<<<
 *         list NV1s = []     # number of reads supporting
 *         list NV2s = []     # number of reads supporting
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_NRs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":640
 *         list GLs = []     # genotype likelihood of the called genotype
 *         list NRs = []     # number of reads supporting first haplotype
 *         list NV1s = []     # number of reads supporting             # <<<<<<<<<<<<<<
 *         list NV2s = []     # number of reads supporting
 *         list CFs = []     # confidence score = (maximumLikelihood - secondMaximumLikelihood) / haplotypeLen
 */
  __pyx_t_1 = PyList_New(0); 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_v_NV1s = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":641
 *         list NRs = []     # number of reads supporting first haplotype
 *         list NV1s = []     # number of reads supporting
 *         list NV2s = []     # number of reads supporting             # <<<<<<<<<<<<<<
 *         list CFs = []     # confidence score = (maximumLikelihood - secondMaximumLikelihood) / haplotypeLen
 *         list secondMaxCandidates = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_NV2s = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":642
 *         list NV1s = []     # number of reads supporting
 *         list NV2s = []     # number of reads supporting
 *         list CFs = []     # confidence score = (maximumLikelihood - secondMaximumLikelihood) / haplotypeLen             # <<<<<<<<<<<<<<
 *         list secondMaxCandidates = []
 *         double secondMaxLikelihood = 0.0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_CFs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":643
 *         list NV2s = []     # number of reads supporting
 *         list CFs = []     # confidence score = (maximumLikelihood - secondMaximumLikelihood) / haplotypeLen
 *         list secondMaxCandidates = []             # <<<<<<<<<<<<<<
 *         double secondMaxLikelihood = 0.0
 *         int nv1, nv2, readIndex, totalReads, nBadReads, nBrokenPairReads
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_secondMaxCandidates = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":644
 *         list CFs = []     # confidence score = (maximumLikelihood - secondMaximumLikelihood) / haplotypeLen
 *         list secondMaxCandidates = []
 *         double secondMaxLikelihood = 0.0             # <<<<<<<<<<<<<<
 *         int nv1, nv2, readIndex, totalReads, nBadReads, nBrokenPairReads
 *         double* alignScoreArr1 = NULL
 */
  __pyx_v_secondMaxLikelihood = 0.0;

  /* "vcfutils.pyx":646
 *         double secondMaxLikelihood = 0.0
 *         int nv1, nv2, readIndex, totalReads, nBadReads, nBrokenPairReads
 *         double* alignScoreArr1 = NULL             # <<<<<<<<<<<<<<
 *         double* alignScoreArr2 = NULL
 *         cAlignedRead* thisRead
 */
  __pyx_v_alignScoreArr1 = NULL;

  /* "vcfutils.pyx":647
 *         int nv1, nv2, readIndex, totalReads, nBadReads, nBrokenPairReads
 *         double* alignScoreArr1 = NULL
 *         double* alignScoreArr2 = NULL             # <<<<<<<<<<<<<<
 *         cAlignedRead* thisRead
 *         cdef Haplotype hap1, hap2
 */
  __pyx_v_alignScoreArr2 = NULL;

  /* "vcfutils.pyx":652
 *         list thisNV1, thisNV2
 *         double like1, like2, likelihood
 *         double* gof = <double*>(calloc(nIndividuals+10, sizeof(double)))             # <<<<<<<<<<<<<<
 *         double* arr = NULL
 * 
 */
  __pyx_v_gof = ((double *)calloc((__pyx_v_nIndividuals + 10), (sizeof(double))));

  /* "vcfutils.pyx":653
 *         double like1, like2, likelihood
 *         double* gof = <double*>(calloc(nIndividuals+10, sizeof(double)))
 *         double* arr = NULL             # <<<<<<<<<<<<<<
 * 
 *     varSource = set()
 */
  __pyx_v_arr = NULL;

  /* "vcfutils.pyx":655
 *         double* arr = NULL
 * 
 *     varSource = set()             # <<<<<<<<<<<<<<
 *     logger.debug("Start output to vcf")
 *     ref = ''
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_varSource = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":656
 * 
 *     varSource = set()
 *     logger.debug("Start output to vcf")             # <<<<<<<<<<<<<<
 *     ref = ''
 *     memset(gof, 0, sizeof(double)* (nIndividuals+3))
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__debug); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __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;

  /* "vcfutils.pyx":657
 *     varSource = set()
 *     logger.debug("Start output to vcf")
 *     ref = ''             # <<<<<<<<<<<<<<
 *     memset(gof, 0, sizeof(double)* (nIndividuals+3))
 *     fo = None
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_21));
  __pyx_v_ref = ((PyObject *)__pyx_kp_s_21);

  /* "vcfutils.pyx":658
 *     logger.debug("Start output to vcf")
 *     ref = ''
 *     memset(gof, 0, sizeof(double)* (nIndividuals+3))             # <<<<<<<<<<<<<<
 *     fo = None
 *     if options.alignScoreFile != "":
 */
  memset(__pyx_v_gof, 0, ((sizeof(double)) * (__pyx_v_nIndividuals + 3)));

  /* "vcfutils.pyx":659
 *     ref = ''
 *     memset(gof, 0, sizeof(double)* (nIndividuals+3))
 *     fo = None             # <<<<<<<<<<<<<<
 *     if options.alignScoreFile != "":
 *         fo = open(options.alignScoreFile, 'a')
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_fo = Py_None;

  /* "vcfutils.pyx":660
 *     memset(gof, 0, sizeof(double)* (nIndividuals+3))
 *     fo = None
 *     if options.alignScoreFile != "":             # <<<<<<<<<<<<<<
 *         fo = open(options.alignScoreFile, 'a')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__alignScoreFile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_kp_s_21), Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "vcfutils.pyx":661
 *     fo = None
 *     if options.alignScoreFile != "":
 *         fo = open(options.alignScoreFile, 'a')             # <<<<<<<<<<<<<<
 * 
 *     for index from 0<= index < nIndividuals:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__alignScoreFile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __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 = 661; __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_INCREF(((PyObject *)__pyx_n_s__a));
    PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__a));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__a));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_fo);
    __pyx_v_fo = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "vcfutils.pyx":663
 *         fo = open(options.alignScoreFile, 'a')
 * 
 *     for index from 0<= index < nIndividuals:             # <<<<<<<<<<<<<<
 *         theBuffer = readBuffers[index]
 *         nReads = theBuffer.reads.windowEnd - theBuffer.reads.windowStart
 */
  __pyx_t_5 = __pyx_v_nIndividuals;
  for (__pyx_v_index = 0; __pyx_v_index < __pyx_t_5; __pyx_v_index++) {

    /* "vcfutils.pyx":664
 * 
 *     for index from 0<= index < nIndividuals:
 *         theBuffer = readBuffers[index]             # <<<<<<<<<<<<<<
 *         nReads = theBuffer.reads.windowEnd - theBuffer.reads.windowStart
 *         nBadReads = theBuffer.badReads.windowEnd - theBuffer.badReads.windowStart
 */
    if (unlikely(((PyObject *)__pyx_v_readBuffers) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_readBuffers), __pyx_v_index, sizeof(int), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7cwindow_bamReadBuffer))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_theBuffer));
    __pyx_v_theBuffer = ((struct __pyx_obj_7cwindow_bamReadBuffer *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":665
 *     for index from 0<= index < nIndividuals:
 *         theBuffer = readBuffers[index]
 *         nReads = theBuffer.reads.windowEnd - theBuffer.reads.windowStart             # <<<<<<<<<<<<<<
 *         nBadReads = theBuffer.badReads.windowEnd - theBuffer.badReads.windowStart
 *         nBrokenPairReads = theBuffer.brokenMates.windowEnd - theBuffer.brokenMates.windowStart
 */
    __pyx_v_nReads = (__pyx_v_theBuffer->reads->windowEnd - __pyx_v_theBuffer->reads->windowStart);

    /* "vcfutils.pyx":666
 *         theBuffer = readBuffers[index]
 *         nReads = theBuffer.reads.windowEnd - theBuffer.reads.windowStart
 *         nBadReads = theBuffer.badReads.windowEnd - theBuffer.badReads.windowStart             # <<<<<<<<<<<<<<
 *         nBrokenPairReads = theBuffer.brokenMates.windowEnd - theBuffer.brokenMates.windowStart
 *         totalReads = nReads + nBadReads + nBrokenPairReads
 */
    __pyx_v_nBadReads = (__pyx_v_theBuffer->badReads->windowEnd - __pyx_v_theBuffer->badReads->windowStart);

    /* "vcfutils.pyx":667
 *         nReads = theBuffer.reads.windowEnd - theBuffer.reads.windowStart
 *         nBadReads = theBuffer.badReads.windowEnd - theBuffer.badReads.windowStart
 *         nBrokenPairReads = theBuffer.brokenMates.windowEnd - theBuffer.brokenMates.windowStart             # <<<<<<<<<<<<<<
 *         totalReads = nReads + nBadReads + nBrokenPairReads
 *         if options.alignScoreFile != "":
 */
    __pyx_v_nBrokenPairReads = (__pyx_v_theBuffer->brokenMates->windowEnd - __pyx_v_theBuffer->brokenMates->windowStart);

    /* "vcfutils.pyx":668
 *         nBadReads = theBuffer.badReads.windowEnd - theBuffer.badReads.windowStart
 *         nBrokenPairReads = theBuffer.brokenMates.windowEnd - theBuffer.brokenMates.windowStart
 *         totalReads = nReads + nBadReads + nBrokenPairReads             # <<<<<<<<<<<<<<
 *         if options.alignScoreFile != "":
 *             fo.write("Individual\t%d\t%d\t%d:%d-%d\n" %(index, len(haplotypes), nReads,windowStart, windowEnd))
 */
    __pyx_v_totalReads = ((__pyx_v_nReads + __pyx_v_nBadReads) + __pyx_v_nBrokenPairReads);

    /* "vcfutils.pyx":669
 *         nBrokenPairReads = theBuffer.brokenMates.windowEnd - theBuffer.brokenMates.windowStart
 *         totalReads = nReads + nBadReads + nBrokenPairReads
 *         if options.alignScoreFile != "":             # <<<<<<<<<<<<<<
 *             fo.write("Individual\t%d\t%d\t%d:%d-%d\n" %(index, len(haplotypes), nReads,windowStart, windowEnd))
 *         secondMaxCandidates = []
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__alignScoreFile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s_21), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "vcfutils.pyx":670
 *         totalReads = nReads + nBadReads + nBrokenPairReads
 *         if options.alignScoreFile != "":
 *             fo.write("Individual\t%d\t%d\t%d:%d-%d\n" %(index, len(haplotypes), nReads,windowStart, windowEnd))             # <<<<<<<<<<<<<<
 *         secondMaxCandidates = []
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s__write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_haplotypes)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyInt_FromLong(__pyx_v_nReads); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyInt_FromLong(__pyx_v_windowStart); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyInt_FromLong(__pyx_v_windowEnd); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_3 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      __Pyx_DECREF(((PyObject *)__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 = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
      __pyx_t_9 = 0;
      __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "vcfutils.pyx":671
 *         if options.alignScoreFile != "":
 *             fo.write("Individual\t%d\t%d\t%d:%d-%d\n" %(index, len(haplotypes), nReads,windowStart, windowEnd))
 *         secondMaxCandidates = []             # <<<<<<<<<<<<<<
 * 
 *         thisGTs = []
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(((PyObject *)__pyx_v_secondMaxCandidates));
    __pyx_v_secondMaxCandidates = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":673
 *         secondMaxCandidates = []
 * 
 *         thisGTs = []             # <<<<<<<<<<<<<<
 *         NRs.append(nReads)
 *         thisNV1, thisNV2 = [], []
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(((PyObject *)__pyx_v_thisGTs));
    __pyx_v_thisGTs = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":674
 * 
 *         thisGTs = []
 *         NRs.append(nReads)             # <<<<<<<<<<<<<<
 *         thisNV1, thisNV2 = [], []
 *         if nReads ==0:
 */
    __pyx_t_9 = PyInt_FromLong(__pyx_v_nReads); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_NRs, __pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "vcfutils.pyx":675
 *         thisGTs = []
 *         NRs.append(nReads)
 *         thisNV1, thisNV2 = [], []             # <<<<<<<<<<<<<<
 *         if nReads ==0:
 *             genotypeCalls.append([])
 */
    __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_XDECREF(((PyObject *)__pyx_v_thisNV1));
    __pyx_v_thisNV1 = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF(((PyObject *)__pyx_v_thisNV2));
    __pyx_v_thisNV2 = ((PyObject*)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "vcfutils.pyx":676
 *         NRs.append(nReads)
 *         thisNV1, thisNV2 = [], []
 *         if nReads ==0:             # <<<<<<<<<<<<<<
 *             genotypeCalls.append([])
 *             allGTs.append(thisGTs)
 */
    __pyx_t_4 = ((__pyx_v_nReads == 0) != 0);
    if (__pyx_t_4) {

      /* "vcfutils.pyx":677
 *         thisNV1, thisNV2 = [], []
 *         if nReads ==0:
 *             genotypeCalls.append([])             # <<<<<<<<<<<<<<
 *             allGTs.append(thisGTs)
 *             GLs.append(0.0)
 */
      __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_genotypeCalls, ((PyObject *)__pyx_t_10)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;

      /* "vcfutils.pyx":678
 *         if nReads ==0:
 *             genotypeCalls.append([])
 *             allGTs.append(thisGTs)             # <<<<<<<<<<<<<<
 *             GLs.append(0.0)
 *             NV1s.append([])
 */
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_allGTs, ((PyObject *)__pyx_v_thisGTs)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "vcfutils.pyx":679
 *             genotypeCalls.append([])
 *             allGTs.append(thisGTs)
 *             GLs.append(0.0)             # <<<<<<<<<<<<<<
 *             NV1s.append([])
 *             NV2s.append([])
 */
      __pyx_t_10 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_GLs, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "vcfutils.pyx":680
 *             allGTs.append(thisGTs)
 *             GLs.append(0.0)
 *             NV1s.append([])             # <<<<<<<<<<<<<<
 *             NV2s.append([])
 *             CFs.append(0.0)
 */
      __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_NV1s, ((PyObject *)__pyx_t_10)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;

      /* "vcfutils.pyx":681
 *             GLs.append(0.0)
 *             NV1s.append([])
 *             NV2s.append([])             # <<<<<<<<<<<<<<
 *             CFs.append(0.0)
 *             continue
 */
      __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_NV2s, ((PyObject *)__pyx_t_10)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;

      /* "vcfutils.pyx":682
 *             NV1s.append([])
 *             NV2s.append([])
 *             CFs.append(0.0)             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      __pyx_t_10 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_CFs, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "vcfutils.pyx":683
 *             NV2s.append([])
 *             CFs.append(0.0)
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         indexOfBestGenotype = []
 */
      goto __pyx_L4_continue;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "vcfutils.pyx":685
 *             continue
 * 
 *         indexOfBestGenotype = []             # <<<<<<<<<<<<<<
 *         maxEMLikelihood = 0.0
 *         likelihoodThisGenotype = -1e7
 */
    __pyx_t_10 = PyList_New(0); 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(((PyObject *)__pyx_v_indexOfBestGenotype));
    __pyx_v_indexOfBestGenotype = ((PyObject*)__pyx_t_10);
    __pyx_t_10 = 0;

    /* "vcfutils.pyx":686
 * 
 *         indexOfBestGenotype = []
 *         maxEMLikelihood = 0.0             # <<<<<<<<<<<<<<
 *         likelihoodThisGenotype = -1e7
 *         if options.alignScoreFile != "":
 */
    __pyx_v_maxEMLikelihood = 0.0;

    /* "vcfutils.pyx":687
 *         indexOfBestGenotype = []
 *         maxEMLikelihood = 0.0
 *         likelihoodThisGenotype = -1e7             # <<<<<<<<<<<<<<
 *         if options.alignScoreFile != "":
 *             for hap1 in haplotypes:
 */
    __pyx_v_likelihoodThisGenotype = -1e7;

    /* "vcfutils.pyx":688
 *         maxEMLikelihood = 0.0
 *         likelihoodThisGenotype = -1e7
 *         if options.alignScoreFile != "":             # <<<<<<<<<<<<<<
 *             for hap1 in haplotypes:
 *                 thisStr = hap1.shortHaplotypeSequence
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__alignScoreFile); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_kp_s_21), Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_4) {

      /* "vcfutils.pyx":689
 *         likelihoodThisGenotype = -1e7
 *         if options.alignScoreFile != "":
 *             for hap1 in haplotypes:             # <<<<<<<<<<<<<<
 *                 thisStr = hap1.shortHaplotypeSequence
 *                 fo.write("%d %d %s\n" %(hap1.startPos+1, hap1.endPos, thisStr))
 */
      if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_9 = ((PyObject *)__pyx_v_haplotypes); __Pyx_INCREF(__pyx_t_9); __pyx_t_2 = 0;
      for (;;) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_hap1));
        __pyx_v_hap1 = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_10);
        __pyx_t_10 = 0;

        /* "vcfutils.pyx":690
 *         if options.alignScoreFile != "":
 *             for hap1 in haplotypes:
 *                 thisStr = hap1.shortHaplotypeSequence             # <<<<<<<<<<<<<<
 *                 fo.write("%d %d %s\n" %(hap1.startPos+1, hap1.endPos, thisStr))
 * 
 */
        __pyx_t_10 = ((PyObject *)__pyx_v_hap1->shortHaplotypeSequence);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_XDECREF(((PyObject *)__pyx_v_thisStr));
        __pyx_v_thisStr = ((PyObject*)__pyx_t_10);
        __pyx_t_10 = 0;

        /* "vcfutils.pyx":691
 *             for hap1 in haplotypes:
 *                 thisStr = hap1.shortHaplotypeSequence
 *                 fo.write("%d %d %s\n" %(hap1.startPos+1, hap1.endPos, thisStr))             # <<<<<<<<<<<<<<
 * 
 *         for hapIndex1 from 0<= hapIndex1 < nHaplotypes:
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s__write); 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_t_1 = PyInt_FromLong((__pyx_v_hap1->startPos + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = PyInt_FromLong(__pyx_v_hap1->endPos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __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);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __Pyx_INCREF(((PyObject *)__pyx_v_thisStr));
        PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_thisStr));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_thisStr));
        __pyx_t_1 = 0;
        __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_8));
        __Pyx_DECREF(((PyObject *)__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 = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_8));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
        __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "vcfutils.pyx":693
 *                 fo.write("%d %d %s\n" %(hap1.startPos+1, hap1.endPos, thisStr))
 * 
 *         for hapIndex1 from 0<= hapIndex1 < nHaplotypes:             # <<<<<<<<<<<<<<
 *             LKs = []
 *             hap1 = haplotypes[hapIndex1]
 */
    __pyx_t_12 = __pyx_v_nHaplotypes;
    for (__pyx_v_hapIndex1 = 0; __pyx_v_hapIndex1 < __pyx_t_12; __pyx_v_hapIndex1++) {

      /* "vcfutils.pyx":694
 * 
 *         for hapIndex1 from 0<= hapIndex1 < nHaplotypes:
 *             LKs = []             # <<<<<<<<<<<<<<
 *             hap1 = haplotypes[hapIndex1]
 *             arr = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd,1)
 */
      __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(((PyObject *)__pyx_v_LKs));
      __pyx_v_LKs = ((PyObject*)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "vcfutils.pyx":695
 *         for hapIndex1 from 0<= hapIndex1 < nHaplotypes:
 *             LKs = []
 *             hap1 = haplotypes[hapIndex1]             # <<<<<<<<<<<<<<
 *             arr = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd,1)
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_9 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_haplotypes), __pyx_v_hapIndex1, sizeof(int), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_hap1));
      __pyx_v_hap1 = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "vcfutils.pyx":696
 *             LKs = []
 *             hap1 = haplotypes[hapIndex1]
 *             arr = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd,1)             # <<<<<<<<<<<<<<
 * 
 *         for hapIndex1 from 0<= hapIndex1 < nHaplotypes:
 */
      __pyx_v_arr = ((struct __pyx_vtabstruct_10chaplotype_Haplotype *)__pyx_v_hap1->__pyx_vtab)->alignReads(__pyx_v_hap1, __pyx_v_index, __pyx_v_theBuffer->reads->windowStart, __pyx_v_theBuffer->reads->windowEnd, __pyx_v_theBuffer->badReads->windowStart, __pyx_v_theBuffer->badReads->windowEnd, __pyx_v_theBuffer->brokenMates->windowStart, __pyx_v_theBuffer->brokenMates->windowEnd, 1);
    }

    /* "vcfutils.pyx":698
 *             arr = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd,1)
 * 
 *         for hapIndex1 from 0<= hapIndex1 < nHaplotypes:             # <<<<<<<<<<<<<<
 *             LKs = []
 *             hap1 = haplotypes[hapIndex1]
 */
    __pyx_t_12 = __pyx_v_nHaplotypes;
    for (__pyx_v_hapIndex1 = 0; __pyx_v_hapIndex1 < __pyx_t_12; __pyx_v_hapIndex1++) {

      /* "vcfutils.pyx":699
 * 
 *         for hapIndex1 from 0<= hapIndex1 < nHaplotypes:
 *             LKs = []             # <<<<<<<<<<<<<<
 *             hap1 = haplotypes[hapIndex1]
 *             for hapIndex2 from 0<=hapIndex2 < nHaplotypes:
 */
      __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_XDECREF(((PyObject *)__pyx_v_LKs));
      __pyx_v_LKs = ((PyObject*)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "vcfutils.pyx":700
 *         for hapIndex1 from 0<= hapIndex1 < nHaplotypes:
 *             LKs = []
 *             hap1 = haplotypes[hapIndex1]             # <<<<<<<<<<<<<<
 *             for hapIndex2 from 0<=hapIndex2 < nHaplotypes:
 *                 hap2 = haplotypes[hapIndex2]
 */
      if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_9 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_haplotypes), __pyx_v_hapIndex1, sizeof(int), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_hap1));
      __pyx_v_hap1 = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "vcfutils.pyx":701
 *             LKs = []
 *             hap1 = haplotypes[hapIndex1]
 *             for hapIndex2 from 0<=hapIndex2 < nHaplotypes:             # <<<<<<<<<<<<<<
 *                 hap2 = haplotypes[hapIndex2]
 *                 gt = DiploidGenotype(hap1, hap2)
 */
      __pyx_t_13 = __pyx_v_nHaplotypes;
      for (__pyx_v_hapIndex2 = 0; __pyx_v_hapIndex2 < __pyx_t_13; __pyx_v_hapIndex2++) {

        /* "vcfutils.pyx":702
 *             hap1 = haplotypes[hapIndex1]
 *             for hapIndex2 from 0<=hapIndex2 < nHaplotypes:
 *                 hap2 = haplotypes[hapIndex2]             # <<<<<<<<<<<<<<
 *                 gt = DiploidGenotype(hap1, hap2)
 *                 likelihoodThisGenotype= gt.calculateDataLikelihood(theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, index, nIndividuals, gof, options.HLATyping)
 */
        if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_9 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_haplotypes), __pyx_v_hapIndex2, sizeof(int), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF(((PyObject *)__pyx_v_hap2));
        __pyx_v_hap2 = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_9);
        __pyx_t_9 = 0;

        /* "vcfutils.pyx":703
 *             for hapIndex2 from 0<=hapIndex2 < nHaplotypes:
 *                 hap2 = haplotypes[hapIndex2]
 *                 gt = DiploidGenotype(hap1, hap2)             # <<<<<<<<<<<<<<
 *                 likelihoodThisGenotype= gt.calculateDataLikelihood(theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, index, nIndividuals, gof, options.HLATyping)
 *                 LKs.append(likelihoodThisGenotype)
 */
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_INCREF(((PyObject *)__pyx_v_hap1));
        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_hap1));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_hap1));
        __Pyx_INCREF(((PyObject *)__pyx_v_hap2));
        PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_v_hap2));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_hap2));
        __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_9cgenotype_DiploidGenotype)), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __Pyx_XDECREF(((PyObject *)__pyx_v_gt));
        __pyx_v_gt = ((struct __pyx_obj_9cgenotype_DiploidGenotype *)__pyx_t_8);
        __pyx_t_8 = 0;

        /* "vcfutils.pyx":704
 *                 hap2 = haplotypes[hapIndex2]
 *                 gt = DiploidGenotype(hap1, hap2)
 *                 likelihoodThisGenotype= gt.calculateDataLikelihood(theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, index, nIndividuals, gof, options.HLATyping)             # <<<<<<<<<<<<<<
 *                 LKs.append(likelihoodThisGenotype)
 *                 tempIndex = sorted([hapIndex1, hapIndex2])
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__HLATyping); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_likelihoodThisGenotype = ((struct __pyx_vtabstruct_9cgenotype_DiploidGenotype *)__pyx_v_gt->__pyx_vtab)->calculateDataLikelihood(__pyx_v_gt, __pyx_v_theBuffer->reads->windowStart, __pyx_v_theBuffer->reads->windowEnd, __pyx_v_theBuffer->badReads->windowStart, __pyx_v_theBuffer->badReads->windowEnd, __pyx_v_theBuffer->brokenMates->windowStart, __pyx_v_theBuffer->brokenMates->windowEnd, __pyx_v_index, __pyx_v_nIndividuals, __pyx_v_gof, __pyx_t_14);

        /* "vcfutils.pyx":705
 *                 gt = DiploidGenotype(hap1, hap2)
 *                 likelihoodThisGenotype= gt.calculateDataLikelihood(theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, index, nIndividuals, gof, options.HLATyping)
 *                 LKs.append(likelihoodThisGenotype)             # <<<<<<<<<<<<<<
 *                 tempIndex = sorted([hapIndex1, hapIndex2])
 *                 if indexOfBestGenotype == [] or likelihoodThisGenotype > maxEMLikelihood:
 */
        __pyx_t_8 = PyFloat_FromDouble(__pyx_v_likelihoodThisGenotype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_LKs, __pyx_t_8); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "vcfutils.pyx":706
 *                 likelihoodThisGenotype= gt.calculateDataLikelihood(theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, index, nIndividuals, gof, options.HLATyping)
 *                 LKs.append(likelihoodThisGenotype)
 *                 tempIndex = sorted([hapIndex1, hapIndex2])             # <<<<<<<<<<<<<<
 *                 if indexOfBestGenotype == [] or likelihoodThisGenotype > maxEMLikelihood:
 *                     maxEMLikelihood = likelihoodThisGenotype
 */
        __pyx_t_8 = PyInt_FromLong(__pyx_v_hapIndex1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PyInt_FromLong(__pyx_v_hapIndex2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_8 = 0;
        __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_7));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
        __pyx_t_7 = 0;
        __pyx_t_7 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_v_tempIndex);
        __pyx_v_tempIndex = __pyx_t_7;
        __pyx_t_7 = 0;

        /* "vcfutils.pyx":707
 *                 LKs.append(likelihoodThisGenotype)
 *                 tempIndex = sorted([hapIndex1, hapIndex2])
 *                 if indexOfBestGenotype == [] or likelihoodThisGenotype > maxEMLikelihood:             # <<<<<<<<<<<<<<
 *                     maxEMLikelihood = likelihoodThisGenotype
 *                     indexOfBestGenotype = [tempIndex]
 */
        __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = PyObject_RichCompare(((PyObject *)__pyx_v_indexOfBestGenotype), ((PyObject *)__pyx_t_7), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (!__pyx_t_4) {
          __pyx_t_15 = (__pyx_v_likelihoodThisGenotype > __pyx_v_maxEMLikelihood);
          __pyx_t_16 = __pyx_t_15;
        } else {
          __pyx_t_16 = __pyx_t_4;
        }
        if (__pyx_t_16) {

          /* "vcfutils.pyx":708
 *                 tempIndex = sorted([hapIndex1, hapIndex2])
 *                 if indexOfBestGenotype == [] or likelihoodThisGenotype > maxEMLikelihood:
 *                     maxEMLikelihood = likelihoodThisGenotype             # <<<<<<<<<<<<<<
 *                     indexOfBestGenotype = [tempIndex]
 *                     secondMaxCandidates.append(likelihoodThisGenotype)
 */
          __pyx_v_maxEMLikelihood = __pyx_v_likelihoodThisGenotype;

          /* "vcfutils.pyx":709
 *                 if indexOfBestGenotype == [] or likelihoodThisGenotype > maxEMLikelihood:
 *                     maxEMLikelihood = likelihoodThisGenotype
 *                     indexOfBestGenotype = [tempIndex]             # <<<<<<<<<<<<<<
 *                     secondMaxCandidates.append(likelihoodThisGenotype)
 *                 elif likelihoodThisGenotype == maxEMLikelihood and tempIndex not in indexOfBestGenotype:
 */
          __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_v_tempIndex);
          PyList_SET_ITEM(__pyx_t_9, 0, __pyx_v_tempIndex);
          __Pyx_GIVEREF(__pyx_v_tempIndex);
          __Pyx_DECREF(((PyObject *)__pyx_v_indexOfBestGenotype));
          __pyx_v_indexOfBestGenotype = ((PyObject*)__pyx_t_9);
          __pyx_t_9 = 0;

          /* "vcfutils.pyx":710
 *                     maxEMLikelihood = likelihoodThisGenotype
 *                     indexOfBestGenotype = [tempIndex]
 *                     secondMaxCandidates.append(likelihoodThisGenotype)             # <<<<<<<<<<<<<<
 *                 elif likelihoodThisGenotype == maxEMLikelihood and tempIndex not in indexOfBestGenotype:
 *                     indexOfBestGenotype.append(tempIndex)
 */
          __pyx_t_9 = PyFloat_FromDouble(__pyx_v_likelihoodThisGenotype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_secondMaxCandidates, __pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L17;
        }

        /* "vcfutils.pyx":711
 *                     indexOfBestGenotype = [tempIndex]
 *                     secondMaxCandidates.append(likelihoodThisGenotype)
 *                 elif likelihoodThisGenotype == maxEMLikelihood and tempIndex not in indexOfBestGenotype:             # <<<<<<<<<<<<<<
 *                     indexOfBestGenotype.append(tempIndex)
 *             if options.alignScoreFile != "":
 */
        __pyx_t_16 = ((__pyx_v_likelihoodThisGenotype == __pyx_v_maxEMLikelihood) != 0);
        if (__pyx_t_16) {
          __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_tempIndex, ((PyObject *)__pyx_v_indexOfBestGenotype), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_15 = (__pyx_t_4 != 0);
        } else {
          __pyx_t_15 = __pyx_t_16;
        }
        if (__pyx_t_15) {

          /* "vcfutils.pyx":712
 *                     secondMaxCandidates.append(likelihoodThisGenotype)
 *                 elif likelihoodThisGenotype == maxEMLikelihood and tempIndex not in indexOfBestGenotype:
 *                     indexOfBestGenotype.append(tempIndex)             # <<<<<<<<<<<<<<
 *             if options.alignScoreFile != "":
 *                 fo.write("%s\n" %("\t".join(map(str,LKs))))
 */
          __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_indexOfBestGenotype, __pyx_v_tempIndex); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L17;
        }
        __pyx_L17:;
      }

      /* "vcfutils.pyx":713
 *                 elif likelihoodThisGenotype == maxEMLikelihood and tempIndex not in indexOfBestGenotype:
 *                     indexOfBestGenotype.append(tempIndex)
 *             if options.alignScoreFile != "":             # <<<<<<<<<<<<<<
 *                 fo.write("%s\n" %("\t".join(map(str,LKs))))
 *         #find the secondMaxLikelihood value to calculate confidence score
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__alignScoreFile); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_kp_s_21), Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_15) {

        /* "vcfutils.pyx":714
 *                     indexOfBestGenotype.append(tempIndex)
 *             if options.alignScoreFile != "":
 *                 fo.write("%s\n" %("\t".join(map(str,LKs))))             # <<<<<<<<<<<<<<
 *         #find the secondMaxLikelihood value to calculate confidence score
 *         if len(secondMaxCandidates) > 1:
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s__write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_25), __pyx_n_s__join); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __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 = 714; __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))));
        __Pyx_INCREF(((PyObject *)__pyx_v_LKs));
        PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_LKs));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_LKs));
        __pyx_t_10 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(((PyObject *)__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 = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__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 = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_8));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
        __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L18;
      }
      __pyx_L18:;
    }

    /* "vcfutils.pyx":716
 *                 fo.write("%s\n" %("\t".join(map(str,LKs))))
 *         #find the secondMaxLikelihood value to calculate confidence score
 *         if len(secondMaxCandidates) > 1:             # <<<<<<<<<<<<<<
 *             secondMaxLikelihood = sorted(secondMaxCandidates, reverse = True)[1]
 *         else:
 */
    __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_secondMaxCandidates)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((__pyx_t_2 > 1) != 0);
    if (__pyx_t_15) {

      /* "vcfutils.pyx":717
 *         #find the secondMaxLikelihood value to calculate confidence score
 *         if len(secondMaxCandidates) > 1:
 *             secondMaxLikelihood = sorted(secondMaxCandidates, reverse = True)[1]             # <<<<<<<<<<<<<<
 *         else:
 *             secondMaxLikelihood = maxEMLikelihood -100.0
 */
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(((PyObject *)__pyx_v_secondMaxCandidates));
      PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_secondMaxCandidates));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_secondMaxCandidates));
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_10));
      __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__reverse), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 1, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_secondMaxLikelihood = __pyx_t_17;
      goto __pyx_L19;
    }
    /*else*/ {

      /* "vcfutils.pyx":719
 *             secondMaxLikelihood = sorted(secondMaxCandidates, reverse = True)[1]
 *         else:
 *             secondMaxLikelihood = maxEMLikelihood -100.0             # <<<<<<<<<<<<<<
 * 
 *         for tempIdx, gtIndex in enumerate(indexOfBestGenotype):
 */
      __pyx_v_secondMaxLikelihood = (__pyx_v_maxEMLikelihood - 100.0);
    }
    __pyx_L19:;

    /* "vcfutils.pyx":721
 *             secondMaxLikelihood = maxEMLikelihood -100.0
 * 
 *         for tempIdx, gtIndex in enumerate(indexOfBestGenotype):             # <<<<<<<<<<<<<<
 *             hap1, hap2 = haplotypes[gtIndex[0]], haplotypes[gtIndex[1]]
 *             alt1, alt2 = hap1.getShortHaplotypeSequence(), hap2.getShortHaplotypeSequence()
 */
    __pyx_t_2 = 0;
    __pyx_t_10 = ((PyObject *)__pyx_v_indexOfBestGenotype); __Pyx_INCREF(__pyx_t_10); __pyx_t_18 = 0;
    for (;;) {
      if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_10)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_7 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_18); __Pyx_INCREF(__pyx_t_7); __pyx_t_18++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_7 = PySequence_ITEM(__pyx_t_10, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_XDECREF(__pyx_v_gtIndex);
      __pyx_v_gtIndex = __pyx_t_7;
      __pyx_t_7 = 0;
      __pyx_v_tempIdx = __pyx_t_2;
      __pyx_t_2 = (__pyx_t_2 + 1);

      /* "vcfutils.pyx":722
 * 
 *         for tempIdx, gtIndex in enumerate(indexOfBestGenotype):
 *             hap1, hap2 = haplotypes[gtIndex[0]], haplotypes[gtIndex[1]]             # <<<<<<<<<<<<<<
 *             alt1, alt2 = hap1.getShortHaplotypeSequence(), hap2.getShortHaplotypeSequence()
 *             varSource.add(hap1.longVar.varSource)
 */
      if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gtIndex, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_v_haplotypes), __pyx_t_7); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_gtIndex, 1, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_haplotypes), __pyx_t_7); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_hap1));
      __pyx_v_hap1 = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_hap2));
      __pyx_v_hap2 = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "vcfutils.pyx":723
 *         for tempIdx, gtIndex in enumerate(indexOfBestGenotype):
 *             hap1, hap2 = haplotypes[gtIndex[0]], haplotypes[gtIndex[1]]
 *             alt1, alt2 = hap1.getShortHaplotypeSequence(), hap2.getShortHaplotypeSequence()             # <<<<<<<<<<<<<<
 *             varSource.add(hap1.longVar.varSource)
 *             varSource.add(hap2.longVar.varSource)
 */
      __pyx_t_19 = ((struct __pyx_vtabstruct_10chaplotype_Haplotype *)__pyx_v_hap1->__pyx_vtab)->getShortHaplotypeSequence(__pyx_v_hap1);
      __pyx_t_20 = ((struct __pyx_vtabstruct_10chaplotype_Haplotype *)__pyx_v_hap2->__pyx_vtab)->getShortHaplotypeSequence(__pyx_v_hap2);
      __pyx_v_alt1 = __pyx_t_19;
      __pyx_v_alt2 = __pyx_t_20;

      /* "vcfutils.pyx":724
 *             hap1, hap2 = haplotypes[gtIndex[0]], haplotypes[gtIndex[1]]
 *             alt1, alt2 = hap1.getShortHaplotypeSequence(), hap2.getShortHaplotypeSequence()
 *             varSource.add(hap1.longVar.varSource)             # <<<<<<<<<<<<<<
 *             varSource.add(hap2.longVar.varSource)
 *             if tempIdx ==0:
 */
      __pyx_t_9 = PyInt_FromLong(__pyx_v_hap1->longVar->varSource); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = PySet_Add(__pyx_v_varSource, __pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "vcfutils.pyx":725
 *             alt1, alt2 = hap1.getShortHaplotypeSequence(), hap2.getShortHaplotypeSequence()
 *             varSource.add(hap1.longVar.varSource)
 *             varSource.add(hap2.longVar.varSource)             # <<<<<<<<<<<<<<
 *             if tempIdx ==0:
 *                 ref = hap1.shortReferenceSequence
 */
      __pyx_t_9 = PyInt_FromLong(__pyx_v_hap2->longVar->varSource); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = PySet_Add(__pyx_v_varSource, __pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "vcfutils.pyx":726
 *             varSource.add(hap1.longVar.varSource)
 *             varSource.add(hap2.longVar.varSource)
 *             if tempIdx ==0:             # <<<<<<<<<<<<<<
 *                 ref = hap1.shortReferenceSequence
 * 
 */
      __pyx_t_15 = ((__pyx_v_tempIdx == 0) != 0);
      if (__pyx_t_15) {

        /* "vcfutils.pyx":727
 *             varSource.add(hap2.longVar.varSource)
 *             if tempIdx ==0:
 *                 ref = hap1.shortReferenceSequence             # <<<<<<<<<<<<<<
 * 
 *             if alt1 != ref and alt1 not in alts:
 */
        __pyx_t_9 = ((PyObject *)__pyx_v_hap1->shortReferenceSequence);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_v_ref);
        __pyx_v_ref = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L22;
      }
      __pyx_L22:;

      /* "vcfutils.pyx":729
 *                 ref = hap1.shortReferenceSequence
 * 
 *             if alt1 != ref and alt1 not in alts:             # <<<<<<<<<<<<<<
 *                alts.append(alt1)
 *             if alt2 != ref and alt2 not in alts:
 */
      __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_alt1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_9));
      __pyx_t_8 = PyObject_RichCompare(((PyObject *)__pyx_t_9), __pyx_v_ref, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_15) {
        __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_alt1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_8));
        __pyx_t_16 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_8), ((PyObject *)__pyx_v_alts), Py_NE)); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        __pyx_t_4 = __pyx_t_16;
      } else {
        __pyx_t_4 = __pyx_t_15;
      }
      if (__pyx_t_4) {

        /* "vcfutils.pyx":730
 * 
 *             if alt1 != ref and alt1 not in alts:
 *                alts.append(alt1)             # <<<<<<<<<<<<<<
 *             if alt2 != ref and alt2 not in alts:
 *                alts.append(alt2)
 */
        __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_alt1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_8));
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_alts, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        goto __pyx_L23;
      }
      __pyx_L23:;

      /* "vcfutils.pyx":731
 *             if alt1 != ref and alt1 not in alts:
 *                alts.append(alt1)
 *             if alt2 != ref and alt2 not in alts:             # <<<<<<<<<<<<<<
 *                alts.append(alt2)
 *             altIndex1, altIndex2 = 0 , 0
 */
      __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_alt2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __pyx_t_9 = PyObject_RichCompare(((PyObject *)__pyx_t_8), __pyx_v_ref, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_4) {
        __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_alt2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
        __pyx_t_15 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_9), ((PyObject *)__pyx_v_alts), Py_NE)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        __pyx_t_16 = __pyx_t_15;
      } else {
        __pyx_t_16 = __pyx_t_4;
      }
      if (__pyx_t_16) {

        /* "vcfutils.pyx":732
 *                alts.append(alt1)
 *             if alt2 != ref and alt2 not in alts:
 *                alts.append(alt2)             # <<<<<<<<<<<<<<
 *             altIndex1, altIndex2 = 0 , 0
 *             if alt1 in alts:
 */
        __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_alt2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_alts, ((PyObject *)__pyx_t_9)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
        goto __pyx_L24;
      }
      __pyx_L24:;

      /* "vcfutils.pyx":733
 *             if alt2 != ref and alt2 not in alts:
 *                alts.append(alt2)
 *             altIndex1, altIndex2 = 0 , 0             # <<<<<<<<<<<<<<
 *             if alt1 in alts:
 *                 altIndex1 = alts.index(alt1) + 1
 */
      __pyx_t_9 = __pyx_int_0;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_8 = __pyx_int_0;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_v_altIndex1);
      __pyx_v_altIndex1 = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_v_altIndex2);
      __pyx_v_altIndex2 = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "vcfutils.pyx":734
 *                alts.append(alt2)
 *             altIndex1, altIndex2 = 0 , 0
 *             if alt1 in alts:             # <<<<<<<<<<<<<<
 *                 altIndex1 = alts.index(alt1) + 1
 *             if alt2 in alts:
 */
      __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_alt1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
      __pyx_t_16 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_8), ((PyObject *)__pyx_v_alts), Py_EQ)); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_4 = (__pyx_t_16 != 0);
      if (__pyx_t_4) {

        /* "vcfutils.pyx":735
 *             altIndex1, altIndex2 = 0 , 0
 *             if alt1 in alts:
 *                 altIndex1 = alts.index(alt1) + 1             # <<<<<<<<<<<<<<
 *             if alt2 in alts:
 *                 altIndex2 = alts.index(alt2) + 1
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_alts), __pyx_n_s__index); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_alt1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_9));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
        __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_v_altIndex1);
        __pyx_v_altIndex1 = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L25;
      }
      __pyx_L25:;

      /* "vcfutils.pyx":736
 *             if alt1 in alts:
 *                 altIndex1 = alts.index(alt1) + 1
 *             if alt2 in alts:             # <<<<<<<<<<<<<<
 *                 altIndex2 = alts.index(alt2) + 1
 *             thisGTs.append(str(altIndex1) +  "/" +str( altIndex2))
 */
      __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_alt2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      __pyx_t_4 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_v_alts), Py_EQ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __pyx_t_16 = (__pyx_t_4 != 0);
      if (__pyx_t_16) {

        /* "vcfutils.pyx":737
 *                 altIndex1 = alts.index(alt1) + 1
 *             if alt2 in alts:
 *                 altIndex2 = alts.index(alt2) + 1             # <<<<<<<<<<<<<<
 *             thisGTs.append(str(altIndex1) +  "/" +str( altIndex2))
 *             nv1, nv2 = 0, 0
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_alts), __pyx_n_s__index); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyBytes_FromString(__pyx_v_alt2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
        __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_v_altIndex2);
        __pyx_v_altIndex2 = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L26;
      }
      __pyx_L26:;

      /* "vcfutils.pyx":738
 *             if alt2 in alts:
 *                 altIndex2 = alts.index(alt2) + 1
 *             thisGTs.append(str(altIndex1) +  "/" +str( altIndex2))             # <<<<<<<<<<<<<<
 *             nv1, nv2 = 0, 0
 *             alignScoreArr1 = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)
 */
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_altIndex1);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_altIndex1);
      __Pyx_GIVEREF(__pyx_v_altIndex1);
      __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_Add(__pyx_t_9, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __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 = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_altIndex2);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_altIndex2);
      __Pyx_GIVEREF(__pyx_v_altIndex2);
      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __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_7); __pyx_t_7 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_thisGTs, __pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "vcfutils.pyx":739
 *                 altIndex2 = alts.index(alt2) + 1
 *             thisGTs.append(str(altIndex1) +  "/" +str( altIndex2))
 *             nv1, nv2 = 0, 0             # <<<<<<<<<<<<<<
 *             alignScoreArr1 = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)
 *             alignScoreArr2 = hap2.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)
 */
      __pyx_t_12 = 0;
      __pyx_t_13 = 0;
      __pyx_v_nv1 = __pyx_t_12;
      __pyx_v_nv2 = __pyx_t_13;

      /* "vcfutils.pyx":740
 *             thisGTs.append(str(altIndex1) +  "/" +str( altIndex2))
 *             nv1, nv2 = 0, 0
 *             alignScoreArr1 = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)             # <<<<<<<<<<<<<<
 *             alignScoreArr2 = hap2.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)
 *             for readIndex from 0<= readIndex < nReads:
 */
      __pyx_v_alignScoreArr1 = ((struct __pyx_vtabstruct_10chaplotype_Haplotype *)__pyx_v_hap1->__pyx_vtab)->alignReads(__pyx_v_hap1, __pyx_v_index, __pyx_v_theBuffer->reads->windowStart, __pyx_v_theBuffer->reads->windowEnd, __pyx_v_theBuffer->badReads->windowStart, __pyx_v_theBuffer->badReads->windowEnd, __pyx_v_theBuffer->brokenMates->windowStart, __pyx_v_theBuffer->brokenMates->windowEnd, 1);

      /* "vcfutils.pyx":741
 *             nv1, nv2 = 0, 0
 *             alignScoreArr1 = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)
 *             alignScoreArr2 = hap2.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)             # <<<<<<<<<<<<<<
 *             for readIndex from 0<= readIndex < nReads:
 *                 if alignScoreArr1[readIndex]==999 and alignScoreArr2[readIndex] ==999:
 */
      __pyx_v_alignScoreArr2 = ((struct __pyx_vtabstruct_10chaplotype_Haplotype *)__pyx_v_hap2->__pyx_vtab)->alignReads(__pyx_v_hap2, __pyx_v_index, __pyx_v_theBuffer->reads->windowStart, __pyx_v_theBuffer->reads->windowEnd, __pyx_v_theBuffer->badReads->windowStart, __pyx_v_theBuffer->badReads->windowEnd, __pyx_v_theBuffer->brokenMates->windowStart, __pyx_v_theBuffer->brokenMates->windowEnd, 1);

      /* "vcfutils.pyx":742
 *             alignScoreArr1 = hap1.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)
 *             alignScoreArr2 = hap2.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)
 *             for readIndex from 0<= readIndex < nReads:             # <<<<<<<<<<<<<<
 *                 if alignScoreArr1[readIndex]==999 and alignScoreArr2[readIndex] ==999:
 *                     break
 */
      __pyx_t_13 = __pyx_v_nReads;
      for (__pyx_v_readIndex = 0; __pyx_v_readIndex < __pyx_t_13; __pyx_v_readIndex++) {

        /* "vcfutils.pyx":743
 *             alignScoreArr2 = hap2.alignReads(index, theBuffer.reads.windowStart, theBuffer.reads.windowEnd, theBuffer.badReads.windowStart, theBuffer.badReads.windowEnd, theBuffer.brokenMates.windowStart, theBuffer.brokenMates.windowEnd, True)
 *             for readIndex from 0<= readIndex < nReads:
 *                 if alignScoreArr1[readIndex]==999 and alignScoreArr2[readIndex] ==999:             # <<<<<<<<<<<<<<
 *                     break
 *                 score1 = -10 *  alignScoreArr1[readIndex]
 */
        __pyx_t_16 = (((__pyx_v_alignScoreArr1[__pyx_v_readIndex]) == 999.0) != 0);
        if (__pyx_t_16) {
          __pyx_t_4 = (((__pyx_v_alignScoreArr2[__pyx_v_readIndex]) == 999.0) != 0);
          __pyx_t_15 = __pyx_t_4;
        } else {
          __pyx_t_15 = __pyx_t_16;
        }
        if (__pyx_t_15) {

          /* "vcfutils.pyx":744
 *             for readIndex from 0<= readIndex < nReads:
 *                 if alignScoreArr1[readIndex]==999 and alignScoreArr2[readIndex] ==999:
 *                     break             # <<<<<<<<<<<<<<
 *                 score1 = -10 *  alignScoreArr1[readIndex]
 *                 score2 = -10 *  alignScoreArr2[readIndex]
 */
          goto __pyx_L28_break;
          goto __pyx_L29;
        }
        __pyx_L29:;

        /* "vcfutils.pyx":745
 *                 if alignScoreArr1[readIndex]==999 and alignScoreArr2[readIndex] ==999:
 *                     break
 *                 score1 = -10 *  alignScoreArr1[readIndex]             # <<<<<<<<<<<<<<
 *                 score2 = -10 *  alignScoreArr2[readIndex]
 *                 if score1 < 5:  nv1 +=1
 */
        __pyx_v_score1 = (-10.0 * (__pyx_v_alignScoreArr1[__pyx_v_readIndex]));

        /* "vcfutils.pyx":746
 *                     break
 *                 score1 = -10 *  alignScoreArr1[readIndex]
 *                 score2 = -10 *  alignScoreArr2[readIndex]             # <<<<<<<<<<<<<<
 *                 if score1 < 5:  nv1 +=1
 *                 if score2 < 5:  nv2 +=1
 */
        __pyx_v_score2 = (-10.0 * (__pyx_v_alignScoreArr2[__pyx_v_readIndex]));

        /* "vcfutils.pyx":747
 *                 score1 = -10 *  alignScoreArr1[readIndex]
 *                 score2 = -10 *  alignScoreArr2[readIndex]
 *                 if score1 < 5:  nv1 +=1             # <<<<<<<<<<<<<<
 *                 if score2 < 5:  nv2 +=1
 *             thisNV1.append(nv1)
 */
        __pyx_t_15 = ((__pyx_v_score1 < 5.0) != 0);
        if (__pyx_t_15) {
          __pyx_v_nv1 = (__pyx_v_nv1 + 1);
          goto __pyx_L30;
        }
        __pyx_L30:;

        /* "vcfutils.pyx":748
 *                 score2 = -10 *  alignScoreArr2[readIndex]
 *                 if score1 < 5:  nv1 +=1
 *                 if score2 < 5:  nv2 +=1             # <<<<<<<<<<<<<<
 *             thisNV1.append(nv1)
 *             thisNV2.append(nv2)
 */
        __pyx_t_15 = ((__pyx_v_score2 < 5.0) != 0);
        if (__pyx_t_15) {
          __pyx_v_nv2 = (__pyx_v_nv2 + 1);
          goto __pyx_L31;
        }
        __pyx_L31:;
      }
      __pyx_L28_break:;

      /* "vcfutils.pyx":749
 *                 if score1 < 5:  nv1 +=1
 *                 if score2 < 5:  nv2 +=1
 *             thisNV1.append(nv1)             # <<<<<<<<<<<<<<
 *             thisNV2.append(nv2)
 *         if maxEMLikelihood!=0.0:
 */
      __pyx_t_9 = PyInt_FromLong(__pyx_v_nv1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_thisNV1, __pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "vcfutils.pyx":750
 *                 if score2 < 5:  nv2 +=1
 *             thisNV1.append(nv1)
 *             thisNV2.append(nv2)             # <<<<<<<<<<<<<<
 *         if maxEMLikelihood!=0.0:
 *             confidenceScore = -(maxEMLikelihood - secondMaxLikelihood) *  (windowEnd - windowStart)/maxEMLikelihood
 */
      __pyx_t_9 = PyInt_FromLong(__pyx_v_nv2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_thisNV2, __pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "vcfutils.pyx":751
 *             thisNV1.append(nv1)
 *             thisNV2.append(nv2)
 *         if maxEMLikelihood!=0.0:             # <<<<<<<<<<<<<<
 *             confidenceScore = -(maxEMLikelihood - secondMaxLikelihood) *  (windowEnd - windowStart)/maxEMLikelihood
 *         elif len(haplotypes) > 1:
 */
    __pyx_t_15 = ((__pyx_v_maxEMLikelihood != 0.0) != 0);
    if (__pyx_t_15) {

      /* "vcfutils.pyx":752
 *             thisNV2.append(nv2)
 *         if maxEMLikelihood!=0.0:
 *             confidenceScore = -(maxEMLikelihood - secondMaxLikelihood) *  (windowEnd - windowStart)/maxEMLikelihood             # <<<<<<<<<<<<<<
 *         elif len(haplotypes) > 1:
 *             confidenceScore = maxEMLikelihood - secondMaxLikelihood
 */
      __pyx_v_confidenceScore = (((-(__pyx_v_maxEMLikelihood - __pyx_v_secondMaxLikelihood)) * (__pyx_v_windowEnd - __pyx_v_windowStart)) / __pyx_v_maxEMLikelihood);
      goto __pyx_L32;
    }

    /* "vcfutils.pyx":753
 *         if maxEMLikelihood!=0.0:
 *             confidenceScore = -(maxEMLikelihood - secondMaxLikelihood) *  (windowEnd - windowStart)/maxEMLikelihood
 *         elif len(haplotypes) > 1:             # <<<<<<<<<<<<<<
 *             confidenceScore = maxEMLikelihood - secondMaxLikelihood
 *         else:
 */
    if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_haplotypes)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((__pyx_t_2 > 1) != 0);
    if (__pyx_t_15) {

      /* "vcfutils.pyx":754
 *             confidenceScore = -(maxEMLikelihood - secondMaxLikelihood) *  (windowEnd - windowStart)/maxEMLikelihood
 *         elif len(haplotypes) > 1:
 *             confidenceScore = maxEMLikelihood - secondMaxLikelihood             # <<<<<<<<<<<<<<
 *         else:
 *             confidenceScore = 100
 */
      __pyx_v_confidenceScore = (__pyx_v_maxEMLikelihood - __pyx_v_secondMaxLikelihood);
      goto __pyx_L32;
    }
    /*else*/ {

      /* "vcfutils.pyx":756
 *             confidenceScore = maxEMLikelihood - secondMaxLikelihood
 *         else:
 *             confidenceScore = 100             # <<<<<<<<<<<<<<
 * 
 *         genotypeCalls.append(indexOfBestGenotype)
 */
      __pyx_v_confidenceScore = 100.0;
    }
    __pyx_L32:;

    /* "vcfutils.pyx":758
 *             confidenceScore = 100
 * 
 *         genotypeCalls.append(indexOfBestGenotype)             # <<<<<<<<<<<<<<
 *         allGTs.append(thisGTs)
 *         GLs.append(maxEMLikelihood)
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_genotypeCalls, ((PyObject *)__pyx_v_indexOfBestGenotype)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":759
 * 
 *         genotypeCalls.append(indexOfBestGenotype)
 *         allGTs.append(thisGTs)             # <<<<<<<<<<<<<<
 *         GLs.append(maxEMLikelihood)
 *         NV1s.append(thisNV1)
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_allGTs, ((PyObject *)__pyx_v_thisGTs)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":760
 *         genotypeCalls.append(indexOfBestGenotype)
 *         allGTs.append(thisGTs)
 *         GLs.append(maxEMLikelihood)             # <<<<<<<<<<<<<<
 *         NV1s.append(thisNV1)
 *         NV2s.append(thisNV2)
 */
    __pyx_t_10 = PyFloat_FromDouble(__pyx_v_maxEMLikelihood); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_GLs, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "vcfutils.pyx":761
 *         allGTs.append(thisGTs)
 *         GLs.append(maxEMLikelihood)
 *         NV1s.append(thisNV1)             # <<<<<<<<<<<<<<
 *         NV2s.append(thisNV2)
 *         CFs.append(confidenceScore)
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_NV1s, ((PyObject *)__pyx_v_thisNV1)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":762
 *         GLs.append(maxEMLikelihood)
 *         NV1s.append(thisNV1)
 *         NV2s.append(thisNV2)             # <<<<<<<<<<<<<<
 *         CFs.append(confidenceScore)
 *     if options.alignScoreFile != "":
 */
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_NV2s, ((PyObject *)__pyx_v_thisNV2)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":763
 *         NV1s.append(thisNV1)
 *         NV2s.append(thisNV2)
 *         CFs.append(confidenceScore)             # <<<<<<<<<<<<<<
 *     if options.alignScoreFile != "":
 *         fo.close()
 */
    __pyx_t_10 = PyFloat_FromDouble(__pyx_v_confidenceScore); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_CFs, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_L4_continue:;
  }

  /* "vcfutils.pyx":764
 *         NV2s.append(thisNV2)
 *         CFs.append(confidenceScore)
 *     if options.alignScoreFile != "":             # <<<<<<<<<<<<<<
 *         fo.close()
 * 
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__alignScoreFile); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_kp_s_21), Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_15) {

    /* "vcfutils.pyx":765
 *         CFs.append(confidenceScore)
 *     if options.alignScoreFile != "":
 *         fo.close()             # <<<<<<<<<<<<<<
 * 
 *     theId = "."
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s__close); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __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_10); __pyx_t_10 = 0;
    goto __pyx_L33;
  }
  __pyx_L33:;

  /* "vcfutils.pyx":767
 *         fo.close()
 * 
 *     theId = "."             # <<<<<<<<<<<<<<
 *     qual = -1
 *     format = 'GT:GL:NR:NV1:NV2'
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
  __pyx_v_theId = ((PyObject *)__pyx_kp_s_10);

  /* "vcfutils.pyx":768
 * 
 *     theId = "."
 *     qual = -1             # <<<<<<<<<<<<<<
 *     format = 'GT:GL:NR:NV1:NV2'
 *     linefilter = ["PASS"]
 */
  __Pyx_INCREF(__pyx_int_neg_1);
  __pyx_v_qual = __pyx_int_neg_1;

  /* "vcfutils.pyx":769
 *     theId = "."
 *     qual = -1
 *     format = 'GT:GL:NR:NV1:NV2'             # <<<<<<<<<<<<<<
 *     linefilter = ["PASS"]
 *     linefilter = ""
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_26));
  __pyx_v_format = ((PyObject *)__pyx_kp_s_26);

  /* "vcfutils.pyx":770
 *     qual = -1
 *     format = 'GT:GL:NR:NV1:NV2'
 *     linefilter = ["PASS"]             # <<<<<<<<<<<<<<
 *     linefilter = ""
 *     qual = max([int(cf) for cf in CFs])
 */
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__PASS));
  PyList_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_n_s__PASS));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PASS));
  __pyx_v_linefilter = ((PyObject *)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "vcfutils.pyx":771
 *     format = 'GT:GL:NR:NV1:NV2'
 *     linefilter = ["PASS"]
 *     linefilter = ""             # <<<<<<<<<<<<<<
 *     qual = max([int(cf) for cf in CFs])
 *     if alts== []:
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_21));
  __Pyx_DECREF(__pyx_v_linefilter);
  __pyx_v_linefilter = ((PyObject *)__pyx_kp_s_21);

  /* "vcfutils.pyx":772
 *     linefilter = ["PASS"]
 *     linefilter = ""
 *     qual = max([int(cf) for cf in CFs])             # <<<<<<<<<<<<<<
 *     if alts== []:
 *         alts = ["."]
 */
  __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = ((PyObject *)__pyx_v_CFs); __Pyx_INCREF(__pyx_t_9); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_9)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_7 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_7 = PySequence_ITEM(__pyx_t_9, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF(__pyx_v_cf);
    __pyx_v_cf = __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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_cf);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_cf);
    __Pyx_GIVEREF(__pyx_v_cf);
    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_10));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
  __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_v_qual);
  __pyx_v_qual = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "vcfutils.pyx":773
 *     linefilter = ""
 *     qual = max([int(cf) for cf in CFs])
 *     if alts== []:             # <<<<<<<<<<<<<<
 *         alts = ["."]
 *         linefilter = "REFCALL"
 */
  __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyObject_RichCompare(((PyObject *)__pyx_v_alts), ((PyObject *)__pyx_t_10), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_15) {

    /* "vcfutils.pyx":774
 *     qual = max([int(cf) for cf in CFs])
 *     if alts== []:
 *         alts = ["."]             # <<<<<<<<<<<<<<
 *         linefilter = "REFCALL"
 *     else:
 */
    __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_10));
    PyList_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_10));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10));
    __Pyx_DECREF(((PyObject *)__pyx_v_alts));
    __pyx_v_alts = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":775
 *     if alts== []:
 *         alts = ["."]
 *         linefilter = "REFCALL"             # <<<<<<<<<<<<<<
 *     else:
 *         linefilter = "PASS"
 */
    __Pyx_INCREF(((PyObject *)__pyx_n_s__REFCALL));
    __Pyx_DECREF(__pyx_v_linefilter);
    __pyx_v_linefilter = ((PyObject *)__pyx_n_s__REFCALL);
    goto __pyx_L36;
  }
  /*else*/ {

    /* "vcfutils.pyx":777
 *         linefilter = "REFCALL"
 *     else:
 *         linefilter = "PASS"             # <<<<<<<<<<<<<<
 * 
 *     infoLine = "WS=" + str(windowStart+1) + ";WE=" + str(windowEnd) + ";Size=" + str(windowEnd - windowStart + 1) + ";varSource=" + ",".join(map(str, list(varSource)))
 */
    __Pyx_INCREF(((PyObject *)__pyx_n_s__PASS));
    __Pyx_DECREF(__pyx_v_linefilter);
    __pyx_v_linefilter = ((PyObject *)__pyx_n_s__PASS);
  }
  __pyx_L36:;

  /* "vcfutils.pyx":779
 *         linefilter = "PASS"
 * 
 *     infoLine = "WS=" + str(windowStart+1) + ";WE=" + str(windowEnd) + ";Size=" + str(windowEnd - windowStart + 1) + ";varSource=" + ",".join(map(str, list(varSource)))             # <<<<<<<<<<<<<<
 *     theLine = "\t".join([chrom, str(windowStart+1), theId, ref, ",".join(alts), str(qual), linefilter,  infoLine, format])
 * 
 */
  __pyx_t_9 = PyInt_FromLong((__pyx_v_windowStart + 1)); 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_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_10), NULL); 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_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_t_10 = PyNumber_Add(((PyObject *)__pyx_kp_s_27), __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyNumber_Add(__pyx_t_10, ((PyObject *)__pyx_kp_s_28)); 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_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyInt_FromLong(__pyx_v_windowEnd); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __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;
  __pyx_t_10 = PyNumber_Add(__pyx_t_8, ((PyObject *)__pyx_kp_s_29)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyInt_FromLong(((__pyx_v_windowEnd - __pyx_v_windowStart) + 1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __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 = 779; __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 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_t_8); 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_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Add(__pyx_t_9, ((PyObject *)__pyx_kp_s_30)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __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_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_31), __pyx_n_s__join); 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_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(((PyObject *)__pyx_v_varSource));
  PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_v_varSource));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_varSource));
  __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
  PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
  __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(((PyObject *)__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 = 779; __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_t_7 = 0;
  __pyx_t_7 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_infoLine = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "vcfutils.pyx":780
 * 
 *     infoLine = "WS=" + str(windowStart+1) + ";WE=" + str(windowEnd) + ";Size=" + str(windowEnd - windowStart + 1) + ";varSource=" + ",".join(map(str, list(varSource)))
 *     theLine = "\t".join([chrom, str(windowStart+1), theId, ref, ",".join(alts), str(qual), linefilter,  infoLine, format])             # <<<<<<<<<<<<<<
 * 
 *     # Now pull out the genotype informations for each sample, and compute genotype likelihoods and
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_25), __pyx_n_s__join); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_7 = PyInt_FromLong((__pyx_v_windowStart + 1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __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 = 780; __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 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_31), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __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 = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_alts));
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_alts));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_alts));
  __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_qual);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_qual);
  __Pyx_GIVEREF(__pyx_v_qual);
  __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  __pyx_t_9 = PyList_New(9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_INCREF(((PyObject *)__pyx_v_chrom));
  PyList_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_chrom));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_chrom));
  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_theId);
  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_v_theId);
  __Pyx_GIVEREF(__pyx_v_theId);
  __Pyx_INCREF(__pyx_v_ref);
  PyList_SET_ITEM(__pyx_t_9, 3, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyList_SET_ITEM(__pyx_t_9, 4, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_9, 5, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_linefilter);
  PyList_SET_ITEM(__pyx_t_9, 6, __pyx_v_linefilter);
  __Pyx_GIVEREF(__pyx_v_linefilter);
  __Pyx_INCREF(__pyx_v_infoLine);
  PyList_SET_ITEM(__pyx_t_9, 7, __pyx_v_infoLine);
  __Pyx_GIVEREF(__pyx_v_infoLine);
  __Pyx_INCREF(__pyx_v_format);
  PyList_SET_ITEM(__pyx_t_9, 8, __pyx_v_format);
  __Pyx_GIVEREF(__pyx_v_format);
  __pyx_t_7 = 0;
  __pyx_t_1 = 0;
  __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __pyx_v_theLine = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "vcfutils.pyx":784
 *     # Now pull out the genotype informations for each sample, and compute genotype likelihoods and
 * 
 *     for i from 0 <= i < nIndividuals:             # <<<<<<<<<<<<<<
 *         theBuffer = readBuffers[i]
 *         thisSample = theBuffer.sample
 */
  __pyx_t_5 = __pyx_v_nIndividuals;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {

    /* "vcfutils.pyx":785
 * 
 *     for i from 0 <= i < nIndividuals:
 *         theBuffer = readBuffers[i]             # <<<<<<<<<<<<<<
 *         thisSample = theBuffer.sample
 *         sampleLine = ":".join([",".join(allGTs[i]), str(GLs[i]), str(NRs[i]), ",".join(map(str, NV1s[i])), ",".join(map(str, NV2s[i]))])
 */
    if (unlikely(((PyObject *)__pyx_v_readBuffers) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_readBuffers), __pyx_v_i, sizeof(long), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_7cwindow_bamReadBuffer))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_theBuffer));
    __pyx_v_theBuffer = ((struct __pyx_obj_7cwindow_bamReadBuffer *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":786
 *     for i from 0 <= i < nIndividuals:
 *         theBuffer = readBuffers[i]
 *         thisSample = theBuffer.sample             # <<<<<<<<<<<<<<
 *         sampleLine = ":".join([",".join(allGTs[i]), str(GLs[i]), str(NRs[i]), ",".join(map(str, NV1s[i])), ",".join(map(str, NV2s[i]))])
 *         theLine += "\t" + sampleLine
 */
    __pyx_t_9 = ((PyObject *)__pyx_v_theBuffer->sample);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_XDECREF(((PyObject *)__pyx_v_thisSample));
    __pyx_v_thisSample = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "vcfutils.pyx":787
 *         theBuffer = readBuffers[i]
 *         thisSample = theBuffer.sample
 *         sampleLine = ":".join([",".join(allGTs[i]), str(GLs[i]), str(NRs[i]), ",".join(map(str, NV1s[i])), ",".join(map(str, NV2s[i]))])             # <<<<<<<<<<<<<<
 *         theLine += "\t" + sampleLine
 * 
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_32), __pyx_n_s__join); 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_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_31), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_allGTs), __pyx_v_i, sizeof(long), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_GLs), __pyx_v_i, sizeof(long), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_NRs), __pyx_v_i, sizeof(long), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_31), __pyx_n_s__join); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_NV1s), __pyx_v_i, sizeof(long), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __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_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__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 = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_31), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_NV2s), __pyx_v_i, sizeof(long), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
    PyTuple_SET_ITEM(__pyx_t_21, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
    __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
    PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_21), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
    __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_21);
    PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_21), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
    __pyx_t_21 = PyList_New(5); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_21);
    PyList_SET_ITEM(__pyx_t_21, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    PyList_SET_ITEM(__pyx_t_21, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_21, 2, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_21, 3, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_21, 4, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_10 = 0;
    __pyx_t_1 = 0;
    __pyx_t_8 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_21));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_21));
    __pyx_t_21 = 0;
    __pyx_t_21 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_21);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_sampleLine);
    __pyx_v_sampleLine = __pyx_t_21;
    __pyx_t_21 = 0;

    /* "vcfutils.pyx":788
 *         thisSample = theBuffer.sample
 *         sampleLine = ":".join([",".join(allGTs[i]), str(GLs[i]), str(NRs[i]), ",".join(map(str, NV1s[i])), ",".join(map(str, NV2s[i]))])
 *         theLine += "\t" + sampleLine             # <<<<<<<<<<<<<<
 * 
 *     outputFile.write("%s\n" %(theLine))
 */
    __pyx_t_21 = PyNumber_Add(((PyObject *)__pyx_kp_s_25), __pyx_v_sampleLine); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_21);
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_theLine, __pyx_t_21); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
    __Pyx_DECREF(__pyx_v_theLine);
    __pyx_v_theLine = __pyx_t_7;
    __pyx_t_7 = 0;
  }

  /* "vcfutils.pyx":790
 *         theLine += "\t" + sampleLine
 * 
 *     outputFile.write("%s\n" %(theLine))             # <<<<<<<<<<<<<<
 *     free(gof)
 *     logger.debug('Out vcf writing')
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_outputFile, __pyx_n_s__write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_21 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_v_theLine); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_21));
  __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_21));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_21));
  __pyx_t_21 = 0;
  __pyx_t_21 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_21);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;

  /* "vcfutils.pyx":791
 * 
 *     outputFile.write("%s\n" %(theLine))
 *     free(gof)             # <<<<<<<<<<<<<<
 *     logger.debug('Out vcf writing')
 * ###################################################################################################
 */
  free(__pyx_v_gof);

  /* "vcfutils.pyx":792
 *     outputFile.write("%s\n" %(theLine))
 *     free(gof)
 *     logger.debug('Out vcf writing')             # <<<<<<<<<<<<<<
 * ###################################################################################################
 * 
 */
  __pyx_t_21 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_21);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s__debug); 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_DECREF(__pyx_t_21); __pyx_t_21 = 0;
  __pyx_t_21 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_21);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __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_21);
  __Pyx_WriteUnraisable("vcfutils.outputHLACallToVCF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_haplotype);
  __Pyx_XDECREF((PyObject *)__pyx_v_theBuffer);
  __Pyx_XDECREF(__pyx_v_thisSample);
  __Pyx_XDECREF((PyObject *)__pyx_v_longVar);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_alts);
  __Pyx_XDECREF(__pyx_v_indexOfBestGenotype);
  __Pyx_XDECREF((PyObject *)__pyx_v_gt);
  __Pyx_XDECREF(__pyx_v_genotypeCalls);
  __Pyx_XDECREF(__pyx_v_allGTs);
  __Pyx_XDECREF(__pyx_v_thisGTs);
  __Pyx_XDECREF(__pyx_v_GLs);
  __Pyx_XDECREF(__pyx_v_NRs);
  __Pyx_XDECREF(__pyx_v_NV1s);
  __Pyx_XDECREF(__pyx_v_NV2s);
  __Pyx_XDECREF(__pyx_v_CFs);
  __Pyx_XDECREF(__pyx_v_secondMaxCandidates);
  __Pyx_XDECREF((PyObject *)__pyx_v_hap1);
  __Pyx_XDECREF((PyObject *)__pyx_v_hap2);
  __Pyx_XDECREF(__pyx_v_thisNV1);
  __Pyx_XDECREF(__pyx_v_thisNV2);
  __Pyx_XDECREF(__pyx_v_varSource);
  __Pyx_XDECREF(__pyx_v_ref);
  __Pyx_XDECREF(__pyx_v_fo);
  __Pyx_XDECREF(__pyx_v_thisStr);
  __Pyx_XDECREF(__pyx_v_LKs);
  __Pyx_XDECREF(__pyx_v_tempIndex);
  __Pyx_XDECREF(__pyx_v_gtIndex);
  __Pyx_XDECREF(__pyx_v_altIndex1);
  __Pyx_XDECREF(__pyx_v_altIndex2);
  __Pyx_XDECREF(__pyx_v_theId);
  __Pyx_XDECREF(__pyx_v_qual);
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_XDECREF(__pyx_v_linefilter);
  __Pyx_XDECREF(__pyx_v_infoLine);
  __Pyx_XDECREF(__pyx_v_theLine);
  __Pyx_XDECREF(__pyx_v_sampleLine);
  __Pyx_XDECREF(__pyx_v_cf);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_8vcfutils_3trimLeftPadding(PyObject *__pyx_self, PyObject *__pyx_v_vcfDataLine); /*proto*/
static char __pyx_doc_8vcfutils_2trimLeftPadding[] = "\n    This is a small hack to make sure that no un-needed left padding is left\n    in the VCF output.\n    ";
static PyMethodDef __pyx_mdef_8vcfutils_3trimLeftPadding = {__Pyx_NAMESTR("trimLeftPadding"), (PyCFunction)__pyx_pw_8vcfutils_3trimLeftPadding, METH_O, __Pyx_DOCSTR(__pyx_doc_8vcfutils_2trimLeftPadding)};
static PyObject *__pyx_pw_8vcfutils_3trimLeftPadding(PyObject *__pyx_self, PyObject *__pyx_v_vcfDataLine) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("trimLeftPadding (wrapper)", 0);
  __pyx_r = __pyx_pf_8vcfutils_2trimLeftPadding(__pyx_self, ((PyObject *)__pyx_v_vcfDataLine));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8vcfutils_15trimLeftPadding_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "vcfutils.pyx":815
 *         for i in range(1, minLenRefAlt):
 * 
 *             firstAltChars = list(set(allele[0].upper() for allele in alt))             # <<<<<<<<<<<<<<
 *             secondAltChars = list(set(allele[1].upper() for allele in alt if len(allele) > 1))
 *             firstRefChar = ref[0].upper()
 */

static PyObject *__pyx_pf_8vcfutils_15trimLeftPadding_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8vcfutils___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_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *)__pyx_tp_new_8vcfutils___pyx_scope_struct_1_genexpr(__pyx_ptype_8vcfutils___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_8vcfutils___pyx_scope_struct__trimLeftPadding *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8vcfutils_15trimLeftPadding_2generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("vcfutils.trimLeftPadding.genexpr", __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_8vcfutils_15trimLeftPadding_2generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8vcfutils___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)(PyObject *);
  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
  __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 = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt)) { __Pyx_RaiseClosureNameError("alt"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __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 = 815; __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 = 815; __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 = 815; __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 = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_allele);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_allele);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_allele = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_allele, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__upper); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __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;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __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;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __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;
}
static PyObject *__pyx_gb_8vcfutils_15trimLeftPadding_5generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "vcfutils.pyx":816
 * 
 *             firstAltChars = list(set(allele[0].upper() for allele in alt))
 *             secondAltChars = list(set(allele[1].upper() for allele in alt if len(allele) > 1))             # <<<<<<<<<<<<<<
 *             firstRefChar = ref[0].upper()
 * 
 */

static PyObject *__pyx_pf_8vcfutils_15trimLeftPadding_3genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8vcfutils___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_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *)__pyx_tp_new_8vcfutils___pyx_scope_struct_2_genexpr(__pyx_ptype_8vcfutils___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_8vcfutils___pyx_scope_struct__trimLeftPadding *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8vcfutils_15trimLeftPadding_5generator1, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("vcfutils.trimLeftPadding.genexpr", __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_8vcfutils_15trimLeftPadding_5generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8vcfutils___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)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = 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_L7_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 = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt)) { __Pyx_RaiseClosureNameError("alt"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __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 = 816; __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 = 816; __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 = 816; __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 = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_allele);
    __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_allele);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_cur_scope->__pyx_v_allele = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_allele); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = ((__pyx_t_5 > 1) != 0);
    if (__pyx_t_6) {
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_allele, 1, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__upper); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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_cur_scope->__pyx_t_2 = __pyx_t_3;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      /* return from generator, yielding value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L7_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;
      __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
      if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __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;
}

/* "vcfutils.pyx":796
 * 
 * 
 * def trimLeftPadding(vcfDataLine):             # <<<<<<<<<<<<<<
 *     """
 *     This is a small hack to make sure that no un-needed left padding is left
 */

static PyObject *__pyx_pf_8vcfutils_2trimLeftPadding(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vcfDataLine) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *__pyx_cur_scope;
  PyObject *__pyx_v_ref = NULL;
  PyObject *__pyx_v_minLenRefAlt = NULL;
  PyObject *__pyx_v_maxLenDiff = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_firstAltChars = NULL;
  PyObject *__pyx_v_secondAltChars = NULL;
  PyObject *__pyx_v_firstRefChar = NULL;
  PyObject *__pyx_v_allele = 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 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("trimLeftPadding", 0);
  __pyx_cur_scope = (struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *)__pyx_tp_new_8vcfutils___pyx_scope_struct__trimLeftPadding(__pyx_ptype_8vcfutils___pyx_scope_struct__trimLeftPadding, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);

  /* "vcfutils.pyx":801
 *     in the VCF output.
 *     """
 *     ref = vcfDataLine['ref']             # <<<<<<<<<<<<<<
 *     alt = vcfDataLine['alt']
 * 
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_v_vcfDataLine, ((PyObject *)__pyx_n_s__ref)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":802
 *     """
 *     ref = vcfDataLine['ref']
 *     alt = vcfDataLine['alt']             # <<<<<<<<<<<<<<
 * 
 *     #logger.info("ref = %s. alt = %s. pos = %s" %(ref, alt, vcfDataLine['pos']))
 */
  __pyx_t_1 = PyObject_GetItem(__pyx_v_vcfDataLine, ((PyObject *)__pyx_n_s__alt)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_alt = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":806
 *     #logger.info("ref = %s. alt = %s. pos = %s" %(ref, alt, vcfDataLine['pos']))
 * 
 *     if alt == []:             # <<<<<<<<<<<<<<
 *         pass
 *     else:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_alt, ((PyObject *)__pyx_t_1), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__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 = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    goto __pyx_L3;
  }
  /*else*/ {

    /* "vcfutils.pyx":810
 *     else:
 *         # Only loop up to length of shortest of all ref/alt sequences
 *         minLenRefAlt = min(len(ref), min(map(len,alt)))             # <<<<<<<<<<<<<<
 *         maxLenDiff = max([abs(len(ref) - len(allele)) for allele in alt])
 * 
 */
    __pyx_t_2 = __Pyx_GetBuiltinName(__pyx_n_s__len); 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_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __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_cur_scope->__pyx_v_alt);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_alt);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alt);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_1), 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_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __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 = PyObject_Call(__pyx_builtin_min, ((PyObject *)__pyx_t_1), 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_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_4 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_3) {
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_1 = __pyx_t_2;
    } else {
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = __pyx_t_6;
      __pyx_t_6 = 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_minLenRefAlt = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "vcfutils.pyx":811
 *         # Only loop up to length of shortest of all ref/alt sequences
 *         minLenRefAlt = min(len(ref), min(map(len,alt)))
 *         maxLenDiff = max([abs(len(ref) - len(allele)) for allele in alt])             # <<<<<<<<<<<<<<
 * 
 *         for i in range(1, minLenRefAlt):
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_alt) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_alt)) {
      __pyx_t_1 = __pyx_cur_scope->__pyx_v_alt; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_7 && 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 = 811; __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 = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && 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 = 811; __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 = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_6 = __pyx_t_7(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF(__pyx_v_allele);
      __pyx_v_allele = __pyx_t_6;
      __pyx_t_6 = 0;
      __pyx_t_8 = PyObject_Length(__pyx_v_ref); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = PyObject_Length(__pyx_v_allele); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_8 - __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyNumber_Absolute(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __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_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_maxLenDiff = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "vcfutils.pyx":813
 *         maxLenDiff = max([abs(len(ref) - len(allele)) for allele in alt])
 * 
 *         for i in range(1, minLenRefAlt):             # <<<<<<<<<<<<<<
 * 
 *             firstAltChars = list(set(allele[0].upper() for allele in alt))
 */
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __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_minLenRefAlt);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_minLenRefAlt);
    __Pyx_GIVEREF(__pyx_v_minLenRefAlt);
    __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__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_4 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_2);
        if (unlikely(!__pyx_t_1)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF(__pyx_v_i);
      __pyx_v_i = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "vcfutils.pyx":815
 *         for i in range(1, minLenRefAlt):
 * 
 *             firstAltChars = list(set(allele[0].upper() for allele in alt))             # <<<<<<<<<<<<<<
 *             secondAltChars = list(set(allele[1].upper() for allele in alt if len(allele) > 1))
 *             firstRefChar = ref[0].upper()
 */
      __pyx_t_1 = __pyx_pf_8vcfutils_15trimLeftPadding_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __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 = 815; __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 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__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 = 815; __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 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_firstAltChars));
      __pyx_v_firstAltChars = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "vcfutils.pyx":816
 * 
 *             firstAltChars = list(set(allele[0].upper() for allele in alt))
 *             secondAltChars = list(set(allele[1].upper() for allele in alt if len(allele) > 1))             # <<<<<<<<<<<<<<
 *             firstRefChar = ref[0].upper()
 * 
 */
      __pyx_t_1 = __pyx_pf_8vcfutils_15trimLeftPadding_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __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 = 816; __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 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__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 = 816; __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 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_secondAltChars));
      __pyx_v_secondAltChars = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "vcfutils.pyx":817
 *             firstAltChars = list(set(allele[0].upper() for allele in alt))
 *             secondAltChars = list(set(allele[1].upper() for allele in alt if len(allele) > 1))
 *             firstRefChar = ref[0].upper()             # <<<<<<<<<<<<<<
 * 
 *             #logger.info("Len first alt chars = %s. First Ref = %s. First alt = %s" %(len(firstAltChars), firstRefChar, firstAltChars[0]))
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ref, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__upper); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_v_firstRefChar);
      __pyx_v_firstRefChar = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "vcfutils.pyx":823
 * 
 *             # Stop if alt alleles don't have same first character, or don't match ref
 *             if len(firstAltChars) > 1 or firstRefChar != firstAltChars[0]:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_9 = PyList_GET_SIZE(((PyObject *)__pyx_v_firstAltChars)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_3 = (__pyx_t_9 > 1);
      if (!__pyx_t_3) {
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_firstRefChar, PyList_GET_ITEM(__pyx_v_firstAltChars, 0), Py_NE); __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_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_10 < 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;
        __pyx_t_11 = __pyx_t_10;
      } else {
        __pyx_t_11 = __pyx_t_3;
      }
      if (__pyx_t_11) {

        /* "vcfutils.pyx":824
 *             # Stop if alt alleles don't have same first character, or don't match ref
 *             if len(firstAltChars) > 1 or firstRefChar != firstAltChars[0]:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             # Stop if there are indels present, and the 2nd base disagrees. This is because VCF
 */
        goto __pyx_L7_break;
        goto __pyx_L8;
      }

      /* "vcfutils.pyx":829
 *             # represents indels with a leading reference base. N.B. Need to check the second
 *             # base on all alt alleles, not just the first
 *             elif maxLenDiff > 0 and (len(secondAltChars) > 1 or ref[1] != secondAltChars[0]):             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_maxLenDiff, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_11) {
        __pyx_t_9 = PyList_GET_SIZE(((PyObject *)__pyx_v_secondAltChars)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_3 = (__pyx_t_9 > 1);
        if (!__pyx_t_3) {
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ref, 1, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, PyList_GET_ITEM(__pyx_v_secondAltChars, 0), Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_12 = __pyx_t_10;
        } else {
          __pyx_t_12 = __pyx_t_3;
        }
        __pyx_t_3 = __pyx_t_12;
      } else {
        __pyx_t_3 = __pyx_t_11;
      }
      if (__pyx_t_3) {

        /* "vcfutils.pyx":830
 *             # base on all alt alleles, not just the first
 *             elif maxLenDiff > 0 and (len(secondAltChars) > 1 or ref[1] != secondAltChars[0]):
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             # Trim one base from ref and all alts, and adjust position
 */
        goto __pyx_L7_break;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "vcfutils.pyx":833
 * 
 *             # Trim one base from ref and all alts, and adjust position
 *             ref, alt = ref[1:], [allele[1:] for allele in alt]             # <<<<<<<<<<<<<<
 *             vcfDataLine['pos'] += 1
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_ref, 1, 0, NULL, NULL, &__pyx_k_slice_35, 1, 0, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_alt) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_alt)) {
        __pyx_t_6 = __pyx_cur_scope->__pyx_v_alt; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
      }
      for (;;) {
        if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_6)) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_14 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_14); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_14 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_6)) {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_14); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_14 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          __pyx_t_14 = __pyx_t_13(__pyx_t_6);
          if (unlikely(!__pyx_t_14)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_14);
        }
        __Pyx_XDECREF(__pyx_v_allele);
        __pyx_v_allele = __pyx_t_14;
        __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_PyObject_GetSlice(__pyx_v_allele, 1, 0, NULL, NULL, &__pyx_k_slice_36, 1, 0, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_14))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_v_ref);
      __pyx_v_ref = __pyx_t_5;
      __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_alt);
      __Pyx_DECREF(__pyx_cur_scope->__pyx_v_alt);
      __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
      __pyx_cur_scope->__pyx_v_alt = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "vcfutils.pyx":834
 *             # Trim one base from ref and all alts, and adjust position
 *             ref, alt = ref[1:], [allele[1:] for allele in alt]
 *             vcfDataLine['pos'] += 1             # <<<<<<<<<<<<<<
 * 
 *     #logger.info("now ref = %s. alt = %s. pos = %s" %(ref, alt, vcfDataLine['pos']))
 */
      __Pyx_INCREF(((PyObject *)__pyx_n_s__pos));
      __pyx_t_15 = __pyx_n_s__pos;
      __pyx_t_1 = PyObject_GetItem(__pyx_v_vcfDataLine, ((PyObject *)__pyx_t_15)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PyObject_SetItem(__pyx_v_vcfDataLine, ((PyObject *)__pyx_t_15), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
    }
    __pyx_L7_break:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "vcfutils.pyx":838
 *     #logger.info("now ref = %s. alt = %s. pos = %s" %(ref, alt, vcfDataLine['pos']))
 * 
 *     vcfDataLine['ref'] = ref             # <<<<<<<<<<<<<<
 *     vcfDataLine['alt'] = alt
 * 
 */
  if (PyObject_SetItem(__pyx_v_vcfDataLine, ((PyObject *)__pyx_n_s__ref), __pyx_v_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "vcfutils.pyx":839
 * 
 *     vcfDataLine['ref'] = ref
 *     vcfDataLine['alt'] = alt             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  if (PyObject_SetItem(__pyx_v_vcfDataLine, ((PyObject *)__pyx_n_s__alt), __pyx_cur_scope->__pyx_v_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(((PyObject *)__pyx_t_15));
  __Pyx_AddTraceback("vcfutils.trimLeftPadding", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ref);
  __Pyx_XDECREF(__pyx_v_minLenRefAlt);
  __Pyx_XDECREF(__pyx_v_maxLenDiff);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_firstAltChars);
  __Pyx_XDECREF(__pyx_v_secondAltChars);
  __Pyx_XDECREF(__pyx_v_firstRefChar);
  __Pyx_XDECREF(__pyx_v_allele);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":843
 * ###################################################################################################
 * 
 * cdef tuple refAndAlt(char* chrom, int POS, list variants, FastaFile refFile):             # <<<<<<<<<<<<<<
 *     """
 *     Calculates the right REF and ALT fields for a set of variants.
 */

static PyObject *__pyx_f_8vcfutils_refAndAlt(char *__pyx_v_chrom, int __pyx_v_POS, PyObject *__pyx_v_variants, struct __pyx_obj_9fastafile_FastaFile *__pyx_v_refFile) {
  int __pyx_v_nonSnpPresent;
  int __pyx_v_indelPresent;
  struct __pyx_obj_7variant_Variant *__pyx_v_v = 0;
  PyObject *__pyx_v_ALT = 0;
  PyObject *__pyx_v_seq = 0;
  PyObject *__pyx_v_REF = 0;
  int __pyx_v_nAdded;
  int __pyx_v_nRemoved;
  PyObject *__pyx_v_rlen = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PY_LONG_LONG __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("refAndAlt", 0);

  /* "vcfutils.pyx":850
 *     http://1000genomes.org/wiki/doku.php?do=show&id=1000_genomes%3Aanalysis%3Avcf4.0
 *     """
 *     cdef int nonSnpPresent = 0             # <<<<<<<<<<<<<<
 *     cdef int indelPresent = 0
 *     cdef Variant v
 */
  __pyx_v_nonSnpPresent = 0;

  /* "vcfutils.pyx":851
 *     """
 *     cdef int nonSnpPresent = 0
 *     cdef int indelPresent = 0             # <<<<<<<<<<<<<<
 *     cdef Variant v
 *     cdef list ALT
 */
  __pyx_v_indelPresent = 0;

  /* "vcfutils.pyx":857
 *     cdef bytes REF
 * 
 *     for v in variants:             # <<<<<<<<<<<<<<
 *         nAdded = v.nAdded
 *         nRemoved = v.nRemoved
 */
  if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_variants); __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 = 857; __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 = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7variant_Variant))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_v));
    __pyx_v_v = ((struct __pyx_obj_7variant_Variant *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":858
 * 
 *     for v in variants:
 *         nAdded = v.nAdded             # <<<<<<<<<<<<<<
 *         nRemoved = v.nRemoved
 * 
 */
    __pyx_t_4 = __pyx_v_v->nAdded;
    __pyx_v_nAdded = __pyx_t_4;

    /* "vcfutils.pyx":859
 *     for v in variants:
 *         nAdded = v.nAdded
 *         nRemoved = v.nRemoved             # <<<<<<<<<<<<<<
 * 
 *         if nRemoved != 1 or nAdded != 1:
 */
    __pyx_t_4 = __pyx_v_v->nRemoved;
    __pyx_v_nRemoved = __pyx_t_4;

    /* "vcfutils.pyx":861
 *         nRemoved = v.nRemoved
 * 
 *         if nRemoved != 1 or nAdded != 1:             # <<<<<<<<<<<<<<
 *             nonSnpPresent = 1
 * 
 */
    __pyx_t_5 = ((__pyx_v_nRemoved != 1) != 0);
    if (!__pyx_t_5) {
      __pyx_t_6 = ((__pyx_v_nAdded != 1) != 0);
      __pyx_t_7 = __pyx_t_6;
    } else {
      __pyx_t_7 = __pyx_t_5;
    }
    if (__pyx_t_7) {

      /* "vcfutils.pyx":862
 * 
 *         if nRemoved != 1 or nAdded != 1:
 *             nonSnpPresent = 1             # <<<<<<<<<<<<<<
 * 
 *             if nRemoved != nAdded:
 */
      __pyx_v_nonSnpPresent = 1;

      /* "vcfutils.pyx":864
 *             nonSnpPresent = 1
 * 
 *             if nRemoved != nAdded:             # <<<<<<<<<<<<<<
 *                 indelPresent = 1
 * 
 */
      __pyx_t_7 = ((__pyx_v_nRemoved != __pyx_v_nAdded) != 0);
      if (__pyx_t_7) {

        /* "vcfutils.pyx":865
 * 
 *             if nRemoved != nAdded:
 *                 indelPresent = 1             # <<<<<<<<<<<<<<
 * 
 *     if not nonSnpPresent:
 */
        __pyx_v_indelPresent = 1;
        goto __pyx_L6;
      }
      __pyx_L6:;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vcfutils.pyx":867
 *                 indelPresent = 1
 * 
 *     if not nonSnpPresent:             # <<<<<<<<<<<<<<
 *         # Just SNPs
 *         REF = refFile.getCharacter(chrom, POS)
 */
  __pyx_t_7 = ((!(__pyx_v_nonSnpPresent != 0)) != 0);
  if (__pyx_t_7) {

    /* "vcfutils.pyx":869
 *     if not nonSnpPresent:
 *         # Just SNPs
 *         REF = refFile.getCharacter(chrom, POS)             # <<<<<<<<<<<<<<
 *         ALT = [ v.added for v in variants ]
 *         return REF,ALT
 */
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_chrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9fastafile_FastaFile *)__pyx_v_refFile->__pyx_vtab)->getCharacter(__pyx_v_refFile, ((PyObject*)__pyx_t_1), __pyx_v_POS)); 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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_REF = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":870
 *         # Just SNPs
 *         REF = refFile.getCharacter(chrom, POS)
 *         ALT = [ v.added for v in variants ]             # <<<<<<<<<<<<<<
 *         return REF,ALT
 *     else:
 */
    __pyx_t_3 = PyList_New(0); 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);
    if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = ((PyObject *)__pyx_v_variants); __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_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7variant_Variant))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_v));
      __pyx_v_v = ((struct __pyx_obj_7variant_Variant *)__pyx_t_8);
      __pyx_t_8 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_v_v->added))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_ALT = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":871
 *         REF = refFile.getCharacter(chrom, POS)
 *         ALT = [ v.added for v in variants ]
 *         return REF,ALT             # <<<<<<<<<<<<<<
 *     else:
 *         # If there are indels around, then the reference base is the base before the insertion
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_REF));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_REF));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_REF));
    __Pyx_INCREF(((PyObject *)__pyx_v_ALT));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_ALT));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ALT));
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "vcfutils.pyx":877
 *         # snps will have two bases
 * 
 *         rlen = max([v.nRemoved for v in variants]) # number of extra bases in REF             # <<<<<<<<<<<<<<
 *         REF = None
 * 
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = ((PyObject *)__pyx_v_variants); __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_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7variant_Variant))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_v));
      __pyx_v_v = ((struct __pyx_obj_7variant_Variant *)__pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_8 = PyInt_FromLong(__pyx_v_v->nRemoved); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __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_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_v_rlen = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":878
 * 
 *         rlen = max([v.nRemoved for v in variants]) # number of extra bases in REF
 *         REF = None             # <<<<<<<<<<<<<<
 * 
 *         if indelPresent:
 */
    __Pyx_INCREF(Py_None);
    __pyx_v_REF = ((PyObject*)Py_None);

    /* "vcfutils.pyx":880
 *         REF = None
 * 
 *         if indelPresent:             # <<<<<<<<<<<<<<
 *             REF = refFile.getSequence(chrom, POS, (POS+rlen) + 1)
 *         else:
 */
    __pyx_t_7 = (__pyx_v_indelPresent != 0);
    if (__pyx_t_7) {

      /* "vcfutils.pyx":881
 * 
 *         if indelPresent:
 *             REF = refFile.getSequence(chrom, POS, (POS+rlen) + 1)             # <<<<<<<<<<<<<<
 *         else:
 *             REF = refFile.getSequence(chrom, POS, (POS+rlen))
 */
      __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_chrom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __pyx_t_1 = PyInt_FromLong(__pyx_v_POS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = PyNumber_Add(__pyx_t_1, __pyx_v_rlen); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = __Pyx_PyInt_AsLongLong(__pyx_t_1); if (unlikely((__pyx_t_9 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_9fastafile_FastaFile *)__pyx_v_refFile->__pyx_vtab)->getSequence(__pyx_v_refFile, ((PyObject*)__pyx_t_3), __pyx_v_POS, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_v_REF));
      __pyx_v_REF = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L12;
    }
    /*else*/ {

      /* "vcfutils.pyx":883
 *             REF = refFile.getSequence(chrom, POS, (POS+rlen) + 1)
 *         else:
 *             REF = refFile.getSequence(chrom, POS, (POS+rlen))             # <<<<<<<<<<<<<<
 * 
 *         ALT = []
 */
      __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_chrom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __pyx_t_3 = PyInt_FromLong(__pyx_v_POS); 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);
      __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_v_rlen); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_9 = __Pyx_PyInt_AsLongLong(__pyx_t_8); if (unlikely((__pyx_t_9 == (PY_LONG_LONG)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_9fastafile_FastaFile *)__pyx_v_refFile->__pyx_vtab)->getSequence(__pyx_v_refFile, ((PyObject*)__pyx_t_1), __pyx_v_POS, __pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_v_REF));
      __pyx_v_REF = ((PyObject*)__pyx_t_8);
      __pyx_t_8 = 0;
    }
    __pyx_L12:;

    /* "vcfutils.pyx":885
 *             REF = refFile.getSequence(chrom, POS, (POS+rlen))
 * 
 *         ALT = []             # <<<<<<<<<<<<<<
 * 
 *         for v in variants:
 */
    __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_ALT = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "vcfutils.pyx":887
 *         ALT = []
 * 
 *         for v in variants:             # <<<<<<<<<<<<<<
 *             seq = list(REF)
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_variants) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = ((PyObject *)__pyx_v_variants); __Pyx_INCREF(__pyx_t_8); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_8)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7variant_Variant))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_v));
      __pyx_v_v = ((struct __pyx_obj_7variant_Variant *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "vcfutils.pyx":888
 * 
 *         for v in variants:
 *             seq = list(REF)             # <<<<<<<<<<<<<<
 * 
 *             if v.nRemoved == v.nAdded:
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)__pyx_v_REF));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_REF));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_REF));
      __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_XDECREF(((PyObject *)__pyx_v_seq));
      __pyx_v_seq = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "vcfutils.pyx":890
 *             seq = list(REF)
 * 
 *             if v.nRemoved == v.nAdded:             # <<<<<<<<<<<<<<
 *                 seq[0: len(v.added)] = v.added
 *             else:
 */
      __pyx_t_7 = ((__pyx_v_v->nRemoved == __pyx_v_v->nAdded) != 0);
      if (__pyx_t_7) {

        /* "vcfutils.pyx":891
 * 
 *             if v.nRemoved == v.nAdded:
 *                 seq[0: len(v.added)] = v.added             # <<<<<<<<<<<<<<
 *             else:
 *                 seq[1:1+v.nRemoved] = v.added
 */
        __pyx_t_3 = ((PyObject *)__pyx_v_v->added);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_1 = ((PyObject *)__pyx_v_v->added);
        __Pyx_INCREF(__pyx_t_1);
        if (unlikely(__pyx_t_1 == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_10 = PyBytes_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_seq), __pyx_t_3, 0, __pyx_t_10, NULL, NULL, NULL, 1, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "vcfutils.pyx":893
 *                 seq[0: len(v.added)] = v.added
 *             else:
 *                 seq[1:1+v.nRemoved] = v.added             # <<<<<<<<<<<<<<
 * 
 *             ALT.append("".join(seq))
 */
        __pyx_t_3 = ((PyObject *)__pyx_v_v->added);
        __Pyx_INCREF(__pyx_t_3);
        if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_seq), __pyx_t_3, 1, (1 + __pyx_v_v->nRemoved), NULL, NULL, NULL, 1, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_L15:;

      /* "vcfutils.pyx":895
 *                 seq[1:1+v.nRemoved] = v.added
 * 
 *             ALT.append("".join(seq))             # <<<<<<<<<<<<<<
 * 
 *         return REF,ALT
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_21), __pyx_n_s__join); 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);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)__pyx_v_seq));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_seq));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_seq));
      __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_ALT, __pyx_t_11); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "vcfutils.pyx":897
 *             ALT.append("".join(seq))
 * 
 *         return REF,ALT             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(((PyObject *)__pyx_v_REF));
    PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_REF));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_REF));
    __Pyx_INCREF(((PyObject *)__pyx_v_ALT));
    PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_ALT));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ALT));
    __pyx_r = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;
    goto __pyx_L0;
  }
  __pyx_L7:;

  __pyx_r = ((PyObject*)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_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("vcfutils.refAndAlt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_ALT);
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XDECREF(__pyx_v_REF);
  __Pyx_XDECREF(__pyx_v_rlen);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":901
 * ###################################################################################################
 * 
 * cdef int readOverlapsVariant(cAlignedRead* pRead, int varBAMMinPos, int varBAMMaxPos):             # <<<<<<<<<<<<<<
 *     """
 *     Check if a read overlaps the variant position
 */

static int __pyx_f_8vcfutils_readOverlapsVariant(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_pRead, int __pyx_v_varBAMMinPos, int __pyx_v_varBAMMaxPos) {
  int __pyx_v_readStart;
  int __pyx_v_readEnd;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("readOverlapsVariant", 0);

  /* "vcfutils.pyx":905
 *     Check if a read overlaps the variant position
 *     """
 *     cdef int readStart = pRead.pos             # <<<<<<<<<<<<<<
 *     cdef int readEnd = pRead.end
 * 
 */
  __pyx_t_1 = __pyx_v_pRead->pos;
  __pyx_v_readStart = __pyx_t_1;

  /* "vcfutils.pyx":906
 *     """
 *     cdef int readStart = pRead.pos
 *     cdef int readEnd = pRead.end             # <<<<<<<<<<<<<<
 * 
 *     if readStart <= varBAMMaxPos and readEnd > varBAMMinPos:
 */
  __pyx_t_1 = __pyx_v_pRead->end;
  __pyx_v_readEnd = __pyx_t_1;

  /* "vcfutils.pyx":908
 *     cdef int readEnd = pRead.end
 * 
 *     if readStart <= varBAMMaxPos and readEnd > varBAMMinPos:             # <<<<<<<<<<<<<<
 *         #logger.info("Read %s - %s overlaps var %s - %s" %(readStart, readEnd, varBAMMinPos, varBAMMaxPos))
 *         return True
 */
  __pyx_t_2 = ((__pyx_v_readStart <= __pyx_v_varBAMMaxPos) != 0);
  if (__pyx_t_2) {
    __pyx_t_3 = ((__pyx_v_readEnd > __pyx_v_varBAMMinPos) != 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "vcfutils.pyx":910
 *     if readStart <= varBAMMaxPos and readEnd > varBAMMinPos:
 *         #logger.info("Read %s - %s overlaps var %s - %s" %(readStart, readEnd, varBAMMinPos, varBAMMaxPos))
 *         return True             # <<<<<<<<<<<<<<
 *     else:
 *         #logger.info("Read %s -%s does not overlap var %s - %s" %(readStart, readEnd, varBAMMinPos, varBAMMaxPos))
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "vcfutils.pyx":913
 *     else:
 *         #logger.info("Read %s -%s does not overlap var %s - %s" %(readStart, readEnd, varBAMMinPos, varBAMMaxPos))
 *         return False             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
    __pyx_r = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

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

/* "vcfutils.pyx":917
 * ###################################################################################################
 * 
 * cdef int readQualIsGoodVariantPosition(cAlignedRead* pRead, int varBAMMinPos, int varBAMMaxPos, int minBaseQual):             # <<<<<<<<<<<<<<
 *     """
 *     If a read overlaps the variant position, then check the qualities at that position. If quals
 */

static int __pyx_f_8vcfutils_readQualIsGoodVariantPosition(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_pRead, int __pyx_v_varBAMMinPos, int __pyx_v_varBAMMaxPos, CYTHON_UNUSED int __pyx_v_minBaseQual) {
  CYTHON_UNUSED int __pyx_v_readStart;
  CYTHON_UNUSED int __pyx_v_readEnd;
  char *__pyx_v_qualStart;
  char *__pyx_v_qualEnd;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  short __pyx_t_3;
  int __pyx_t_4;
  long __pyx_t_5;
  long __pyx_t_6;
  __Pyx_RefNannySetupContext("readQualIsGoodVariantPosition", 0);

  /* "vcfutils.pyx":922
 *     are all < minBaseQual, then return False, otherwise True
 *     """
 *     if pRead.qual == NULL:             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  __pyx_t_1 = ((__pyx_v_pRead->qual == NULL) != 0);
  if (__pyx_t_1) {

    /* "vcfutils.pyx":923
 *     """
 *     if pRead.qual == NULL:
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cdef int readStart = pRead.pos
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "vcfutils.pyx":925
 *         return True
 * 
 *     cdef int readStart = pRead.pos             # <<<<<<<<<<<<<<
 *     cdef int readEnd = pRead.end
 * 
 */
  __pyx_t_2 = __pyx_v_pRead->pos;
  __pyx_v_readStart = __pyx_t_2;

  /* "vcfutils.pyx":926
 * 
 *     cdef int readStart = pRead.pos
 *     cdef int readEnd = pRead.end             # <<<<<<<<<<<<<<
 * 
 *     cdef char* qualStart = pRead.qual + max(0, min(pRead.rlen, varBAMMinPos - pRead.pos))
 */
  __pyx_t_2 = __pyx_v_pRead->end;
  __pyx_v_readEnd = __pyx_t_2;

  /* "vcfutils.pyx":928
 *     cdef int readEnd = pRead.end
 * 
 *     cdef char* qualStart = pRead.qual + max(0, min(pRead.rlen, varBAMMinPos - pRead.pos))             # <<<<<<<<<<<<<<
 *     cdef char* qualEnd = pRead.qual + max(0, min(pRead.rlen, varBAMMaxPos - pRead.pos))
 * 
 */
  __pyx_t_2 = (__pyx_v_varBAMMinPos - __pyx_v_pRead->pos);
  __pyx_t_3 = __pyx_v_pRead->rlen;
  if (((__pyx_t_2 < __pyx_t_3) != 0)) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_5 = 0;
  if (((__pyx_t_2 > __pyx_t_5) != 0)) {
    __pyx_t_6 = __pyx_t_2;
  } else {
    __pyx_t_6 = __pyx_t_5;
  }
  __pyx_v_qualStart = (__pyx_v_pRead->qual + __pyx_t_6);

  /* "vcfutils.pyx":929
 * 
 *     cdef char* qualStart = pRead.qual + max(0, min(pRead.rlen, varBAMMinPos - pRead.pos))
 *     cdef char* qualEnd = pRead.qual + max(0, min(pRead.rlen, varBAMMaxPos - pRead.pos))             # <<<<<<<<<<<<<<
 * 
 *     # Conservative. I want good coverage all the way across
 */
  __pyx_t_2 = (__pyx_v_varBAMMaxPos - __pyx_v_pRead->pos);
  __pyx_t_3 = __pyx_v_pRead->rlen;
  if (((__pyx_t_2 < __pyx_t_3) != 0)) {
    __pyx_t_4 = __pyx_t_2;
  } else {
    __pyx_t_4 = __pyx_t_3;
  }
  __pyx_t_2 = __pyx_t_4;
  __pyx_t_6 = 0;
  if (((__pyx_t_2 > __pyx_t_6) != 0)) {
    __pyx_t_5 = __pyx_t_2;
  } else {
    __pyx_t_5 = __pyx_t_6;
  }
  __pyx_v_qualEnd = (__pyx_v_pRead->qual + __pyx_t_5);

  /* "vcfutils.pyx":932
 * 
 *     # Conservative. I want good coverage all the way across
 *     while qualStart != qualEnd:             # <<<<<<<<<<<<<<
 * 
 *         #logger.info("Base at pos %s has qual %s. Var min = %s. Var max = %s" %(readStart + (qualStart - pRead.qual), qualStart[0], varBAMMinPos, varBAMMaxPos))
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_qualStart != __pyx_v_qualEnd) != 0);
    if (!__pyx_t_1) break;

    /* "vcfutils.pyx":938
 *         # Ok, this is a slight fudge, as I still want to catch those cases when there's a mis-match supporting
 *         # a variant with a low-ish quality. I'm just not counting coverage which is very low quality.
 *         if qualStart[0] < 5:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_1 = (((__pyx_v_qualStart[0]) < 5) != 0);
    if (__pyx_t_1) {

      /* "vcfutils.pyx":939
 *         # a variant with a low-ish quality. I'm just not counting coverage which is very low quality.
 *         if qualStart[0] < 5:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         qualStart += 1
 */
      __pyx_r = 0;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "vcfutils.pyx":941
 *             return False
 * 
 *         qualStart += 1             # <<<<<<<<<<<<<<
 * 
 *     return True
 */
    __pyx_v_qualStart = (__pyx_v_qualStart + 1);
  }

  /* "vcfutils.pyx":943
 *         qualStart += 1
 * 
 *     return True             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __pyx_r = 1;
  goto __pyx_L0;

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

/* "vcfutils.pyx":947
 * ###################################################################################################
 * 
 * cdef int overlap(int varStart, int varEnd, int seqStart, int seqEnd):             # <<<<<<<<<<<<<<
 *     """
 *     Compute and return the number of bases by which a read overlaps the haplotype of interest.
 */

static int __pyx_f_8vcfutils_overlap(int __pyx_v_varStart, int __pyx_v_varEnd, int __pyx_v_seqStart, int __pyx_v_seqEnd) {
  int __pyx_v_overlapStart;
  int __pyx_v_overlapEnd;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("overlap", 0);

  /* "vcfutils.pyx":951
 *     Compute and return the number of bases by which a read overlaps the haplotype of interest.
 *     """
 *     cdef int overlapStart = max(varStart, seqStart)             # <<<<<<<<<<<<<<
 *     cdef int overlapEnd = min(varEnd, seqEnd)
 * 
 */
  __pyx_t_1 = __pyx_v_seqStart;
  __pyx_t_2 = __pyx_v_varStart;
  if (((__pyx_t_1 > __pyx_t_2) != 0)) {
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_3 = __pyx_t_2;
  }
  __pyx_v_overlapStart = __pyx_t_3;

  /* "vcfutils.pyx":952
 *     """
 *     cdef int overlapStart = max(varStart, seqStart)
 *     cdef int overlapEnd = min(varEnd, seqEnd)             # <<<<<<<<<<<<<<
 * 
 *     if overlapEnd > overlapStart:
 */
  __pyx_t_3 = __pyx_v_seqEnd;
  __pyx_t_1 = __pyx_v_varEnd;
  if (((__pyx_t_3 < __pyx_t_1) != 0)) {
    __pyx_t_2 = __pyx_t_3;
  } else {
    __pyx_t_2 = __pyx_t_1;
  }
  __pyx_v_overlapEnd = __pyx_t_2;

  /* "vcfutils.pyx":954
 *     cdef int overlapEnd = min(varEnd, seqEnd)
 * 
 *     if overlapEnd > overlapStart:             # <<<<<<<<<<<<<<
 *         return overlapEnd - overlapStart
 *     else:
 */
  __pyx_t_4 = ((__pyx_v_overlapEnd > __pyx_v_overlapStart) != 0);
  if (__pyx_t_4) {

    /* "vcfutils.pyx":955
 * 
 *     if overlapEnd > overlapStart:
 *         return overlapEnd - overlapStart             # <<<<<<<<<<<<<<
 *     else:
 *         return -1
 */
    __pyx_r = (__pyx_v_overlapEnd - __pyx_v_overlapStart);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "vcfutils.pyx":957
 *         return overlapEnd - overlapStart
 *     else:
 *         return -1             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
    __pyx_r = -1;
    goto __pyx_L0;
  }
  __pyx_L3:;

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

/* "vcfutils.pyx":961
 * ###################################################################################################
 * 
 * cdef int variantSupportedByRead(cAlignedRead* pRead, int varBAMMinPos, int varBAMMaxPos, Variant variant, int countOnlyExactIndelMatches):             # <<<<<<<<<<<<<<
 *     """
 *     Return True if the specified variant is supported by the specified read
 */

static int __pyx_f_8vcfutils_variantSupportedByRead(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_pRead, CYTHON_UNUSED int __pyx_v_varBAMMinPos, CYTHON_UNUSED int __pyx_v_varBAMMaxPos, struct __pyx_obj_7variant_Variant *__pyx_v_variant, int __pyx_v_countOnlyExactIndelMatches) {
  int __pyx_v_refOffset;
  int __pyx_v_readOffset;
  int __pyx_v_readStart;
  CYTHON_UNUSED int __pyx_v_match;
  int __pyx_v_cigarIndex;
  int __pyx_v_cigarLength;
  int __pyx_v_flag;
  int __pyx_v_length;
  int __pyx_v_startPosOfVarInRead;
  int __pyx_v_varPos;
  int __pyx_v_lenVarAdded;
  int __pyx_v_lenVarRemoved;
  char *__pyx_v_varAdded;
  CYTHON_UNUSED char *__pyx_v_varRemoved;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  short __pyx_t_2;
  char *__pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  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_RefNannySetupContext("variantSupportedByRead", 0);

  /* "vcfutils.pyx":965
 *     Return True if the specified variant is supported by the specified read
 *     """
 *     cdef int refOffset = 0             # <<<<<<<<<<<<<<
 *     cdef int readOffset = 0
 *     cdef int readStart = pRead.pos
 */
  __pyx_v_refOffset = 0;

  /* "vcfutils.pyx":966
 *     """
 *     cdef int refOffset = 0
 *     cdef int readOffset = 0             # <<<<<<<<<<<<<<
 *     cdef int readStart = pRead.pos
 *     cdef int match = 0
 */
  __pyx_v_readOffset = 0;

  /* "vcfutils.pyx":967
 *     cdef int refOffset = 0
 *     cdef int readOffset = 0
 *     cdef int readStart = pRead.pos             # <<<<<<<<<<<<<<
 *     cdef int match = 0
 *     cdef int cigarIndex = 0
 */
  __pyx_t_1 = __pyx_v_pRead->pos;
  __pyx_v_readStart = __pyx_t_1;

  /* "vcfutils.pyx":968
 *     cdef int readOffset = 0
 *     cdef int readStart = pRead.pos
 *     cdef int match = 0             # <<<<<<<<<<<<<<
 *     cdef int cigarIndex = 0
 *     cdef int cigarLength = pRead.cigarLen
 */
  __pyx_v_match = 0;

  /* "vcfutils.pyx":969
 *     cdef int readStart = pRead.pos
 *     cdef int match = 0
 *     cdef int cigarIndex = 0             # <<<<<<<<<<<<<<
 *     cdef int cigarLength = pRead.cigarLen
 *     cdef int flag = 0
 */
  __pyx_v_cigarIndex = 0;

  /* "vcfutils.pyx":970
 *     cdef int match = 0
 *     cdef int cigarIndex = 0
 *     cdef int cigarLength = pRead.cigarLen             # <<<<<<<<<<<<<<
 *     cdef int flag = 0
 *     cdef int length = 0
 */
  __pyx_t_2 = __pyx_v_pRead->cigarLen;
  __pyx_v_cigarLength = __pyx_t_2;

  /* "vcfutils.pyx":971
 *     cdef int cigarIndex = 0
 *     cdef int cigarLength = pRead.cigarLen
 *     cdef int flag = 0             # <<<<<<<<<<<<<<
 *     cdef int length = 0
 *     cdef int startPosOfVarInRead = 0
 */
  __pyx_v_flag = 0;

  /* "vcfutils.pyx":972
 *     cdef int cigarLength = pRead.cigarLen
 *     cdef int flag = 0
 *     cdef int length = 0             # <<<<<<<<<<<<<<
 *     cdef int startPosOfVarInRead = 0
 *     cdef int varPos = variant.refPos
 */
  __pyx_v_length = 0;

  /* "vcfutils.pyx":973
 *     cdef int flag = 0
 *     cdef int length = 0
 *     cdef int startPosOfVarInRead = 0             # <<<<<<<<<<<<<<
 *     cdef int varPos = variant.refPos
 *     cdef int lenVarAdded = variant.nAdded
 */
  __pyx_v_startPosOfVarInRead = 0;

  /* "vcfutils.pyx":974
 *     cdef int length = 0
 *     cdef int startPosOfVarInRead = 0
 *     cdef int varPos = variant.refPos             # <<<<<<<<<<<<<<
 *     cdef int lenVarAdded = variant.nAdded
 *     cdef int lenVarRemoved = variant.nRemoved
 */
  __pyx_t_1 = __pyx_v_variant->refPos;
  __pyx_v_varPos = __pyx_t_1;

  /* "vcfutils.pyx":975
 *     cdef int startPosOfVarInRead = 0
 *     cdef int varPos = variant.refPos
 *     cdef int lenVarAdded = variant.nAdded             # <<<<<<<<<<<<<<
 *     cdef int lenVarRemoved = variant.nRemoved
 *     cdef char* varAdded = variant.added
 */
  __pyx_t_1 = __pyx_v_variant->nAdded;
  __pyx_v_lenVarAdded = __pyx_t_1;

  /* "vcfutils.pyx":976
 *     cdef int varPos = variant.refPos
 *     cdef int lenVarAdded = variant.nAdded
 *     cdef int lenVarRemoved = variant.nRemoved             # <<<<<<<<<<<<<<
 *     cdef char* varAdded = variant.added
 *     cdef char* varRemoved = variant.removed
 */
  __pyx_t_1 = __pyx_v_variant->nRemoved;
  __pyx_v_lenVarRemoved = __pyx_t_1;

  /* "vcfutils.pyx":977
 *     cdef int lenVarAdded = variant.nAdded
 *     cdef int lenVarRemoved = variant.nRemoved
 *     cdef char* varAdded = variant.added             # <<<<<<<<<<<<<<
 *     cdef char* varRemoved = variant.removed
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_variant->added)); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_varAdded = __pyx_t_3;

  /* "vcfutils.pyx":978
 *     cdef int lenVarRemoved = variant.nRemoved
 *     cdef char* varAdded = variant.added
 *     cdef char* varRemoved = variant.removed             # <<<<<<<<<<<<<<
 * 
 *     for cigarIndex from 0 <= cigarIndex < cigarLength:
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_variant->removed)); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_varRemoved = __pyx_t_3;

  /* "vcfutils.pyx":980
 *     cdef char* varRemoved = variant.removed
 * 
 *     for cigarIndex from 0 <= cigarIndex < cigarLength:             # <<<<<<<<<<<<<<
 * 
 *         flag = pRead.cigarOps[2*cigarIndex]
 */
  __pyx_t_1 = __pyx_v_cigarLength;
  for (__pyx_v_cigarIndex = 0; __pyx_v_cigarIndex < __pyx_t_1; __pyx_v_cigarIndex++) {

    /* "vcfutils.pyx":982
 *     for cigarIndex from 0 <= cigarIndex < cigarLength:
 * 
 *         flag = pRead.cigarOps[2*cigarIndex]             # <<<<<<<<<<<<<<
 *         length = pRead.cigarOps[2*cigarIndex+1]
 * 
 */
    __pyx_v_flag = (__pyx_v_pRead->cigarOps[(2 * __pyx_v_cigarIndex)]);

    /* "vcfutils.pyx":983
 * 
 *         flag = pRead.cigarOps[2*cigarIndex]
 *         length = pRead.cigarOps[2*cigarIndex+1]             # <<<<<<<<<<<<<<
 * 
 *         # An insertion take us further along the read, but not the reference
 */
    __pyx_v_length = (__pyx_v_pRead->cigarOps[((2 * __pyx_v_cigarIndex) + 1)]);

    /* "vcfutils.pyx":986
 * 
 *         # An insertion take us further along the read, but not the reference
 *         if flag == CIGAR_I:             # <<<<<<<<<<<<<<
 *             startPosOfVarInRead = readOffset
 * 
 */
    __pyx_t_4 = ((__pyx_v_flag == __pyx_v_8vcfutils_CIGAR_I) != 0);
    if (__pyx_t_4) {

      /* "vcfutils.pyx":987
 *         # An insertion take us further along the read, but not the reference
 *         if flag == CIGAR_I:
 *             startPosOfVarInRead = readOffset             # <<<<<<<<<<<<<<
 * 
 *             # Read overlaps variant site and has an insertion.
 */
      __pyx_v_startPosOfVarInRead = __pyx_v_readOffset;

      /* "vcfutils.pyx":990
 * 
 *             # Read overlaps variant site and has an insertion.
 *             if lenVarAdded != lenVarRemoved:             # <<<<<<<<<<<<<<
 * 
 *                 # Are we looking for exact matches?
 */
      __pyx_t_4 = ((__pyx_v_lenVarAdded != __pyx_v_lenVarRemoved) != 0);
      if (__pyx_t_4) {

        /* "vcfutils.pyx":993
 * 
 *                 # Are we looking for exact matches?
 *                 if countOnlyExactIndelMatches:             # <<<<<<<<<<<<<<
 *                     # Want exact length match
 *                     if variant.nAdded - variant.nRemoved == length:
 */
        __pyx_t_4 = (__pyx_v_countOnlyExactIndelMatches != 0);
        if (__pyx_t_4) {

          /* "vcfutils.pyx":995
 *                 if countOnlyExactIndelMatches:
 *                     # Want exact length match
 *                     if variant.nAdded - variant.nRemoved == length:             # <<<<<<<<<<<<<<
 *                         # And exact sequence match
 *                         if pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded] == varAdded:
 */
          __pyx_t_4 = (((__pyx_v_variant->nAdded - __pyx_v_variant->nRemoved) == __pyx_v_length) != 0);
          if (__pyx_t_4) {

            /* "vcfutils.pyx":997
 *                     if variant.nAdded - variant.nRemoved == length:
 *                         # And exact sequence match
 *                         if pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded] == varAdded:             # <<<<<<<<<<<<<<
 *                             return True
 *                     # Otherwise match is not valid
 */
            __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_pRead->seq + __pyx_v_startPosOfVarInRead, (__pyx_v_startPosOfVarInRead + __pyx_v_lenVarAdded) - __pyx_v_startPosOfVarInRead); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_5));
            __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_varAdded); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(((PyObject *)__pyx_t_6));
            __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
            __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (__pyx_t_4) {

              /* "vcfutils.pyx":998
 *                         # And exact sequence match
 *                         if pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded] == varAdded:
 *                             return True             # <<<<<<<<<<<<<<
 *                     # Otherwise match is not valid
 *                     return False
 */
              __pyx_r = 1;
              goto __pyx_L0;
              goto __pyx_L9;
            }
            __pyx_L9:;
            goto __pyx_L8;
          }
          __pyx_L8:;

          /* "vcfutils.pyx":1000
 *                             return True
 *                     # Otherwise match is not valid
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *                 # If not looking for exact matches then any insertion counts
 */
          __pyx_r = 0;
          goto __pyx_L0;
          goto __pyx_L7;
        }
        /*else*/ {

          /* "vcfutils.pyx":1004
 *                 # If not looking for exact matches then any insertion counts
 *                 else:
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *             readOffset += length
 */
          __pyx_r = 1;
          goto __pyx_L0;
        }
        __pyx_L7:;
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "vcfutils.pyx":1006
 *                     return True
 * 
 *             readOffset += length             # <<<<<<<<<<<<<<
 * 
 *         elif flag == CIGAR_D:
 */
      __pyx_v_readOffset = (__pyx_v_readOffset + __pyx_v_length);
      goto __pyx_L5;
    }

    /* "vcfutils.pyx":1008
 *             readOffset += length
 * 
 *         elif flag == CIGAR_D:             # <<<<<<<<<<<<<<
 *             startPosOfVarInRead = readOffset
 * 
 */
    __pyx_t_4 = ((__pyx_v_flag == __pyx_v_8vcfutils_CIGAR_D) != 0);
    if (__pyx_t_4) {

      /* "vcfutils.pyx":1009
 * 
 *         elif flag == CIGAR_D:
 *             startPosOfVarInRead = readOffset             # <<<<<<<<<<<<<<
 * 
 *             # Counting support if the read overlaps variant site and has an indel.
 */
      __pyx_v_startPosOfVarInRead = __pyx_v_readOffset;

      /* "vcfutils.pyx":1012
 * 
 *             # Counting support if the read overlaps variant site and has an indel.
 *             if variant.nAdded != variant.nRemoved:             # <<<<<<<<<<<<<<
 * 
 *                 # Are we looking for exact matches?
 */
      __pyx_t_4 = ((__pyx_v_variant->nAdded != __pyx_v_variant->nRemoved) != 0);
      if (__pyx_t_4) {

        /* "vcfutils.pyx":1015
 * 
 *                 # Are we looking for exact matches?
 *                 if countOnlyExactIndelMatches:             # <<<<<<<<<<<<<<
 * 
 *                     # Want exact length match
 */
        __pyx_t_4 = (__pyx_v_countOnlyExactIndelMatches != 0);
        if (__pyx_t_4) {

          /* "vcfutils.pyx":1018
 * 
 *                     # Want exact length match
 *                     if variant.nRemoved - variant.nAdded == length:             # <<<<<<<<<<<<<<
 *                         return True
 *                     # Otherwise match is not valid
 */
          __pyx_t_4 = (((__pyx_v_variant->nRemoved - __pyx_v_variant->nAdded) == __pyx_v_length) != 0);
          if (__pyx_t_4) {

            /* "vcfutils.pyx":1019
 *                     # Want exact length match
 *                     if variant.nRemoved - variant.nAdded == length:
 *                         return True             # <<<<<<<<<<<<<<
 *                     # Otherwise match is not valid
 *                     else:
 */
            __pyx_r = 1;
            goto __pyx_L0;
            goto __pyx_L12;
          }
          /*else*/ {

            /* "vcfutils.pyx":1022
 *                     # Otherwise match is not valid
 *                     else:
 *                         return False             # <<<<<<<<<<<<<<
 * 
 *                 # If not looking for exact matches then any deletion counts
 */
            __pyx_r = 0;
            goto __pyx_L0;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }
        /*else*/ {

          /* "vcfutils.pyx":1026
 *                 # If not looking for exact matches then any deletion counts
 *                 else:
 *                     return True             # <<<<<<<<<<<<<<
 * 
 *             refOffset += length
 */
          __pyx_r = 1;
          goto __pyx_L0;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "vcfutils.pyx":1028
 *                     return True
 * 
 *             refOffset += length             # <<<<<<<<<<<<<<
 * 
 *         # A match take us further along the reference and the read
 */
      __pyx_v_refOffset = (__pyx_v_refOffset + __pyx_v_length);
      goto __pyx_L5;
    }

    /* "vcfutils.pyx":1031
 * 
 *         # A match take us further along the reference and the read
 *         elif flag == CIGAR_M or flag == CIGAR_EQ or flag == CIGAR_X:             # <<<<<<<<<<<<<<
 * 
 *             # Check if read base matches variant
 */
    __pyx_t_4 = ((__pyx_v_flag == __pyx_v_8vcfutils_CIGAR_M) != 0);
    if (!__pyx_t_4) {
      __pyx_t_8 = ((__pyx_v_flag == __pyx_v_8vcfutils_CIGAR_EQ) != 0);
      if (!__pyx_t_8) {
        __pyx_t_9 = ((__pyx_v_flag == __pyx_v_8vcfutils_CIGAR_X) != 0);
        __pyx_t_10 = __pyx_t_9;
      } else {
        __pyx_t_10 = __pyx_t_8;
      }
      __pyx_t_8 = __pyx_t_10;
    } else {
      __pyx_t_8 = __pyx_t_4;
    }
    if (__pyx_t_8) {

      /* "vcfutils.pyx":1037
 *             # If there are no insertions/deletions, then the variant position in the read is just the reference
 *             # position - the start position of the read.
 *             startPosOfVarInRead = varPos - readStart             # <<<<<<<<<<<<<<
 * 
 *             # An insertion before the variant means that it will occur later in the read by insertionSize
 */
      __pyx_v_startPosOfVarInRead = (__pyx_v_varPos - __pyx_v_readStart);

      /* "vcfutils.pyx":1040
 * 
 *             # An insertion before the variant means that it will occur later in the read by insertionSize
 *             startPosOfVarInRead += readOffset             # <<<<<<<<<<<<<<
 * 
 *             # A deletion before the variant means that it will occur earlier in the read by deletion Size
 */
      __pyx_v_startPosOfVarInRead = (__pyx_v_startPosOfVarInRead + __pyx_v_readOffset);

      /* "vcfutils.pyx":1043
 * 
 *             # A deletion before the variant means that it will occur earlier in the read by deletion Size
 *             startPosOfVarInRead -= refOffset             # <<<<<<<<<<<<<<
 *             #logger.info("Read start = %s. var pos = %s. read seq = %s. var added = %s" %(readStart, varPos, pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded], varAdded))
 * 
 */
      __pyx_v_startPosOfVarInRead = (__pyx_v_startPosOfVarInRead - __pyx_v_refOffset);

      /* "vcfutils.pyx":1046
 *             #logger.info("Read start = %s. var pos = %s. read seq = %s. var added = %s" %(readStart, varPos, pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded], varAdded))
 * 
 *             if refOffset + readStart <= varPos and refOffset + readStart + length > varPos and lenVarAdded == lenVarRemoved:             # <<<<<<<<<<<<<<
 *                 if startPosOfVarInRead + lenVarAdded <= pRead.rlen:
 *                     if pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded] == varAdded:
 */
      __pyx_t_8 = (((__pyx_v_refOffset + __pyx_v_readStart) <= __pyx_v_varPos) != 0);
      if (__pyx_t_8) {
        __pyx_t_4 = ((((__pyx_v_refOffset + __pyx_v_readStart) + __pyx_v_length) > __pyx_v_varPos) != 0);
        if (__pyx_t_4) {
          __pyx_t_10 = ((__pyx_v_lenVarAdded == __pyx_v_lenVarRemoved) != 0);
          __pyx_t_9 = __pyx_t_10;
        } else {
          __pyx_t_9 = __pyx_t_4;
        }
        __pyx_t_4 = __pyx_t_9;
      } else {
        __pyx_t_4 = __pyx_t_8;
      }
      if (__pyx_t_4) {

        /* "vcfutils.pyx":1047
 * 
 *             if refOffset + readStart <= varPos and refOffset + readStart + length > varPos and lenVarAdded == lenVarRemoved:
 *                 if startPosOfVarInRead + lenVarAdded <= pRead.rlen:             # <<<<<<<<<<<<<<
 *                     if pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded] == varAdded:
 *                         return True
 */
        __pyx_t_4 = (((__pyx_v_startPosOfVarInRead + __pyx_v_lenVarAdded) <= __pyx_v_pRead->rlen) != 0);
        if (__pyx_t_4) {

          /* "vcfutils.pyx":1048
 *             if refOffset + readStart <= varPos and refOffset + readStart + length > varPos and lenVarAdded == lenVarRemoved:
 *                 if startPosOfVarInRead + lenVarAdded <= pRead.rlen:
 *                     if pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded] == varAdded:             # <<<<<<<<<<<<<<
 *                         return True
 * 
 */
          __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_pRead->seq + __pyx_v_startPosOfVarInRead, (__pyx_v_startPosOfVarInRead + __pyx_v_lenVarAdded) - __pyx_v_startPosOfVarInRead); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_7));
          __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_varAdded); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_6));
          __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_6), Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
          __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (__pyx_t_4) {

            /* "vcfutils.pyx":1049
 *                 if startPosOfVarInRead + lenVarAdded <= pRead.rlen:
 *                     if pRead.seq[startPosOfVarInRead:startPosOfVarInRead+lenVarAdded] == varAdded:
 *                         return True             # <<<<<<<<<<<<<<
 * 
 *             readOffset += length
 */
            __pyx_r = 1;
            goto __pyx_L0;
            goto __pyx_L15;
          }
          __pyx_L15:;
          goto __pyx_L14;
        }
        __pyx_L14:;
        goto __pyx_L13;
      }
      __pyx_L13:;

      /* "vcfutils.pyx":1051
 *                         return True
 * 
 *             readOffset += length             # <<<<<<<<<<<<<<
 *             refOffset += length
 * 
 */
      __pyx_v_readOffset = (__pyx_v_readOffset + __pyx_v_length);

      /* "vcfutils.pyx":1052
 * 
 *             readOffset += length
 *             refOffset += length             # <<<<<<<<<<<<<<
 * 
 *         # Skipped region from the reference.
 */
      __pyx_v_refOffset = (__pyx_v_refOffset + __pyx_v_length);
      goto __pyx_L5;
    }

    /* "vcfutils.pyx":1055
 * 
 *         # Skipped region from the reference.
 *         elif flag == CIGAR_N:             # <<<<<<<<<<<<<<
 *             readOffset += length
 *             refOffset += length
 */
    __pyx_t_4 = ((__pyx_v_flag == __pyx_v_8vcfutils_CIGAR_N) != 0);
    if (__pyx_t_4) {

      /* "vcfutils.pyx":1056
 *         # Skipped region from the reference.
 *         elif flag == CIGAR_N:
 *             readOffset += length             # <<<<<<<<<<<<<<
 *             refOffset += length
 * 
 */
      __pyx_v_readOffset = (__pyx_v_readOffset + __pyx_v_length);

      /* "vcfutils.pyx":1057
 *         elif flag == CIGAR_N:
 *             readOffset += length
 *             refOffset += length             # <<<<<<<<<<<<<<
 * 
 *         # Soft clipping. Sequence is present in read, but we should ignore it.
 */
      __pyx_v_refOffset = (__pyx_v_refOffset + __pyx_v_length);
      goto __pyx_L5;
    }

    /* "vcfutils.pyx":1060
 * 
 *         # Soft clipping. Sequence is present in read, but we should ignore it.
 *         elif flag == CIGAR_S:             # <<<<<<<<<<<<<<
 *             readOffset += length
 * 
 */
    __pyx_t_4 = ((__pyx_v_flag == __pyx_v_8vcfutils_CIGAR_S) != 0);
    if (__pyx_t_4) {

      /* "vcfutils.pyx":1061
 *         # Soft clipping. Sequence is present in read, but we should ignore it.
 *         elif flag == CIGAR_S:
 *             readOffset += length             # <<<<<<<<<<<<<<
 * 
 *             # We moved back read starts when there is soft clipping at the beginning of the read
 */
      __pyx_v_readOffset = (__pyx_v_readOffset + __pyx_v_length);

      /* "vcfutils.pyx":1064
 * 
 *             # We moved back read starts when there is soft clipping at the beginning of the read
 *             if cigarIndex == 0:             # <<<<<<<<<<<<<<
 *                 refOffset += length
 * 
 */
      __pyx_t_4 = ((__pyx_v_cigarIndex == 0) != 0);
      if (__pyx_t_4) {

        /* "vcfutils.pyx":1065
 *             # We moved back read starts when there is soft clipping at the beginning of the read
 *             if cigarIndex == 0:
 *                 refOffset += length             # <<<<<<<<<<<<<<
 * 
 *         # Other kinds of flag. including H (hard clipping) and P (padding)
 */
        __pyx_v_refOffset = (__pyx_v_refOffset + __pyx_v_length);
        goto __pyx_L16;
      }
      __pyx_L16:;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "vcfutils.pyx":1069
 *         # Other kinds of flag. including H (hard clipping) and P (padding)
 *         else:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *     # No match found
 */
      goto __pyx_L3_continue;
    }
    __pyx_L5:;
    __pyx_L3_continue:;
  }

  /* "vcfutils.pyx":1072
 * 
 *     # No match found
 *     return False             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __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_WriteUnraisable("vcfutils.variantSupportedByRead", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":1076
 * ###################################################################################################
 * 
 * cdef int computeHaplotypeScore(list genotypes):             # <<<<<<<<<<<<<<
 *     """
 *     Calculate Haplotype Score: The number of haplotypes that a variant segregate into within the window.
 */

static int __pyx_f_8vcfutils_computeHaplotypeScore(PyObject *__pyx_v_genotypes) {
  struct __pyx_obj_9cgenotype_DiploidGenotype *__pyx_v_genotype = 0;
  struct __pyx_obj_10chaplotype_Haplotype *__pyx_v_hap1 = 0;
  struct __pyx_obj_10chaplotype_Haplotype *__pyx_v_hap2 = 0;
  PyObject *__pyx_v_hapScores = NULL;
  PyObject *__pyx_v_HapScores = NULL;
  PyObject *__pyx_v_hapScoreClusters = NULL;
  PyObject *__pyx_v_dist = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_HapScore = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __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("computeHaplotypeScore", 0);

  /* "vcfutils.pyx":1085
 *     cdef DiploidGenotype genotype
 *     cdef Haplotype hap1,hap2
 *     hapScores = {}             # <<<<<<<<<<<<<<
 * 
 *     for genotype in genotypes:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_hapScores = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1087
 *     hapScores = {}
 * 
 *     for genotype in genotypes:             # <<<<<<<<<<<<<<
 *         hap1 = genotype.hap1
 *         hap2 = genotype.hap2
 */
  if (unlikely(((PyObject *)__pyx_v_genotypes) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = ((PyObject *)__pyx_v_genotypes); __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 = 1087; __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 = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9cgenotype_DiploidGenotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_genotype));
    __pyx_v_genotype = ((struct __pyx_obj_9cgenotype_DiploidGenotype *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":1088
 * 
 *     for genotype in genotypes:
 *         hap1 = genotype.hap1             # <<<<<<<<<<<<<<
 *         hap2 = genotype.hap2
 *         hapScores[hap1] = - genotype.hap1Like
 */
    __pyx_t_3 = ((PyObject *)__pyx_v_genotype->hap1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF(((PyObject *)__pyx_v_hap1));
    __pyx_v_hap1 = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":1089
 *     for genotype in genotypes:
 *         hap1 = genotype.hap1
 *         hap2 = genotype.hap2             # <<<<<<<<<<<<<<
 *         hapScores[hap1] = - genotype.hap1Like
 *         hapScores[hap2] = - genotype.hap2Like
 */
    __pyx_t_3 = ((PyObject *)__pyx_v_genotype->hap2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF(((PyObject *)__pyx_v_hap2));
    __pyx_v_hap2 = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":1090
 *         hap1 = genotype.hap1
 *         hap2 = genotype.hap2
 *         hapScores[hap1] = - genotype.hap1Like             # <<<<<<<<<<<<<<
 *         hapScores[hap2] = - genotype.hap2Like
 * 
 */
    __pyx_t_3 = PyFloat_FromDouble((-__pyx_v_genotype->hap1Like)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(((PyObject *)__pyx_v_hapScores), ((PyObject *)__pyx_v_hap1), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "vcfutils.pyx":1091
 *         hap2 = genotype.hap2
 *         hapScores[hap1] = - genotype.hap1Like
 *         hapScores[hap2] = - genotype.hap2Like             # <<<<<<<<<<<<<<
 * 
 *     HapScores = sorted(hapScores.values())
 */
    __pyx_t_3 = PyFloat_FromDouble((-__pyx_v_genotype->hap2Like)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(((PyObject *)__pyx_v_hapScores), ((PyObject *)__pyx_v_hap2), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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;

  /* "vcfutils.pyx":1093
 *         hapScores[hap2] = - genotype.hap2Like
 * 
 *     HapScores = sorted(hapScores.values())             # <<<<<<<<<<<<<<
 *     hapScoreClusters = [[HapScores[0]]]
 *     dist = 0
 */
  __pyx_t_1 = __Pyx_PyDict_Values(__pyx_v_hapScores); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __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 = 1093; __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 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_v_HapScores = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1094
 * 
 *     HapScores = sorted(hapScores.values())
 *     hapScoreClusters = [[HapScores[0]]]             # <<<<<<<<<<<<<<
 *     dist = 0
 * 
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_HapScores, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_3, 0, __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 = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __pyx_t_3 = 0;
  __pyx_v_hapScoreClusters = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1095
 *     HapScores = sorted(hapScores.values())
 *     hapScoreClusters = [[HapScores[0]]]
 *     dist = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(1, len(HapScores)):
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_dist = __pyx_int_0;

  /* "vcfutils.pyx":1097
 *     dist = 0
 * 
 *     for i in range(1, len(HapScores)):             # <<<<<<<<<<<<<<
 * 
 *         if HapScores[i] -  HapScores[i-1] >20:
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_HapScores); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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 = 1097; __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);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__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_2 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "vcfutils.pyx":1099
 *     for i in range(1, len(HapScores)):
 * 
 *         if HapScores[i] -  HapScores[i-1] >20:             # <<<<<<<<<<<<<<
 *            if len(hapScoreClusters) ==1:
 *               dist = HapScores[i] - HapScores[i-1]
 */
    __pyx_t_1 = PyObject_GetItem(__pyx_v_HapScores, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_GetItem(__pyx_v_HapScores, __pyx_t_5); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __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_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __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_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_int_20, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __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 = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {

      /* "vcfutils.pyx":1100
 * 
 *         if HapScores[i] -  HapScores[i-1] >20:
 *            if len(hapScoreClusters) ==1:             # <<<<<<<<<<<<<<
 *               dist = HapScores[i] - HapScores[i-1]
 *            if len(hapScoreClusters)==2 :
 */
      __pyx_t_8 = PyList_GET_SIZE(((PyObject *)__pyx_v_hapScoreClusters)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((__pyx_t_8 == 1) != 0);
      if (__pyx_t_7) {

        /* "vcfutils.pyx":1101
 *         if HapScores[i] -  HapScores[i-1] >20:
 *            if len(hapScoreClusters) ==1:
 *               dist = HapScores[i] - HapScores[i-1]             # <<<<<<<<<<<<<<
 *            if len(hapScoreClusters)==2 :
 *               break
 */
        __pyx_t_6 = PyObject_GetItem(__pyx_v_HapScores, __pyx_v_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_5 = PyNumber_Subtract(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_1 = PyObject_GetItem(__pyx_v_HapScores, __pyx_t_5); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __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_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_v_dist);
        __pyx_v_dist = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "vcfutils.pyx":1102
 *            if len(hapScoreClusters) ==1:
 *               dist = HapScores[i] - HapScores[i-1]
 *            if len(hapScoreClusters)==2 :             # <<<<<<<<<<<<<<
 *               break
 *            hapScoreClusters.append([HapScores[i]])
 */
      __pyx_t_8 = PyList_GET_SIZE(((PyObject *)__pyx_v_hapScoreClusters)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = ((__pyx_t_8 == 2) != 0);
      if (__pyx_t_7) {

        /* "vcfutils.pyx":1103
 *               dist = HapScores[i] - HapScores[i-1]
 *            if len(hapScoreClusters)==2 :
 *               break             # <<<<<<<<<<<<<<
 *            hapScoreClusters.append([HapScores[i]])
 * 
 */
        goto __pyx_L6_break;
        goto __pyx_L9;
      }
      __pyx_L9:;

      /* "vcfutils.pyx":1104
 *            if len(hapScoreClusters)==2 :
 *               break
 *            hapScoreClusters.append([HapScores[i]])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_5 = PyObject_GetItem(__pyx_v_HapScores, __pyx_v_i); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_hapScoreClusters, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "vcfutils.pyx":1107
 * 
 *         else:
 *            hapScoreClusters[-1].append(HapScores[i])             # <<<<<<<<<<<<<<
 * 
 *     HapScore = len(hapScoreClusters[0])
 */
      __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_hapScoreClusters), -1, sizeof(long), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_GetItem(__pyx_v_HapScores, __pyx_v_i); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_L7:;
  }
  __pyx_L6_break:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vcfutils.pyx":1109
 *            hapScoreClusters[-1].append(HapScores[i])
 * 
 *     HapScore = len(hapScoreClusters[0])             # <<<<<<<<<<<<<<
 * 
 *     if dist < 50 and dist >0:
 */
  __pyx_t_3 = PyList_GET_ITEM(__pyx_v_hapScoreClusters, 0);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_HapScore = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "vcfutils.pyx":1111
 *     HapScore = len(hapScoreClusters[0])
 * 
 *     if dist < 50 and dist >0:             # <<<<<<<<<<<<<<
 *        HapScore += len(hapScoreClusters[1])
 * 
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_50, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_11 = __pyx_t_10;
  } else {
    __pyx_t_11 = __pyx_t_7;
  }
  if (__pyx_t_11) {

    /* "vcfutils.pyx":1112
 * 
 *     if dist < 50 and dist >0:
 *        HapScore += len(hapScoreClusters[1])             # <<<<<<<<<<<<<<
 * 
 *     return HapScore
 */
    __pyx_t_3 = PyList_GET_ITEM(__pyx_v_hapScoreClusters, 1);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_HapScore, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_HapScore);
    __pyx_v_HapScore = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "vcfutils.pyx":1114
 *        HapScore += len(hapScoreClusters[1])
 * 
 *     return HapScore             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __pyx_t_12 = __Pyx_PyInt_AsInt(__pyx_v_HapScore); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_12;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("vcfutils.computeHaplotypeScore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_genotype);
  __Pyx_XDECREF((PyObject *)__pyx_v_hap1);
  __Pyx_XDECREF((PyObject *)__pyx_v_hap2);
  __Pyx_XDECREF(__pyx_v_hapScores);
  __Pyx_XDECREF(__pyx_v_HapScores);
  __Pyx_XDECREF(__pyx_v_hapScoreClusters);
  __Pyx_XDECREF(__pyx_v_dist);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_HapScore);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":1118
 * ###################################################################################################
 * 
 * cdef dict getHaplotypeInfo(list haplotypes, dict variantPosteriors, double* haplotypeFrequencies, int nHaplotypes):             # <<<<<<<<<<<<<<
 *     """
 *     Some info is computed at the haplotype level. Sort this
 */

static PyObject *__pyx_f_8vcfutils_getHaplotypeInfo(PyObject *__pyx_v_haplotypes, PyObject *__pyx_v_variantPosteriors, double *__pyx_v_haplotypeFrequencies, int __pyx_v_nHaplotypes) {
  struct __pyx_obj_10chaplotype_Haplotype *__pyx_v_haplotype = 0;
  struct __pyx_obj_7variant_Variant *__pyx_v_var = 0;
  int __pyx_v_hapIndex;
  PyObject *__pyx_v_INFO = 0;
  PyObject *__pyx_v_PP = 0;
  double __pyx_v_FR;
  double __pyx_v_posteriorProbThisVar;
  PyObject *__pyx_v_hapINFO = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  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;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  double __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getHaplotypeInfo", 0);

  /* "vcfutils.pyx":1125
 *     cdef Haplotype haplotype
 *     cdef Variant var
 *     cdef int hapIndex = 0             # <<<<<<<<<<<<<<
 *     cdef dict hapInfo
 *     cdef dict INFO = {}
 */
  __pyx_v_hapIndex = 0;

  /* "vcfutils.pyx":1127
 *     cdef int hapIndex = 0
 *     cdef dict hapInfo
 *     cdef dict INFO = {}             # <<<<<<<<<<<<<<
 *     cdef str PP
 *     cdef double FR = 0.0
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_INFO = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1129
 *     cdef dict INFO = {}
 *     cdef str PP
 *     cdef double FR = 0.0             # <<<<<<<<<<<<<<
 *     cdef double posteriorProbThisVar
 * 
 */
  __pyx_v_FR = 0.0;

  /* "vcfutils.pyx":1133
 * 
 *     # Start INFO calculations
 *     for hapIndex from 0 <= hapIndex < nHaplotypes:             # <<<<<<<<<<<<<<
 * 
 *         haplotype = haplotypes[hapIndex]
 */
  __pyx_t_2 = __pyx_v_nHaplotypes;
  for (__pyx_v_hapIndex = 0; __pyx_v_hapIndex < __pyx_t_2; __pyx_v_hapIndex++) {

    /* "vcfutils.pyx":1135
 *     for hapIndex from 0 <= hapIndex < nHaplotypes:
 * 
 *         haplotype = haplotypes[hapIndex]             # <<<<<<<<<<<<<<
 *         hapINFO = haplotype.vcfINFO()
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_haplotypes) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_haplotypes), __pyx_v_hapIndex, sizeof(int), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __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_10chaplotype_Haplotype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_haplotype));
    __pyx_v_haplotype = ((struct __pyx_obj_10chaplotype_Haplotype *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "vcfutils.pyx":1136
 * 
 *         haplotype = haplotypes[hapIndex]
 *         hapINFO = haplotype.vcfINFO()             # <<<<<<<<<<<<<<
 * 
 *         for var,value in hapINFO.iteritems():
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10chaplotype_Haplotype *)__pyx_v_haplotype->__pyx_vtab)->vcfINFO(__pyx_v_haplotype)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(((PyObject *)__pyx_v_hapINFO));
    __pyx_v_hapINFO = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "vcfutils.pyx":1138
 *         hapINFO = haplotype.vcfINFO()
 * 
 *         for var,value in hapINFO.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             # Skip low-posterior variants
 */
    __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_hapINFO) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_6 = __Pyx_dict_iterator(((PyObject *)__pyx_v_hapINFO), 1, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_6;
    __pyx_t_6 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, &__pyx_t_7, NULL, __pyx_t_5);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7variant_Variant))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_var));
      __pyx_v_var = ((struct __pyx_obj_7variant_Variant *)__pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "vcfutils.pyx":1141
 * 
 *             # Skip low-posterior variants
 *             if var not in variantPosteriors:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_variantPosteriors) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_9 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_v_var), ((PyObject *)__pyx_v_variantPosteriors), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_10 = (__pyx_t_9 != 0);
      if (__pyx_t_10) {

        /* "vcfutils.pyx":1142
 *             # Skip low-posterior variants
 *             if var not in variantPosteriors:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if var not in INFO:
 */
        goto __pyx_L5_continue;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "vcfutils.pyx":1144
 *                 continue
 * 
 *             if var not in INFO:             # <<<<<<<<<<<<<<
 *                 posteriorProbThisVar = variantPosteriors[var]
 *                 PP = "%.0f" %(posteriorProbThisVar)
 */
      __pyx_t_10 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_v_var), ((PyObject *)__pyx_v_INFO), Py_NE)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = (__pyx_t_10 != 0);
      if (__pyx_t_9) {

        /* "vcfutils.pyx":1145
 * 
 *             if var not in INFO:
 *                 posteriorProbThisVar = variantPosteriors[var]             # <<<<<<<<<<<<<<
 *                 PP = "%.0f" %(posteriorProbThisVar)
 *                 FR = haplotypeFrequencies[hapIndex]
 */
        if (unlikely(((PyObject *)__pyx_v_variantPosteriors) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_variantPosteriors), ((PyObject *)__pyx_v_var)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_posteriorProbThisVar = __pyx_t_11;

        /* "vcfutils.pyx":1146
 *             if var not in INFO:
 *                 posteriorProbThisVar = variantPosteriors[var]
 *                 PP = "%.0f" %(posteriorProbThisVar)             # <<<<<<<<<<<<<<
 *                 FR = haplotypeFrequencies[hapIndex]
 *                 INFO[var] = dict(HP=value['HP'], PP=[PP], FR=[FR], SC=value['SC'])
 */
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_posteriorProbThisVar); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_37), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(((PyObject *)__pyx_v_PP));
        __pyx_v_PP = ((PyObject*)__pyx_t_6);
        __pyx_t_6 = 0;

        /* "vcfutils.pyx":1147
 *                 posteriorProbThisVar = variantPosteriors[var]
 *                 PP = "%.0f" %(posteriorProbThisVar)
 *                 FR = haplotypeFrequencies[hapIndex]             # <<<<<<<<<<<<<<
 *                 INFO[var] = dict(HP=value['HP'], PP=[PP], FR=[FR], SC=value['SC'])
 *             else:
 */
        __pyx_v_FR = (__pyx_v_haplotypeFrequencies[__pyx_v_hapIndex]);

        /* "vcfutils.pyx":1148
 *                 PP = "%.0f" %(posteriorProbThisVar)
 *                 FR = haplotypeFrequencies[hapIndex]
 *                 INFO[var] = dict(HP=value['HP'], PP=[PP], FR=[FR], SC=value['SC'])             # <<<<<<<<<<<<<<
 *             else:
 *                 INFO[var]['FR'][0] += haplotypeFrequencies[hapIndex]
 */
        __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __pyx_t_7 = PyObject_GetItem(__pyx_v_value, ((PyObject *)__pyx_n_s__HP)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__HP), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __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 = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(((PyObject *)__pyx_v_PP));
        PyList_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_PP));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_PP));
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__PP), ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_FR); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__FR), ((PyObject *)__pyx_t_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_GetItem(__pyx_v_value, ((PyObject *)__pyx_n_s__SC)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__SC), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (PyDict_SetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_var), ((PyObject *)__pyx_t_6)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        goto __pyx_L8;
      }
      /*else*/ {

        /* "vcfutils.pyx":1150
 *                 INFO[var] = dict(HP=value['HP'], PP=[PP], FR=[FR], SC=value['SC'])
 *             else:
 *                 INFO[var]['FR'][0] += haplotypeFrequencies[hapIndex]             # <<<<<<<<<<<<<<
 * 
 *     return INFO
 */
        __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_var)); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = PyObject_GetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__FR)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_13 = 0;
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_12, __pyx_t_13, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 0); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyFloat_FromDouble((__pyx_v_haplotypeFrequencies[__pyx_v_hapIndex])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (__Pyx_SetItemInt(__pyx_t_12, __pyx_t_13, __pyx_t_14, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __pyx_L8:;
      __pyx_L5_continue:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "vcfutils.pyx":1152
 *                 INFO[var]['FR'][0] += haplotypeFrequencies[hapIndex]
 * 
 *     return INFO             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_INFO));
  __pyx_r = __pyx_v_INFO;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("vcfutils.getHaplotypeInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_haplotype);
  __Pyx_XDECREF((PyObject *)__pyx_v_var);
  __Pyx_XDECREF(__pyx_v_INFO);
  __Pyx_XDECREF(__pyx_v_PP);
  __Pyx_XDECREF(__pyx_v_hapINFO);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":1156
 * ###################################################################################################
 * 
 * cdef double computeAlleleBiasPValue(int totalReads, int variantReads):             # <<<<<<<<<<<<<<
 *     """
 *     Compute and return allele-bias p-value
 */

static double __pyx_f_8vcfutils_computeAlleleBiasPValue(int __pyx_v_totalReads, int __pyx_v_variantReads) {
  double __pyx_v_pValue;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  double __pyx_t_4;
  double __pyx_t_5;
  double __pyx_t_6;
  __Pyx_RefNannySetupContext("computeAlleleBiasPValue", 0);

  /* "vcfutils.pyx":1160
 *     Compute and return allele-bias p-value
 *     """
 *     cdef double pValue = 0.0             # <<<<<<<<<<<<<<
 * 
 *     # Frequency is higher than het.
 */
  __pyx_v_pValue = 0.0;

  /* "vcfutils.pyx":1163
 * 
 *     # Frequency is higher than het.
 *     if totalReads > 0 and <double>variantReads / <double>(totalReads) >= 0.5:             # <<<<<<<<<<<<<<
 *         return 1.0
 * 
 */
  __pyx_t_1 = ((__pyx_v_totalReads > 0) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (((((double)__pyx_v_variantReads) / ((double)__pyx_v_totalReads)) >= 0.5) != 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "vcfutils.pyx":1164
 *     # Frequency is higher than het.
 *     if totalReads > 0 and <double>variantReads / <double>(totalReads) >= 0.5:
 *         return 1.0             # <<<<<<<<<<<<<<
 * 
 *     # No reads touching variant
 */
    __pyx_r = 1.0;
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "vcfutils.pyx":1167
 * 
 *     # No reads touching variant
 *     elif totalReads == 0:             # <<<<<<<<<<<<<<
 *         return 1.0
 * 
 */
  __pyx_t_3 = ((__pyx_v_totalReads == 0) != 0);
  if (__pyx_t_3) {

    /* "vcfutils.pyx":1168
 *     # No reads touching variant
 *     elif totalReads == 0:
 *         return 1.0             # <<<<<<<<<<<<<<
 * 
 *     # Compare total variant reads to total coverage, and computed frequency
 */
    __pyx_r = 1.0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "vcfutils.pyx":1172
 *     # Compare total variant reads to total coverage, and computed frequency
 *     else:
 *         pValue = betaBinomialCDF(variantReads, totalReads, 20, 20)             # <<<<<<<<<<<<<<
 *         return min(pValue, 1.0-pValue)
 * 
 */
    __pyx_v_pValue = __pyx_f_13platypusutils_betaBinomialCDF(__pyx_v_variantReads, __pyx_v_totalReads, 20, 20);

    /* "vcfutils.pyx":1173
 *     else:
 *         pValue = betaBinomialCDF(variantReads, totalReads, 20, 20)
 *         return min(pValue, 1.0-pValue)             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
    __pyx_t_4 = (1.0 - __pyx_v_pValue);
    __pyx_t_5 = __pyx_v_pValue;
    if (((__pyx_t_4 < __pyx_t_5) != 0)) {
      __pyx_t_6 = __pyx_t_4;
    } else {
      __pyx_t_6 = __pyx_t_5;
    }
    __pyx_r = __pyx_t_6;
    goto __pyx_L0;
  }
  __pyx_L3:;

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

/* "vcfutils.pyx":1177
 * ###################################################################################################
 * 
 * cdef double computeStrandBiasPValue(int nFwdReads, int nRevReads, int nFwdVarReads, int nRevVarReads):             # <<<<<<<<<<<<<<
 *     """
 *     Compute and return a binomial p-value for the number of reads supporting a
 */

static double __pyx_f_8vcfutils_computeStrandBiasPValue(int __pyx_v_nFwdReads, int __pyx_v_nRevReads, int __pyx_v_nFwdVarReads, int __pyx_v_nRevVarReads) {
  int __pyx_v_alpha;
  int __pyx_v_beta;
  double __pyx_v_pVal;
  double __pyx_v_freq;
  int __pyx_v_useForward;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("computeStrandBiasPValue", 0);

  /* "vcfutils.pyx":1182
 *     variant on the forward/reverse strand.
 *     """
 *     cdef int alpha = 0             # <<<<<<<<<<<<<<
 *     cdef int beta = 0
 *     cdef double pVal = 0.0
 */
  __pyx_v_alpha = 0;

  /* "vcfutils.pyx":1183
 *     """
 *     cdef int alpha = 0
 *     cdef int beta = 0             # <<<<<<<<<<<<<<
 *     cdef double pVal = 0.0
 *     cdef double freq = 0.0
 */
  __pyx_v_beta = 0;

  /* "vcfutils.pyx":1184
 *     cdef int alpha = 0
 *     cdef int beta = 0
 *     cdef double pVal = 0.0             # <<<<<<<<<<<<<<
 *     cdef double freq = 0.0
 *     cdef int useForward = True
 */
  __pyx_v_pVal = 0.0;

  /* "vcfutils.pyx":1185
 *     cdef int beta = 0
 *     cdef double pVal = 0.0
 *     cdef double freq = 0.0             # <<<<<<<<<<<<<<
 *     cdef int useForward = True
 * 
 */
  __pyx_v_freq = 0.0;

  /* "vcfutils.pyx":1186
 *     cdef double pVal = 0.0
 *     cdef double freq = 0.0
 *     cdef int useForward = True             # <<<<<<<<<<<<<<
 * 
 *     if nFwdReads == 0 or nRevReads == 0:
 */
  __pyx_v_useForward = 1;

  /* "vcfutils.pyx":1188
 *     cdef int useForward = True
 * 
 *     if nFwdReads == 0 or nRevReads == 0:             # <<<<<<<<<<<<<<
 *         return 1.0
 * 
 */
  __pyx_t_1 = ((__pyx_v_nFwdReads == 0) != 0);
  if (!__pyx_t_1) {
    __pyx_t_2 = ((__pyx_v_nRevReads == 0) != 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "vcfutils.pyx":1189
 * 
 *     if nFwdReads == 0 or nRevReads == 0:
 *         return 1.0             # <<<<<<<<<<<<<<
 * 
 *     if nFwdReads < nRevReads:
 */
    __pyx_r = 1.0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "vcfutils.pyx":1191
 *         return 1.0
 * 
 *     if nFwdReads < nRevReads:             # <<<<<<<<<<<<<<
 *         useForward = False
 * 
 */
  __pyx_t_3 = ((__pyx_v_nFwdReads < __pyx_v_nRevReads) != 0);
  if (__pyx_t_3) {

    /* "vcfutils.pyx":1192
 * 
 *     if nFwdReads < nRevReads:
 *         useForward = False             # <<<<<<<<<<<<<<
 * 
 *     if nFwdReads + nRevReads > 0 and nFwdVarReads + nRevVarReads > 0:
 */
    __pyx_v_useForward = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "vcfutils.pyx":1194
 *         useForward = False
 * 
 *     if nFwdReads + nRevReads > 0 and nFwdVarReads + nRevVarReads > 0:             # <<<<<<<<<<<<<<
 * 
 *         if useForward:
 */
  __pyx_t_3 = (((__pyx_v_nFwdReads + __pyx_v_nRevReads) > 0) != 0);
  if (__pyx_t_3) {
    __pyx_t_1 = (((__pyx_v_nFwdVarReads + __pyx_v_nRevVarReads) > 0) != 0);
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "vcfutils.pyx":1196
 *     if nFwdReads + nRevReads > 0 and nFwdVarReads + nRevVarReads > 0:
 * 
 *         if useForward:             # <<<<<<<<<<<<<<
 *             freq = <double>(nFwdReads) / <double>(nFwdReads + nRevReads)
 *         else:
 */
    __pyx_t_2 = (__pyx_v_useForward != 0);
    if (__pyx_t_2) {

      /* "vcfutils.pyx":1197
 * 
 *         if useForward:
 *             freq = <double>(nFwdReads) / <double>(nFwdReads + nRevReads)             # <<<<<<<<<<<<<<
 *         else:
 *             freq = <double>(nRevReads) / <double>(nFwdReads + nRevReads)
 */
      __pyx_v_freq = (((double)__pyx_v_nFwdReads) / ((double)(__pyx_v_nFwdReads + __pyx_v_nRevReads)));
      goto __pyx_L6;
    }
    /*else*/ {

      /* "vcfutils.pyx":1199
 *             freq = <double>(nFwdReads) / <double>(nFwdReads + nRevReads)
 *         else:
 *             freq = <double>(nRevReads) / <double>(nFwdReads + nRevReads)             # <<<<<<<<<<<<<<
 * 
 *         #print "Freq = %s. nFwd = %s. nRev = %s. nVarFwd = %s. nVarRev = %s" %(freq, nFwdReads, nRevReads, nFwdVarReads, nRevVarReads)
 */
      __pyx_v_freq = (((double)__pyx_v_nRevReads) / ((double)(__pyx_v_nFwdReads + __pyx_v_nRevReads)));
    }
    __pyx_L6:;

    /* "vcfutils.pyx":1203
 *         #print "Freq = %s. nFwd = %s. nRev = %s. nVarFwd = %s. nVarRev = %s" %(freq, nFwdReads, nRevReads, nFwdVarReads, nRevVarReads)
 * 
 *         if freq < 0.5:             # <<<<<<<<<<<<<<
 *             alpha = 20
 *             beta = int((<double>alpha)/freq - alpha)
 */
    __pyx_t_2 = ((__pyx_v_freq < 0.5) != 0);
    if (__pyx_t_2) {

      /* "vcfutils.pyx":1204
 * 
 *         if freq < 0.5:
 *             alpha = 20             # <<<<<<<<<<<<<<
 *             beta = int((<double>alpha)/freq - alpha)
 * 
 */
      __pyx_v_alpha = 20;

      /* "vcfutils.pyx":1205
 *         if freq < 0.5:
 *             alpha = 20
 *             beta = int((<double>alpha)/freq - alpha)             # <<<<<<<<<<<<<<
 * 
 *         elif freq > 0.5:
 */
      __pyx_v_beta = ((int)((((double)__pyx_v_alpha) / __pyx_v_freq) - __pyx_v_alpha));
      goto __pyx_L7;
    }

    /* "vcfutils.pyx":1207
 *             beta = int((<double>alpha)/freq - alpha)
 * 
 *         elif freq > 0.5:             # <<<<<<<<<<<<<<
 *             beta = 20
 *             alpha = int(beta*freq/(1.0-freq))
 */
    __pyx_t_2 = ((__pyx_v_freq > 0.5) != 0);
    if (__pyx_t_2) {

      /* "vcfutils.pyx":1208
 * 
 *         elif freq > 0.5:
 *             beta = 20             # <<<<<<<<<<<<<<
 *             alpha = int(beta*freq/(1.0-freq))
 * 
 */
      __pyx_v_beta = 20;

      /* "vcfutils.pyx":1209
 *         elif freq > 0.5:
 *             beta = 20
 *             alpha = int(beta*freq/(1.0-freq))             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_v_alpha = ((int)((__pyx_v_beta * __pyx_v_freq) / (1.0 - __pyx_v_freq)));
      goto __pyx_L7;
    }
    /*else*/ {

      /* "vcfutils.pyx":1212
 * 
 *         else:
 *             alpha = 20             # <<<<<<<<<<<<<<
 *             beta = 20
 * 
 */
      __pyx_v_alpha = 20;

      /* "vcfutils.pyx":1213
 *         else:
 *             alpha = 20
 *             beta = 20             # <<<<<<<<<<<<<<
 * 
 *         if useForward:
 */
      __pyx_v_beta = 20;
    }
    __pyx_L7:;

    /* "vcfutils.pyx":1215
 *             beta = 20
 * 
 *         if useForward:             # <<<<<<<<<<<<<<
 *             pVal = betaBinomialCDF(nFwdVarReads, nFwdVarReads+nRevVarReads, alpha, beta)
 *         else:
 */
    __pyx_t_2 = (__pyx_v_useForward != 0);
    if (__pyx_t_2) {

      /* "vcfutils.pyx":1216
 * 
 *         if useForward:
 *             pVal = betaBinomialCDF(nFwdVarReads, nFwdVarReads+nRevVarReads, alpha, beta)             # <<<<<<<<<<<<<<
 *         else:
 *             pVal = betaBinomialCDF(nRevVarReads, nFwdVarReads+nRevVarReads, alpha, beta)
 */
      __pyx_v_pVal = __pyx_f_13platypusutils_betaBinomialCDF(__pyx_v_nFwdVarReads, (__pyx_v_nFwdVarReads + __pyx_v_nRevVarReads), __pyx_v_alpha, __pyx_v_beta);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "vcfutils.pyx":1218
 *             pVal = betaBinomialCDF(nFwdVarReads, nFwdVarReads+nRevVarReads, alpha, beta)
 *         else:
 *             pVal = betaBinomialCDF(nRevVarReads, nFwdVarReads+nRevVarReads, alpha, beta)             # <<<<<<<<<<<<<<
 * 
 *         return pVal
 */
      __pyx_v_pVal = __pyx_f_13platypusutils_betaBinomialCDF(__pyx_v_nRevVarReads, (__pyx_v_nFwdVarReads + __pyx_v_nRevVarReads), __pyx_v_alpha, __pyx_v_beta);
    }
    __pyx_L8:;

    /* "vcfutils.pyx":1220
 *             pVal = betaBinomialCDF(nRevVarReads, nFwdVarReads+nRevVarReads, alpha, beta)
 * 
 *         return pVal             # <<<<<<<<<<<<<<
 *     else:
 *         return 1.0
 */
    __pyx_r = __pyx_v_pVal;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "vcfutils.pyx":1222
 *         return pVal
 *     else:
 *         return 1.0             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
    __pyx_r = 1.0;
    goto __pyx_L0;
  }
  __pyx_L5:;

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

/* "vcfutils.pyx":1226
 * ###################################################################################################
 * 
 * cdef dict vcfINFO(double* haplotypeFrequencies, dict variantPosteriors, list genotypeCalls, list genotypes, list haplotypes, list readBuffers, int nHaplotypes, options, FastaFile refFile):             # <<<<<<<<<<<<<<
 *     """
 *     INFO field for vcf output, two level dictionary of variant - info field - value
 */

static PyObject *__pyx_f_8vcfutils_vcfINFO(double *__pyx_v_haplotypeFrequencies, PyObject *__pyx_v_variantPosteriors, PyObject *__pyx_v_genotypeCalls, PyObject *__pyx_v_genotypes, PyObject *__pyx_v_haplotypes, PyObject *__pyx_v_readBuffers, int __pyx_v_nHaplotypes, PyObject *__pyx_v_options, struct __pyx_obj_9fastafile_FastaFile *__pyx_v_refFile) {
  struct __pyx_obj_7variant_Variant *__pyx_v_variant = 0;
  PyObject *__pyx_v_nReadsPerSample = 0;
  PyObject *__pyx_v_nVarReadsPerSample = 0;
  PyObject *__pyx_v_listOfMinBaseQuals = 0;
  CYTHON_UNUSED double __pyx_v_BRF;
  int __pyx_v_badReadsWindow;
  CYTHON_UNUSED int __pyx_v_verbosity;
  CYTHON_UNUSED int __pyx_v_minMapQual;
  int __pyx_v_minBaseQual;
  int __pyx_v_nReadsThisSample;
  int __pyx_v_nVarReadsThisSample;
  int __pyx_v_nBadReads;
  int __pyx_v_nGoodReads;
  int __pyx_v_index;
  int __pyx_v_varBAMMinPos;
  int __pyx_v_varBAMMaxPos;
  int __pyx_v_TC;
  int __pyx_v_TC_bad;
  int __pyx_v_TR;
  int __pyx_v_TC_ab;
  int __pyx_v_TR_ab;
  int __pyx_v_NR_sb;
  int __pyx_v_NF_sb;
  int __pyx_v_TCR;
  int __pyx_v_TCF;
  int __pyx_v_TCR_sb;
  int __pyx_v_TCF_sb;
  int __pyx_v_minBaseQualInWindow;
  int __pyx_v_windowStart;
  int __pyx_v_windowSize;
  int __pyx_v_windowEnd;
  int __pyx_v_windowIndex;
  CYTHON_UNUSED int __pyx_v_startPosOfVarInRead;
  int __pyx_v_countOnlyExactIndelMatches;
  float __pyx_v_RMSMQ;
  int __pyx_v_varInGenotype;
  __pyx_t_13htslibWrapper_cAlignedRead **__pyx_v_pStartRead;
  __pyx_t_13htslibWrapper_cAlignedRead **__pyx_v_pEndRead;
  __pyx_t_13htslibWrapper_cAlignedRead **__pyx_v_pStartBadRead;
  __pyx_t_13htslibWrapper_cAlignedRead **__pyx_v_pEndBadRead;
  __pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_pRead;
  struct __pyx_obj_7cwindow_bamReadBuffer *__pyx_v_readBuffer = 0;
  int __pyx_v_HapScore;
  PyObject *__pyx_v_INFO = 0;
  CYTHON_UNUSED PyObject *__pyx_v_sortedVars = 0;
  PyObject *__pyx_v_NR = NULL;
  PyObject *__pyx_v_NF = NULL;
  PyObject *__pyx_v_genotype = NULL;
  double __pyx_v_qual;
  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;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __pyx_t_13htslibWrapper_cAlignedRead **__pyx_t_12;
  long __pyx_t_13;
  long __pyx_t_14;
  long __pyx_t_15;
  short __pyx_t_16;
  int __pyx_t_17;
  int __pyx_t_18;
  char __pyx_t_19;
  int __pyx_t_20;
  int __pyx_t_21;
  int __pyx_t_22;
  double __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  Py_ssize_t __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vcfINFO", 0);

  /* "vcfutils.pyx":1233
 *     cdef list nReadsPerSample
 *     cdef list nVarReadsPerSample
 *     cdef list listOfMinBaseQuals = []             # <<<<<<<<<<<<<<
 *     cdef double BRF = 0.0
 *     cdef int badReadsWindow = options.badReadsWindow
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_listOfMinBaseQuals = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1234
 *     cdef list nVarReadsPerSample
 *     cdef list listOfMinBaseQuals = []
 *     cdef double BRF = 0.0             # <<<<<<<<<<<<<<
 *     cdef int badReadsWindow = options.badReadsWindow
 *     cdef int verbosity = options.verbosity
 */
  __pyx_v_BRF = 0.0;

  /* "vcfutils.pyx":1235
 *     cdef list listOfMinBaseQuals = []
 *     cdef double BRF = 0.0
 *     cdef int badReadsWindow = options.badReadsWindow             # <<<<<<<<<<<<<<
 *     cdef int verbosity = options.verbosity
 *     cdef int minMapQual = options.minMapQual
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__badReadsWindow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_badReadsWindow = __pyx_t_2;

  /* "vcfutils.pyx":1236
 *     cdef double BRF = 0.0
 *     cdef int badReadsWindow = options.badReadsWindow
 *     cdef int verbosity = options.verbosity             # <<<<<<<<<<<<<<
 *     cdef int minMapQual = options.minMapQual
 *     cdef int minBaseQual = options.minBaseQual
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__verbosity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_verbosity = __pyx_t_2;

  /* "vcfutils.pyx":1237
 *     cdef int badReadsWindow = options.badReadsWindow
 *     cdef int verbosity = options.verbosity
 *     cdef int minMapQual = options.minMapQual             # <<<<<<<<<<<<<<
 *     cdef int minBaseQual = options.minBaseQual
 *     cdef int nReadsThisSample = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__minMapQual); 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_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_minMapQual = __pyx_t_2;

  /* "vcfutils.pyx":1238
 *     cdef int verbosity = options.verbosity
 *     cdef int minMapQual = options.minMapQual
 *     cdef int minBaseQual = options.minBaseQual             # <<<<<<<<<<<<<<
 *     cdef int nReadsThisSample = 0
 *     cdef int nVarReadsThisSample = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__minBaseQual); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_minBaseQual = __pyx_t_2;

  /* "vcfutils.pyx":1239
 *     cdef int minMapQual = options.minMapQual
 *     cdef int minBaseQual = options.minBaseQual
 *     cdef int nReadsThisSample = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarReadsThisSample = 0
 *     cdef int nBadReads = 0
 */
  __pyx_v_nReadsThisSample = 0;

  /* "vcfutils.pyx":1240
 *     cdef int minBaseQual = options.minBaseQual
 *     cdef int nReadsThisSample = 0
 *     cdef int nVarReadsThisSample = 0             # <<<<<<<<<<<<<<
 *     cdef int nBadReads = 0
 *     cdef int nGoodReads = 0
 */
  __pyx_v_nVarReadsThisSample = 0;

  /* "vcfutils.pyx":1241
 *     cdef int nReadsThisSample = 0
 *     cdef int nVarReadsThisSample = 0
 *     cdef int nBadReads = 0             # <<<<<<<<<<<<<<
 *     cdef int nGoodReads = 0
 *     cdef int index = 0
 */
  __pyx_v_nBadReads = 0;

  /* "vcfutils.pyx":1242
 *     cdef int nVarReadsThisSample = 0
 *     cdef int nBadReads = 0
 *     cdef int nGoodReads = 0             # <<<<<<<<<<<<<<
 *     cdef int index = 0
 *     cdef int varBAMMinPos = 0
 */
  __pyx_v_nGoodReads = 0;

  /* "vcfutils.pyx":1243
 *     cdef int nBadReads = 0
 *     cdef int nGoodReads = 0
 *     cdef int index = 0             # <<<<<<<<<<<<<<
 *     cdef int varBAMMinPos = 0
 *     cdef int varBAMMaxPos = 0
 */
  __pyx_v_index = 0;

  /* "vcfutils.pyx":1244
 *     cdef int nGoodReads = 0
 *     cdef int index = 0
 *     cdef int varBAMMinPos = 0             # <<<<<<<<<<<<<<
 *     cdef int varBAMMaxPos = 0
 *     cdef int TC = 0
 */
  __pyx_v_varBAMMinPos = 0;

  /* "vcfutils.pyx":1245
 *     cdef int index = 0
 *     cdef int varBAMMinPos = 0
 *     cdef int varBAMMaxPos = 0             # <<<<<<<<<<<<<<
 *     cdef int TC = 0
 *     cdef int TC_bad = 0
 */
  __pyx_v_varBAMMaxPos = 0;

  /* "vcfutils.pyx":1246
 *     cdef int varBAMMinPos = 0
 *     cdef int varBAMMaxPos = 0
 *     cdef int TC = 0             # <<<<<<<<<<<<<<
 *     cdef int TC_bad = 0
 *     cdef int TR = 0
 */
  __pyx_v_TC = 0;

  /* "vcfutils.pyx":1247
 *     cdef int varBAMMaxPos = 0
 *     cdef int TC = 0
 *     cdef int TC_bad = 0             # <<<<<<<<<<<<<<
 *     cdef int TR = 0
 *     cdef int TC_ab = 0
 */
  __pyx_v_TC_bad = 0;

  /* "vcfutils.pyx":1248
 *     cdef int TC = 0
 *     cdef int TC_bad = 0
 *     cdef int TR = 0             # <<<<<<<<<<<<<<
 *     cdef int TC_ab = 0
 *     cdef int TR_ab = 0
 */
  __pyx_v_TR = 0;

  /* "vcfutils.pyx":1249
 *     cdef int TC_bad = 0
 *     cdef int TR = 0
 *     cdef int TC_ab = 0             # <<<<<<<<<<<<<<
 *     cdef int TR_ab = 0
 *     cdef int NR_sb = 0
 */
  __pyx_v_TC_ab = 0;

  /* "vcfutils.pyx":1250
 *     cdef int TR = 0
 *     cdef int TC_ab = 0
 *     cdef int TR_ab = 0             # <<<<<<<<<<<<<<
 *     cdef int NR_sb = 0
 *     cdef int NF_sb = 0
 */
  __pyx_v_TR_ab = 0;

  /* "vcfutils.pyx":1251
 *     cdef int TC_ab = 0
 *     cdef int TR_ab = 0
 *     cdef int NR_sb = 0             # <<<<<<<<<<<<<<
 *     cdef int NF_sb = 0
 *     cdef int TCR = 0
 */
  __pyx_v_NR_sb = 0;

  /* "vcfutils.pyx":1252
 *     cdef int TR_ab = 0
 *     cdef int NR_sb = 0
 *     cdef int NF_sb = 0             # <<<<<<<<<<<<<<
 *     cdef int TCR = 0
 *     cdef int TCF = 0
 */
  __pyx_v_NF_sb = 0;

  /* "vcfutils.pyx":1253
 *     cdef int NR_sb = 0
 *     cdef int NF_sb = 0
 *     cdef int TCR = 0             # <<<<<<<<<<<<<<
 *     cdef int TCF = 0
 *     cdef int TCR_sb = 0
 */
  __pyx_v_TCR = 0;

  /* "vcfutils.pyx":1254
 *     cdef int NF_sb = 0
 *     cdef int TCR = 0
 *     cdef int TCF = 0             # <<<<<<<<<<<<<<
 *     cdef int TCR_sb = 0
 *     cdef int TCF_sb = 0
 */
  __pyx_v_TCF = 0;

  /* "vcfutils.pyx":1255
 *     cdef int TCR = 0
 *     cdef int TCF = 0
 *     cdef int TCR_sb = 0             # <<<<<<<<<<<<<<
 *     cdef int TCF_sb = 0
 *     cdef int minBaseQualInWindow = 0
 */
  __pyx_v_TCR_sb = 0;

  /* "vcfutils.pyx":1256
 *     cdef int TCF = 0
 *     cdef int TCR_sb = 0
 *     cdef int TCF_sb = 0             # <<<<<<<<<<<<<<
 *     cdef int minBaseQualInWindow = 0
 *     cdef int windowStart = 0
 */
  __pyx_v_TCF_sb = 0;

  /* "vcfutils.pyx":1257
 *     cdef int TCR_sb = 0
 *     cdef int TCF_sb = 0
 *     cdef int minBaseQualInWindow = 0             # <<<<<<<<<<<<<<
 *     cdef int windowStart = 0
 *     cdef int windowSize = badReadsWindow
 */
  __pyx_v_minBaseQualInWindow = 0;

  /* "vcfutils.pyx":1258
 *     cdef int TCF_sb = 0
 *     cdef int minBaseQualInWindow = 0
 *     cdef int windowStart = 0             # <<<<<<<<<<<<<<
 *     cdef int windowSize = badReadsWindow
 *     cdef int windowEnd = 0
 */
  __pyx_v_windowStart = 0;

  /* "vcfutils.pyx":1259
 *     cdef int minBaseQualInWindow = 0
 *     cdef int windowStart = 0
 *     cdef int windowSize = badReadsWindow             # <<<<<<<<<<<<<<
 *     cdef int windowEnd = 0
 *     cdef int windowIndex = 0
 */
  __pyx_v_windowSize = __pyx_v_badReadsWindow;

  /* "vcfutils.pyx":1260
 *     cdef int windowStart = 0
 *     cdef int windowSize = badReadsWindow
 *     cdef int windowEnd = 0             # <<<<<<<<<<<<<<
 *     cdef int windowIndex = 0
 *     cdef int startPosOfVarInRead = 0
 */
  __pyx_v_windowEnd = 0;

  /* "vcfutils.pyx":1261
 *     cdef int windowSize = badReadsWindow
 *     cdef int windowEnd = 0
 *     cdef int windowIndex = 0             # <<<<<<<<<<<<<<
 *     cdef int startPosOfVarInRead = 0
 *     cdef int countOnlyExactIndelMatches = options.countOnlyExactIndelMatches
 */
  __pyx_v_windowIndex = 0;

  /* "vcfutils.pyx":1262
 *     cdef int windowEnd = 0
 *     cdef int windowIndex = 0
 *     cdef int startPosOfVarInRead = 0             # <<<<<<<<<<<<<<
 *     cdef int countOnlyExactIndelMatches = options.countOnlyExactIndelMatches
 *     cdef float RMSMQ = 0
 */
  __pyx_v_startPosOfVarInRead = 0;

  /* "vcfutils.pyx":1263
 *     cdef int windowIndex = 0
 *     cdef int startPosOfVarInRead = 0
 *     cdef int countOnlyExactIndelMatches = options.countOnlyExactIndelMatches             # <<<<<<<<<<<<<<
 *     cdef float RMSMQ = 0
 *     cdef bint varInGenotype = False
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_38); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_countOnlyExactIndelMatches = __pyx_t_2;

  /* "vcfutils.pyx":1264
 *     cdef int startPosOfVarInRead = 0
 *     cdef int countOnlyExactIndelMatches = options.countOnlyExactIndelMatches
 *     cdef float RMSMQ = 0             # <<<<<<<<<<<<<<
 *     cdef bint varInGenotype = False
 *     cdef cAlignedRead** pStartRead
 */
  __pyx_v_RMSMQ = 0.0;

  /* "vcfutils.pyx":1265
 *     cdef int countOnlyExactIndelMatches = options.countOnlyExactIndelMatches
 *     cdef float RMSMQ = 0
 *     cdef bint varInGenotype = False             # <<<<<<<<<<<<<<
 *     cdef cAlignedRead** pStartRead
 *     cdef cAlignedRead** pEndRead
 */
  __pyx_v_varInGenotype = 0;

  /* "vcfutils.pyx":1274
 * 
 *     # Make sure to do this in the right order
 *     cdef int HapScore = computeHaplotypeScore(genotypes)             # <<<<<<<<<<<<<<
 *     cdef dict INFO = getHaplotypeInfo(haplotypes, variantPosteriors, haplotypeFrequencies, nHaplotypes)
 *     cdef list sortedVars = sorted(INFO.keys())
 */
  __pyx_v_HapScore = __pyx_f_8vcfutils_computeHaplotypeScore(__pyx_v_genotypes);

  /* "vcfutils.pyx":1275
 *     # Make sure to do this in the right order
 *     cdef int HapScore = computeHaplotypeScore(genotypes)
 *     cdef dict INFO = getHaplotypeInfo(haplotypes, variantPosteriors, haplotypeFrequencies, nHaplotypes)             # <<<<<<<<<<<<<<
 *     cdef list sortedVars = sorted(INFO.keys())
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_8vcfutils_getHaplotypeInfo(__pyx_v_haplotypes, __pyx_v_variantPosteriors, __pyx_v_haplotypeFrequencies, __pyx_v_nHaplotypes)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_INFO = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1276
 *     cdef int HapScore = computeHaplotypeScore(genotypes)
 *     cdef dict INFO = getHaplotypeInfo(haplotypes, variantPosteriors, haplotypeFrequencies, nHaplotypes)
 *     cdef list sortedVars = sorted(INFO.keys())             # <<<<<<<<<<<<<<
 * 
 *     for variant in INFO:
 */
  if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_v_INFO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __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 = 1276; __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 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected list, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_sortedVars = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1278
 *     cdef list sortedVars = sorted(INFO.keys())
 * 
 *     for variant in INFO:             # <<<<<<<<<<<<<<
 * 
 *         listOfMinBaseQuals = []
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_dict_iterator(((PyObject *)__pyx_v_INFO), 1, ((PyObject *)NULL), (&__pyx_t_5), (&__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, &__pyx_t_3, NULL, NULL, __pyx_t_2);
    if (unlikely(__pyx_t_6 == 0)) break;
    if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7variant_Variant))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF(((PyObject *)__pyx_v_variant));
    __pyx_v_variant = ((struct __pyx_obj_7variant_Variant *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":1280
 *     for variant in INFO:
 * 
 *         listOfMinBaseQuals = []             # <<<<<<<<<<<<<<
 *         nReadsPerSample = []
 *         nVarReadsPerSample = []
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_v_listOfMinBaseQuals));
    __pyx_v_listOfMinBaseQuals = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":1281
 * 
 *         listOfMinBaseQuals = []
 *         nReadsPerSample = []             # <<<<<<<<<<<<<<
 *         nVarReadsPerSample = []
 *         nGoodReads = 0
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF(((PyObject *)__pyx_v_nReadsPerSample));
    __pyx_v_nReadsPerSample = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":1282
 *         listOfMinBaseQuals = []
 *         nReadsPerSample = []
 *         nVarReadsPerSample = []             # <<<<<<<<<<<<<<
 *         nGoodReads = 0
 *         nBadReads = 0
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF(((PyObject *)__pyx_v_nVarReadsPerSample));
    __pyx_v_nVarReadsPerSample = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "vcfutils.pyx":1283
 *         nReadsPerSample = []
 *         nVarReadsPerSample = []
 *         nGoodReads = 0             # <<<<<<<<<<<<<<
 *         nBadReads = 0
 *         RMSMQ = 0
 */
    __pyx_v_nGoodReads = 0;

    /* "vcfutils.pyx":1284
 *         nVarReadsPerSample = []
 *         nGoodReads = 0
 *         nBadReads = 0             # <<<<<<<<<<<<<<
 *         RMSMQ = 0
 *         TC = 0
 */
    __pyx_v_nBadReads = 0;

    /* "vcfutils.pyx":1285
 *         nGoodReads = 0
 *         nBadReads = 0
 *         RMSMQ = 0             # <<<<<<<<<<<<<<
 *         TC = 0
 *         TC_bad = 0
 */
    __pyx_v_RMSMQ = 0.0;

    /* "vcfutils.pyx":1286
 *         nBadReads = 0
 *         RMSMQ = 0
 *         TC = 0             # <<<<<<<<<<<<<<
 *         TC_bad = 0
 *         TR = 0
 */
    __pyx_v_TC = 0;

    /* "vcfutils.pyx":1287
 *         RMSMQ = 0
 *         TC = 0
 *         TC_bad = 0             # <<<<<<<<<<<<<<
 *         TR = 0
 *         TC_ab = 0
 */
    __pyx_v_TC_bad = 0;

    /* "vcfutils.pyx":1288
 *         TC = 0
 *         TC_bad = 0
 *         TR = 0             # <<<<<<<<<<<<<<
 *         TC_ab = 0
 *         TR_ab = 0
 */
    __pyx_v_TR = 0;

    /* "vcfutils.pyx":1289
 *         TC_bad = 0
 *         TR = 0
 *         TC_ab = 0             # <<<<<<<<<<<<<<
 *         TR_ab = 0
 *         TCR = 0
 */
    __pyx_v_TC_ab = 0;

    /* "vcfutils.pyx":1290
 *         TR = 0
 *         TC_ab = 0
 *         TR_ab = 0             # <<<<<<<<<<<<<<
 *         TCR = 0
 *         TCF = 0
 */
    __pyx_v_TR_ab = 0;

    /* "vcfutils.pyx":1291
 *         TC_ab = 0
 *         TR_ab = 0
 *         TCR = 0             # <<<<<<<<<<<<<<
 *         TCF = 0
 *         NR = 0
 */
    __pyx_v_TCR = 0;

    /* "vcfutils.pyx":1292
 *         TR_ab = 0
 *         TCR = 0
 *         TCF = 0             # <<<<<<<<<<<<<<
 *         NR = 0
 *         NF = 0
 */
    __pyx_v_TCF = 0;

    /* "vcfutils.pyx":1293
 *         TCR = 0
 *         TCF = 0
 *         NR = 0             # <<<<<<<<<<<<<<
 *         NF = 0
 *         NR_sb = 0
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_NR);
    __pyx_v_NR = __pyx_int_0;

    /* "vcfutils.pyx":1294
 *         TCF = 0
 *         NR = 0
 *         NF = 0             # <<<<<<<<<<<<<<
 *         NR_sb = 0
 *         NF_sb = 0
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF(__pyx_v_NF);
    __pyx_v_NF = __pyx_int_0;

    /* "vcfutils.pyx":1295
 *         NR = 0
 *         NF = 0
 *         NR_sb = 0             # <<<<<<<<<<<<<<
 *         NF_sb = 0
 *         TCR_sb = 0
 */
    __pyx_v_NR_sb = 0;

    /* "vcfutils.pyx":1296
 *         NF = 0
 *         NR_sb = 0
 *         NF_sb = 0             # <<<<<<<<<<<<<<
 *         TCR_sb = 0
 *         TCF_sb = 0
 */
    __pyx_v_NF_sb = 0;

    /* "vcfutils.pyx":1297
 *         NR_sb = 0
 *         NF_sb = 0
 *         TCR_sb = 0             # <<<<<<<<<<<<<<
 *         TCF_sb = 0
 *         varBAMMinPos = variant.bamMinPos
 */
    __pyx_v_TCR_sb = 0;

    /* "vcfutils.pyx":1298
 *         NF_sb = 0
 *         TCR_sb = 0
 *         TCF_sb = 0             # <<<<<<<<<<<<<<
 *         varBAMMinPos = variant.bamMinPos
 *         varBAMMaxPos = variant.bamMaxPos
 */
    __pyx_v_TCF_sb = 0;

    /* "vcfutils.pyx":1299
 *         TCR_sb = 0
 *         TCF_sb = 0
 *         varBAMMinPos = variant.bamMinPos             # <<<<<<<<<<<<<<
 *         varBAMMaxPos = variant.bamMaxPos
 * 
 */
    __pyx_t_6 = __pyx_v_variant->bamMinPos;
    __pyx_v_varBAMMinPos = __pyx_t_6;

    /* "vcfutils.pyx":1300
 *         TCF_sb = 0
 *         varBAMMinPos = variant.bamMinPos
 *         varBAMMaxPos = variant.bamMaxPos             # <<<<<<<<<<<<<<
 * 
 *         for index,genotype in enumerate(genotypeCalls):
 */
    __pyx_t_6 = __pyx_v_variant->bamMaxPos;
    __pyx_v_varBAMMaxPos = __pyx_t_6;

    /* "vcfutils.pyx":1302
 *         varBAMMaxPos = variant.bamMaxPos
 * 
 *         for index,genotype in enumerate(genotypeCalls):             # <<<<<<<<<<<<<<
 * 
 *             varInGenotype = genotype is not None and variant in genotype
 */
    __pyx_t_6 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_v_genotypeCalls); __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
    for (;;) {
      if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_XDECREF(__pyx_v_genotype);
      __pyx_v_genotype = __pyx_t_8;
      __pyx_t_8 = 0;
      __pyx_v_index = __pyx_t_6;
      __pyx_t_6 = (__pyx_t_6 + 1);

      /* "vcfutils.pyx":1304
 *         for index,genotype in enumerate(genotypeCalls):
 * 
 *             varInGenotype = genotype is not None and variant in genotype             # <<<<<<<<<<<<<<
 *             readBuffer = readBuffers[index]
 *             pStartRead = readBuffer.reads.windowStart
 */
      __pyx_t_9 = (__pyx_v_genotype != Py_None);
      if (__pyx_t_9) {
        __pyx_t_10 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_variant), __pyx_v_genotype, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_11 = __pyx_t_10;
      } else {
        __pyx_t_11 = __pyx_t_9;
      }
      __pyx_v_varInGenotype = __pyx_t_11;

      /* "vcfutils.pyx":1305
 * 
 *             varInGenotype = genotype is not None and variant in genotype
 *             readBuffer = readBuffers[index]             # <<<<<<<<<<<<<<
 *             pStartRead = readBuffer.reads.windowStart
 *             pEndRead = readBuffer.reads.windowEnd
 */
      if (unlikely(((PyObject *)__pyx_v_readBuffers) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_readBuffers), __pyx_v_index, sizeof(int), PyInt_FromLong, 1, 1, 0); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7cwindow_bamReadBuffer))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_readBuffer));
      __pyx_v_readBuffer = ((struct __pyx_obj_7cwindow_bamReadBuffer *)__pyx_t_8);
      __pyx_t_8 = 0;

      /* "vcfutils.pyx":1306
 *             varInGenotype = genotype is not None and variant in genotype
 *             readBuffer = readBuffers[index]
 *             pStartRead = readBuffer.reads.windowStart             # <<<<<<<<<<<<<<
 *             pEndRead = readBuffer.reads.windowEnd
 *             pStartBadRead = readBuffer.badReads.windowStart
 */
      __pyx_t_12 = __pyx_v_readBuffer->reads->windowStart;
      __pyx_v_pStartRead = __pyx_t_12;

      /* "vcfutils.pyx":1307
 *             readBuffer = readBuffers[index]
 *             pStartRead = readBuffer.reads.windowStart
 *             pEndRead = readBuffer.reads.windowEnd             # <<<<<<<<<<<<<<
 *             pStartBadRead = readBuffer.badReads.windowStart
 *             pEndBadRead = readBuffer.badReads.windowEnd
 */
      __pyx_t_12 = __pyx_v_readBuffer->reads->windowEnd;
      __pyx_v_pEndRead = __pyx_t_12;

      /* "vcfutils.pyx":1308
 *             pStartRead = readBuffer.reads.windowStart
 *             pEndRead = readBuffer.reads.windowEnd
 *             pStartBadRead = readBuffer.badReads.windowStart             # <<<<<<<<<<<<<<
 *             pEndBadRead = readBuffer.badReads.windowEnd
 *             nGoodReads += (readBuffer.reads.windowEnd - readBuffer.reads.windowStart)
 */
      __pyx_t_12 = __pyx_v_readBuffer->badReads->windowStart;
      __pyx_v_pStartBadRead = __pyx_t_12;

      /* "vcfutils.pyx":1309
 *             pEndRead = readBuffer.reads.windowEnd
 *             pStartBadRead = readBuffer.badReads.windowStart
 *             pEndBadRead = readBuffer.badReads.windowEnd             # <<<<<<<<<<<<<<
 *             nGoodReads += (readBuffer.reads.windowEnd - readBuffer.reads.windowStart)
 *             nBadReads += (readBuffer.badReads.windowEnd - readBuffer.badReads.windowStart)
 */
      __pyx_t_12 = __pyx_v_readBuffer->badReads->windowEnd;
      __pyx_v_pEndBadRead = __pyx_t_12;

      /* "vcfutils.pyx":1310
 *             pStartBadRead = readBuffer.badReads.windowStart
 *             pEndBadRead = readBuffer.badReads.windowEnd
 *             nGoodReads += (readBuffer.reads.windowEnd - readBuffer.reads.windowStart)             # <<<<<<<<<<<<<<
 *             nBadReads += (readBuffer.badReads.windowEnd - readBuffer.badReads.windowStart)
 * 
 */
      __pyx_v_nGoodReads = (__pyx_v_nGoodReads + (__pyx_v_readBuffer->reads->windowEnd - __pyx_v_readBuffer->reads->windowStart));

      /* "vcfutils.pyx":1311
 *             pEndBadRead = readBuffer.badReads.windowEnd
 *             nGoodReads += (readBuffer.reads.windowEnd - readBuffer.reads.windowStart)
 *             nBadReads += (readBuffer.badReads.windowEnd - readBuffer.badReads.windowStart)             # <<<<<<<<<<<<<<
 * 
 *             nReadsThisSample = 0
 */
      __pyx_v_nBadReads = (__pyx_v_nBadReads + (__pyx_v_readBuffer->badReads->windowEnd - __pyx_v_readBuffer->badReads->windowStart));

      /* "vcfutils.pyx":1313
 *             nBadReads += (readBuffer.badReads.windowEnd - readBuffer.badReads.windowStart)
 * 
 *             nReadsThisSample = 0             # <<<<<<<<<<<<<<
 *             nVarReadsThisSample = 0
 * 
 */
      __pyx_v_nReadsThisSample = 0;

      /* "vcfutils.pyx":1314
 * 
 *             nReadsThisSample = 0
 *             nVarReadsThisSample = 0             # <<<<<<<<<<<<<<
 * 
 *             while pStartBadRead != pEndBadRead:
 */
      __pyx_v_nVarReadsThisSample = 0;

      /* "vcfutils.pyx":1316
 *             nVarReadsThisSample = 0
 * 
 *             while pStartBadRead != pEndBadRead:             # <<<<<<<<<<<<<<
 * 
 *                 pRead = pStartBadRead[0]
 */
      while (1) {
        __pyx_t_11 = ((__pyx_v_pStartBadRead != __pyx_v_pEndBadRead) != 0);
        if (!__pyx_t_11) break;

        /* "vcfutils.pyx":1318
 *             while pStartBadRead != pEndBadRead:
 * 
 *                 pRead = pStartBadRead[0]             # <<<<<<<<<<<<<<
 * 
 *                 # Does read overlap variant site
 */
        __pyx_v_pRead = (__pyx_v_pStartBadRead[0]);

        /* "vcfutils.pyx":1321
 * 
 *                 # Does read overlap variant site
 *                 if not readOverlapsVariant(pRead, varBAMMinPos, varBAMMaxPos):             # <<<<<<<<<<<<<<
 *                     pStartBadRead += 1
 *                     continue
 */
        __pyx_t_11 = ((!(__pyx_f_8vcfutils_readOverlapsVariant(__pyx_v_pRead, __pyx_v_varBAMMinPos, __pyx_v_varBAMMaxPos) != 0)) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":1322
 *                 # Does read overlap variant site
 *                 if not readOverlapsVariant(pRead, varBAMMinPos, varBAMMaxPos):
 *                     pStartBadRead += 1             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
          __pyx_v_pStartBadRead = (__pyx_v_pStartBadRead + 1);

          /* "vcfutils.pyx":1323
 *                 if not readOverlapsVariant(pRead, varBAMMinPos, varBAMMaxPos):
 *                     pStartBadRead += 1
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 # Does read have good quality across variant site
 */
          goto __pyx_L7_continue;
          goto __pyx_L9;
        }
        __pyx_L9:;

        /* "vcfutils.pyx":1326
 * 
 *                 # Does read have good quality across variant site
 *                 if not readQualIsGoodVariantPosition(pRead, varBAMMinPos, varBAMMaxPos, minBaseQual):             # <<<<<<<<<<<<<<
 *                     pStartBadRead += 1
 *                     continue
 */
        __pyx_t_11 = ((!(__pyx_f_8vcfutils_readQualIsGoodVariantPosition(__pyx_v_pRead, __pyx_v_varBAMMinPos, __pyx_v_varBAMMaxPos, __pyx_v_minBaseQual) != 0)) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":1327
 *                 # Does read have good quality across variant site
 *                 if not readQualIsGoodVariantPosition(pRead, varBAMMinPos, varBAMMaxPos, minBaseQual):
 *                     pStartBadRead += 1             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
          __pyx_v_pStartBadRead = (__pyx_v_pStartBadRead + 1);

          /* "vcfutils.pyx":1328
 *                 if not readQualIsGoodVariantPosition(pRead, varBAMMinPos, varBAMMaxPos, minBaseQual):
 *                     pStartBadRead += 1
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 TC_bad += 1
 */
          goto __pyx_L7_continue;
          goto __pyx_L10;
        }
        __pyx_L10:;

        /* "vcfutils.pyx":1330
 *                     continue
 * 
 *                 TC_bad += 1             # <<<<<<<<<<<<<<
 *                 RMSMQ += (pRead.mapq*pRead.mapq)
 *                 pStartBadRead += 1
 */
        __pyx_v_TC_bad = (__pyx_v_TC_bad + 1);

        /* "vcfutils.pyx":1331
 * 
 *                 TC_bad += 1
 *                 RMSMQ += (pRead.mapq*pRead.mapq)             # <<<<<<<<<<<<<<
 *                 pStartBadRead += 1
 * 
 */
        __pyx_v_RMSMQ = (__pyx_v_RMSMQ + (__pyx_v_pRead->mapq * __pyx_v_pRead->mapq));

        /* "vcfutils.pyx":1332
 *                 TC_bad += 1
 *                 RMSMQ += (pRead.mapq*pRead.mapq)
 *                 pStartBadRead += 1             # <<<<<<<<<<<<<<
 * 
 *             while pStartRead != pEndRead:
 */
        __pyx_v_pStartBadRead = (__pyx_v_pStartBadRead + 1);
        __pyx_L7_continue:;
      }

      /* "vcfutils.pyx":1334
 *                 pStartBadRead += 1
 * 
 *             while pStartRead != pEndRead:             # <<<<<<<<<<<<<<
 * 
 *                 pRead = pStartRead[0]
 */
      while (1) {
        __pyx_t_11 = ((__pyx_v_pStartRead != __pyx_v_pEndRead) != 0);
        if (!__pyx_t_11) break;

        /* "vcfutils.pyx":1336
 *             while pStartRead != pEndRead:
 * 
 *                 pRead = pStartRead[0]             # <<<<<<<<<<<<<<
 * 
 *                 # Does read overlap variant site
 */
        __pyx_v_pRead = (__pyx_v_pStartRead[0]);

        /* "vcfutils.pyx":1339
 * 
 *                 # Does read overlap variant site
 *                 if not readOverlapsVariant(pRead, varBAMMinPos, varBAMMaxPos):             # <<<<<<<<<<<<<<
 *                     pStartRead += 1
 *                     continue
 */
        __pyx_t_11 = ((!(__pyx_f_8vcfutils_readOverlapsVariant(__pyx_v_pRead, __pyx_v_varBAMMinPos, __pyx_v_varBAMMaxPos) != 0)) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":1340
 *                 # Does read overlap variant site
 *                 if not readOverlapsVariant(pRead, varBAMMinPos, varBAMMaxPos):
 *                     pStartRead += 1             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
          __pyx_v_pStartRead = (__pyx_v_pStartRead + 1);

          /* "vcfutils.pyx":1341
 *                 if not readOverlapsVariant(pRead, varBAMMinPos, varBAMMaxPos):
 *                     pStartRead += 1
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 # Does read have good quality across variant site
 */
          goto __pyx_L11_continue;
          goto __pyx_L13;
        }
        __pyx_L13:;

        /* "vcfutils.pyx":1344
 * 
 *                 # Does read have good quality across variant site
 *                 if not readQualIsGoodVariantPosition(pRead, varBAMMinPos, varBAMMaxPos, minBaseQual):             # <<<<<<<<<<<<<<
 *                     pStartRead += 1
 *                     continue
 */
        __pyx_t_11 = ((!(__pyx_f_8vcfutils_readQualIsGoodVariantPosition(__pyx_v_pRead, __pyx_v_varBAMMinPos, __pyx_v_varBAMMaxPos, __pyx_v_minBaseQual) != 0)) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":1345
 *                 # Does read have good quality across variant site
 *                 if not readQualIsGoodVariantPosition(pRead, varBAMMinPos, varBAMMaxPos, minBaseQual):
 *                     pStartRead += 1             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
          __pyx_v_pStartRead = (__pyx_v_pStartRead + 1);

          /* "vcfutils.pyx":1346
 *                 if not readQualIsGoodVariantPosition(pRead, varBAMMinPos, varBAMMaxPos, minBaseQual):
 *                     pStartRead += 1
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 nReadsThisSample += 1
 */
          goto __pyx_L11_continue;
          goto __pyx_L14;
        }
        __pyx_L14:;

        /* "vcfutils.pyx":1348
 *                     continue
 * 
 *                 nReadsThisSample += 1             # <<<<<<<<<<<<<<
 *                 TC += 1
 *                 RMSMQ += (pRead.mapq*pRead.mapq)
 */
        __pyx_v_nReadsThisSample = (__pyx_v_nReadsThisSample + 1);

        /* "vcfutils.pyx":1349
 * 
 *                 nReadsThisSample += 1
 *                 TC += 1             # <<<<<<<<<<<<<<
 *                 RMSMQ += (pRead.mapq*pRead.mapq)
 * 
 */
        __pyx_v_TC = (__pyx_v_TC + 1);

        /* "vcfutils.pyx":1350
 *                 nReadsThisSample += 1
 *                 TC += 1
 *                 RMSMQ += (pRead.mapq*pRead.mapq)             # <<<<<<<<<<<<<<
 * 
 *                 if varInGenotype:
 */
        __pyx_v_RMSMQ = (__pyx_v_RMSMQ + (__pyx_v_pRead->mapq * __pyx_v_pRead->mapq));

        /* "vcfutils.pyx":1352
 *                 RMSMQ += (pRead.mapq*pRead.mapq)
 * 
 *                 if varInGenotype:             # <<<<<<<<<<<<<<
 *                     TC_ab += 1
 * 
 */
        __pyx_t_11 = (__pyx_v_varInGenotype != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":1353
 * 
 *                 if varInGenotype:
 *                     TC_ab += 1             # <<<<<<<<<<<<<<
 * 
 *                     if Read_IsReverse(pRead):
 */
          __pyx_v_TC_ab = (__pyx_v_TC_ab + 1);

          /* "vcfutils.pyx":1355
 *                     TC_ab += 1
 * 
 *                     if Read_IsReverse(pRead):             # <<<<<<<<<<<<<<
 *                         TCR_sb += 1
 *                     else:
 */
          __pyx_t_11 = (__pyx_f_13htslibWrapper_Read_IsReverse(__pyx_v_pRead) != 0);
          if (__pyx_t_11) {

            /* "vcfutils.pyx":1356
 * 
 *                     if Read_IsReverse(pRead):
 *                         TCR_sb += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         TCF_sb += 1
 */
            __pyx_v_TCR_sb = (__pyx_v_TCR_sb + 1);
            goto __pyx_L16;
          }
          /*else*/ {

            /* "vcfutils.pyx":1358
 *                         TCR_sb += 1
 *                     else:
 *                         TCF_sb += 1             # <<<<<<<<<<<<<<
 * 
 *                 if Read_IsReverse(pRead):
 */
            __pyx_v_TCF_sb = (__pyx_v_TCF_sb + 1);
          }
          __pyx_L16:;
          goto __pyx_L15;
        }
        __pyx_L15:;

        /* "vcfutils.pyx":1360
 *                         TCF_sb += 1
 * 
 *                 if Read_IsReverse(pRead):             # <<<<<<<<<<<<<<
 *                     TCR += 1
 *                 else:
 */
        __pyx_t_11 = (__pyx_f_13htslibWrapper_Read_IsReverse(__pyx_v_pRead) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":1361
 * 
 *                 if Read_IsReverse(pRead):
 *                     TCR += 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     TCF += 1
 */
          __pyx_v_TCR = (__pyx_v_TCR + 1);
          goto __pyx_L17;
        }
        /*else*/ {

          /* "vcfutils.pyx":1363
 *                     TCR += 1
 *                 else:
 *                     TCF += 1             # <<<<<<<<<<<<<<
 * 
 *                 # Check if read supports variant.
 */
          __pyx_v_TCF = (__pyx_v_TCF + 1);
        }
        __pyx_L17:;

        /* "vcfutils.pyx":1366
 * 
 *                 # Check if read supports variant.
 *                 if variantSupportedByRead(pRead, varBAMMinPos, varBAMMaxPos, variant, countOnlyExactIndelMatches):             # <<<<<<<<<<<<<<
 * 
 *                     TR += 1
 */
        __pyx_t_11 = (__pyx_f_8vcfutils_variantSupportedByRead(__pyx_v_pRead, __pyx_v_varBAMMinPos, __pyx_v_varBAMMaxPos, __pyx_v_variant, __pyx_v_countOnlyExactIndelMatches) != 0);
        if (__pyx_t_11) {

          /* "vcfutils.pyx":1368
 *                 if variantSupportedByRead(pRead, varBAMMinPos, varBAMMaxPos, variant, countOnlyExactIndelMatches):
 * 
 *                     TR += 1             # <<<<<<<<<<<<<<
 *                     nVarReadsThisSample += 1
 * 
 */
          __pyx_v_TR = (__pyx_v_TR + 1);

          /* "vcfutils.pyx":1369
 * 
 *                     TR += 1
 *                     nVarReadsThisSample += 1             # <<<<<<<<<<<<<<
 * 
 *                     if varInGenotype:
 */
          __pyx_v_nVarReadsThisSample = (__pyx_v_nVarReadsThisSample + 1);

          /* "vcfutils.pyx":1371
 *                     nVarReadsThisSample += 1
 * 
 *                     if varInGenotype:             # <<<<<<<<<<<<<<
 *                         TR_ab += 1
 * 
 */
          __pyx_t_11 = (__pyx_v_varInGenotype != 0);
          if (__pyx_t_11) {

            /* "vcfutils.pyx":1372
 * 
 *                     if varInGenotype:
 *                         TR_ab += 1             # <<<<<<<<<<<<<<
 * 
 *                         if Read_IsReverse(pRead):
 */
            __pyx_v_TR_ab = (__pyx_v_TR_ab + 1);

            /* "vcfutils.pyx":1374
 *                         TR_ab += 1
 * 
 *                         if Read_IsReverse(pRead):             # <<<<<<<<<<<<<<
 *                             NR_sb += 1
 *                         else:
 */
            __pyx_t_11 = (__pyx_f_13htslibWrapper_Read_IsReverse(__pyx_v_pRead) != 0);
            if (__pyx_t_11) {

              /* "vcfutils.pyx":1375
 * 
 *                         if Read_IsReverse(pRead):
 *                             NR_sb += 1             # <<<<<<<<<<<<<<
 *                         else:
 *                             NF_sb += 1
 */
              __pyx_v_NR_sb = (__pyx_v_NR_sb + 1);
              goto __pyx_L20;
            }
            /*else*/ {

              /* "vcfutils.pyx":1377
 *                             NR_sb += 1
 *                         else:
 *                             NF_sb += 1             # <<<<<<<<<<<<<<
 * 
 *                     if Read_IsReverse(pRead):
 */
              __pyx_v_NF_sb = (__pyx_v_NF_sb + 1);
            }
            __pyx_L20:;
            goto __pyx_L19;
          }
          __pyx_L19:;

          /* "vcfutils.pyx":1379
 *                             NF_sb += 1
 * 
 *                     if Read_IsReverse(pRead):             # <<<<<<<<<<<<<<
 *                         NR += 1
 *                     else:
 */
          __pyx_t_11 = (__pyx_f_13htslibWrapper_Read_IsReverse(__pyx_v_pRead) != 0);
          if (__pyx_t_11) {

            /* "vcfutils.pyx":1380
 * 
 *                     if Read_IsReverse(pRead):
 *                         NR += 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         NF += 1
 */
            __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_NR, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_v_NR);
            __pyx_v_NR = __pyx_t_8;
            __pyx_t_8 = 0;
            goto __pyx_L21;
          }
          /*else*/ {

            /* "vcfutils.pyx":1382
 *                         NR += 1
 *                     else:
 *                         NF += 1             # <<<<<<<<<<<<<<
 * 
 *                     # Loop over window around variant position, and store smallest quality
 */
            __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_NF, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_v_NF);
            __pyx_v_NF = __pyx_t_8;
            __pyx_t_8 = 0;
          }
          __pyx_L21:;

          /* "vcfutils.pyx":1388
 * 
 *                     # Only compute MMLQ for samples which support the variant
 *                     if varInGenotype:             # <<<<<<<<<<<<<<
 *                         windowStart = max(0, varBAMMinPos - pRead.pos - (windowSize-1)//2)
 *                         windowEnd = min(pRead.rlen, varBAMMaxPos - pRead.pos + (windowSize-1)//2)
 */
          __pyx_t_11 = (__pyx_v_varInGenotype != 0);
          if (__pyx_t_11) {

            /* "vcfutils.pyx":1389
 *                     # Only compute MMLQ for samples which support the variant
 *                     if varInGenotype:
 *                         windowStart = max(0, varBAMMinPos - pRead.pos - (windowSize-1)//2)             # <<<<<<<<<<<<<<
 *                         windowEnd = min(pRead.rlen, varBAMMaxPos - pRead.pos + (windowSize-1)//2)
 *                         minBaseQualInWindow = 0
 */
            __pyx_t_13 = ((__pyx_v_varBAMMinPos - __pyx_v_pRead->pos) - ((__pyx_v_windowSize - 1) / 2));
            __pyx_t_14 = 0;
            if (((__pyx_t_13 > __pyx_t_14) != 0)) {
              __pyx_t_15 = __pyx_t_13;
            } else {
              __pyx_t_15 = __pyx_t_14;
            }
            __pyx_v_windowStart = __pyx_t_15;

            /* "vcfutils.pyx":1390
 *                     if varInGenotype:
 *                         windowStart = max(0, varBAMMinPos - pRead.pos - (windowSize-1)//2)
 *                         windowEnd = min(pRead.rlen, varBAMMaxPos - pRead.pos + (windowSize-1)//2)             # <<<<<<<<<<<<<<
 *                         minBaseQualInWindow = 0
 * 
 */
            __pyx_t_15 = ((__pyx_v_varBAMMaxPos - __pyx_v_pRead->pos) + ((__pyx_v_windowSize - 1) / 2));
            __pyx_t_16 = __pyx_v_pRead->rlen;
            if (((__pyx_t_15 < __pyx_t_16) != 0)) {
              __pyx_t_13 = __pyx_t_15;
            } else {
              __pyx_t_13 = __pyx_t_16;
            }
            __pyx_v_windowEnd = __pyx_t_13;

            /* "vcfutils.pyx":1391
 *                         windowStart = max(0, varBAMMinPos - pRead.pos - (windowSize-1)//2)
 *                         windowEnd = min(pRead.rlen, varBAMMaxPos - pRead.pos + (windowSize-1)//2)
 *                         minBaseQualInWindow = 0             # <<<<<<<<<<<<<<
 * 
 *                         for windowIndex in range(windowStart, windowEnd):
 */
            __pyx_v_minBaseQualInWindow = 0;

            /* "vcfutils.pyx":1393
 *                         minBaseQualInWindow = 0
 * 
 *                         for windowIndex in range(windowStart, windowEnd):             # <<<<<<<<<<<<<<
 *                             if windowIndex == windowStart:
 *                                 minBaseQualInWindow = pRead.qual[windowIndex]
 */
            __pyx_t_17 = __pyx_v_windowEnd;
            for (__pyx_t_18 = __pyx_v_windowStart; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
              __pyx_v_windowIndex = __pyx_t_18;

              /* "vcfutils.pyx":1394
 * 
 *                         for windowIndex in range(windowStart, windowEnd):
 *                             if windowIndex == windowStart:             # <<<<<<<<<<<<<<
 *                                 minBaseQualInWindow = pRead.qual[windowIndex]
 *                             else:
 */
              __pyx_t_11 = ((__pyx_v_windowIndex == __pyx_v_windowStart) != 0);
              if (__pyx_t_11) {

                /* "vcfutils.pyx":1395
 *                         for windowIndex in range(windowStart, windowEnd):
 *                             if windowIndex == windowStart:
 *                                 minBaseQualInWindow = pRead.qual[windowIndex]             # <<<<<<<<<<<<<<
 *                             else:
 *                                 minBaseQualInWindow = min(minBaseQualInWindow, pRead.qual[windowIndex])
 */
                __pyx_v_minBaseQualInWindow = (__pyx_v_pRead->qual[__pyx_v_windowIndex]);
                goto __pyx_L25;
              }
              /*else*/ {

                /* "vcfutils.pyx":1397
 *                                 minBaseQualInWindow = pRead.qual[windowIndex]
 *                             else:
 *                                 minBaseQualInWindow = min(minBaseQualInWindow, pRead.qual[windowIndex])             # <<<<<<<<<<<<<<
 * 
 *                         listOfMinBaseQuals.append(minBaseQualInWindow)
 */
                __pyx_t_19 = (__pyx_v_pRead->qual[__pyx_v_windowIndex]);
                __pyx_t_20 = __pyx_v_minBaseQualInWindow;
                if (((__pyx_t_19 < __pyx_t_20) != 0)) {
                  __pyx_t_21 = __pyx_t_19;
                } else {
                  __pyx_t_21 = __pyx_t_20;
                }
                __pyx_v_minBaseQualInWindow = __pyx_t_21;
              }
              __pyx_L25:;
            }

            /* "vcfutils.pyx":1399
 *                                 minBaseQualInWindow = min(minBaseQualInWindow, pRead.qual[windowIndex])
 * 
 *                         listOfMinBaseQuals.append(minBaseQualInWindow)             # <<<<<<<<<<<<<<
 * 
 *                     #logger.debug('minBaseQuals list %s' %(';'.join(map(str, listOfMinBaseQuals))))
 */
            __pyx_t_8 = PyInt_FromLong(__pyx_v_minBaseQualInWindow); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_listOfMinBaseQuals, __pyx_t_8); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L18;
        }
        __pyx_L18:;

        /* "vcfutils.pyx":1403
 *                     #logger.debug('minBaseQuals list %s' %(';'.join(map(str, listOfMinBaseQuals))))
 * 
 *                 pStartRead += 1             # <<<<<<<<<<<<<<
 * 
 *             nReadsPerSample.append(nReadsThisSample)
 */
        __pyx_v_pStartRead = (__pyx_v_pStartRead + 1);
        __pyx_L11_continue:;
      }

      /* "vcfutils.pyx":1405
 *                 pStartRead += 1
 * 
 *             nReadsPerSample.append(nReadsThisSample)             # <<<<<<<<<<<<<<
 *             nVarReadsPerSample.append(nVarReadsThisSample)
 * 
 */
      __pyx_t_8 = PyInt_FromLong(__pyx_v_nReadsThisSample); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_nReadsPerSample, __pyx_t_8); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "vcfutils.pyx":1406
 * 
 *             nReadsPerSample.append(nReadsThisSample)
 *             nVarReadsPerSample.append(nVarReadsThisSample)             # <<<<<<<<<<<<<<
 * 
 *         # Compute per-sample strand-bias
 */
      __pyx_t_8 = PyInt_FromLong(__pyx_v_nVarReadsThisSample); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_nVarReadsPerSample, __pyx_t_8); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "vcfutils.pyx":1409
 * 
 *         # Compute per-sample strand-bias
 *         INFO[variant]['ABPV'] = [round(computeAlleleBiasPValue(TC_ab, TR_ab), 2)]             # <<<<<<<<<<<<<<
 *         INFO[variant]['SbPval'] = [round(computeStrandBiasPValue(TCF_sb, TCR_sb, NF_sb, NR_sb), 2)]
 *         INFO[variant]['TR'] = [TR]
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_f_8vcfutils_computeAlleleBiasPValue(__pyx_v_TC_ab, __pyx_v_TR_ab)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __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 = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ABPV), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

    /* "vcfutils.pyx":1410
 *         # Compute per-sample strand-bias
 *         INFO[variant]['ABPV'] = [round(computeAlleleBiasPValue(TC_ab, TR_ab), 2)]
 *         INFO[variant]['SbPval'] = [round(computeStrandBiasPValue(TCF_sb, TCR_sb, NF_sb, NR_sb), 2)]             # <<<<<<<<<<<<<<
 *         INFO[variant]['TR'] = [TR]
 *         INFO[variant]['NF'] = [NF]
 */
    __pyx_t_8 = PyFloat_FromDouble(__pyx_f_8vcfutils_computeStrandBiasPValue(__pyx_v_TCF_sb, __pyx_v_TCR_sb, __pyx_v_NF_sb, __pyx_v_NR_sb)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __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 = 1410; __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(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    __pyx_t_8 = 0;
    __pyx_t_8 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyList_New(1); 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);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyObject_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__SbPval), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "vcfutils.pyx":1411
 *         INFO[variant]['ABPV'] = [round(computeAlleleBiasPValue(TC_ab, TR_ab), 2)]
 *         INFO[variant]['SbPval'] = [round(computeStrandBiasPValue(TCF_sb, TCR_sb, NF_sb, NR_sb), 2)]
 *         INFO[variant]['TR'] = [TR]             # <<<<<<<<<<<<<<
 *         INFO[variant]['NF'] = [NF]
 *         INFO[variant]['NR'] = [NR]
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_TR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__TR), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

    /* "vcfutils.pyx":1412
 *         INFO[variant]['SbPval'] = [round(computeStrandBiasPValue(TCF_sb, TCR_sb, NF_sb, NR_sb), 2)]
 *         INFO[variant]['TR'] = [TR]
 *         INFO[variant]['NF'] = [NF]             # <<<<<<<<<<<<<<
 *         INFO[variant]['NR'] = [NR]
 * 
 */
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_NF);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_NF);
    __Pyx_GIVEREF(__pyx_v_NF);
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__NF), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

    /* "vcfutils.pyx":1413
 *         INFO[variant]['TR'] = [TR]
 *         INFO[variant]['NF'] = [NF]
 *         INFO[variant]['NR'] = [NR]             # <<<<<<<<<<<<<<
 * 
 *         if TR > 0:
 */
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_NR);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_NR);
    __Pyx_GIVEREF(__pyx_v_NR);
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__NR), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

    /* "vcfutils.pyx":1415
 *         INFO[variant]['NR'] = [NR]
 * 
 *         if TR > 0:             # <<<<<<<<<<<<<<
 *             qual = float(INFO[variant]['PP'][0])
 *             if qual > 2500:
 */
    __pyx_t_11 = ((__pyx_v_TR > 0) != 0);
    if (__pyx_t_11) {

      /* "vcfutils.pyx":1416
 * 
 *         if TR > 0:
 *             qual = float(INFO[variant]['PP'][0])             # <<<<<<<<<<<<<<
 *             if qual > 2500:
 *                 INFO[variant]['QD'] = [options.qdThreshold + 10]
 */
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = PyObject_GetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__PP)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_23 = __Pyx_PyObject_AsDouble(__pyx_t_8); if (unlikely(__pyx_t_23 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_qual = __pyx_t_23;

      /* "vcfutils.pyx":1417
 *         if TR > 0:
 *             qual = float(INFO[variant]['PP'][0])
 *             if qual > 2500:             # <<<<<<<<<<<<<<
 *                 INFO[variant]['QD'] = [options.qdThreshold + 10]
 *             else:
 */
      __pyx_t_11 = ((__pyx_v_qual > 2500.0) != 0);
      if (__pyx_t_11) {

        /* "vcfutils.pyx":1418
 *             qual = float(INFO[variant]['PP'][0])
 *             if qual > 2500:
 *                 INFO[variant]['QD'] = [options.qdThreshold + 10]             # <<<<<<<<<<<<<<
 *             else:
 *                 INFO[variant]['QD'] = [(qual + (-10*log10(variant.calculatePrior(refFile))) )/TR]
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__qdThreshold); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_int_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__QD), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
        goto __pyx_L27;
      }
      /*else*/ {

        /* "vcfutils.pyx":1420
 *                 INFO[variant]['QD'] = [options.qdThreshold + 10]
 *             else:
 *                 INFO[variant]['QD'] = [(qual + (-10*log10(variant.calculatePrior(refFile))) )/TR]             # <<<<<<<<<<<<<<
 *                 #logger.debug("Old QD = %s. new QD = %s. TR = %s. Qual = %s. Prior = %s. Var = %s" %(qual/TR, (qual + (-10*log10(variant.calculatePrior(refFile))))/TR, TR, qual, variant.calculatePrior(refFile), variant))
 *         else:
 */
        __pyx_t_8 = PyFloat_FromDouble(((__pyx_v_qual + (-10.0 * log10(((struct __pyx_vtabstruct_7variant_Variant *)__pyx_v_variant->__pyx_vtab)->calculatePrior(__pyx_v_variant, __pyx_v_refFile)))) / __pyx_v_TR)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_t_8 = 0;
        if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        if (PyObject_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__QD), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      }
      __pyx_L27:;
      goto __pyx_L26;
    }
    /*else*/ {

      /* "vcfutils.pyx":1424
 *         else:
 *             #logger.warning("Something is wrong. TR == 0 for variant %s" %(variant))
 *             INFO[variant]['QD'] = [0]             # <<<<<<<<<<<<<<
 * 
 *         INFO[variant]['BRF'] = [round(nBadReads/<double>(nGoodReads+nBadReads), 2)]
 */
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (PyObject_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__QD), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    }
    __pyx_L26:;

    /* "vcfutils.pyx":1426
 *             INFO[variant]['QD'] = [0]
 * 
 *         INFO[variant]['BRF'] = [round(nBadReads/<double>(nGoodReads+nBadReads), 2)]             # <<<<<<<<<<<<<<
 *         INFO[variant]['TC'] = [TC]
 *         INFO[variant]['TCR'] = [TCR]
 */
    __pyx_t_3 = PyFloat_FromDouble((__pyx_v_nBadReads / ((double)(__pyx_v_nGoodReads + __pyx_v_nBadReads)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __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 = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__BRF), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

    /* "vcfutils.pyx":1427
 * 
 *         INFO[variant]['BRF'] = [round(nBadReads/<double>(nGoodReads+nBadReads), 2)]
 *         INFO[variant]['TC'] = [TC]             # <<<<<<<<<<<<<<
 *         INFO[variant]['TCR'] = [TCR]
 *         INFO[variant]['TCF'] = [TCF]
 */
    __pyx_t_8 = PyInt_FromLong(__pyx_v_TC); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyObject_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__TC), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "vcfutils.pyx":1428
 *         INFO[variant]['BRF'] = [round(nBadReads/<double>(nGoodReads+nBadReads), 2)]
 *         INFO[variant]['TC'] = [TC]
 *         INFO[variant]['TCR'] = [TCR]             # <<<<<<<<<<<<<<
 *         INFO[variant]['TCF'] = [TCF]
 * 
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_TCR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__TCR), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;

    /* "vcfutils.pyx":1429
 *         INFO[variant]['TC'] = [TC]
 *         INFO[variant]['TCR'] = [TCR]
 *         INFO[variant]['TCF'] = [TCF]             # <<<<<<<<<<<<<<
 * 
 *         if TC + TC_bad > 0 and RMSMQ > 0:
 */
    __pyx_t_8 = PyInt_FromLong(__pyx_v_TCF); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyObject_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__TCF), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "vcfutils.pyx":1431
 *         INFO[variant]['TCF'] = [TCF]
 * 
 *         if TC + TC_bad > 0 and RMSMQ > 0:             # <<<<<<<<<<<<<<
 *             INFO[variant]['MQ'] = [round(sqrt(RMSMQ/(TC+TC_bad)), 2)]
 *         else:
 */
    __pyx_t_11 = (((__pyx_v_TC + __pyx_v_TC_bad) > 0) != 0);
    if (__pyx_t_11) {
      __pyx_t_9 = ((__pyx_v_RMSMQ > 0.0) != 0);
      __pyx_t_10 = __pyx_t_9;
    } else {
      __pyx_t_10 = __pyx_t_11;
    }
    if (__pyx_t_10) {

      /* "vcfutils.pyx":1432
 * 
 *         if TC + TC_bad > 0 and RMSMQ > 0:
 *             INFO[variant]['MQ'] = [round(sqrt(RMSMQ/(TC+TC_bad)), 2)]             # <<<<<<<<<<<<<<
 *         else:
 *             INFO[variant]['MQ'] = [0]
 */
      __pyx_t_3 = PyFloat_FromDouble(sqrt((__pyx_v_RMSMQ / (__pyx_v_TC + __pyx_v_TC_bad)))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __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 = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_int_2);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_2);
      __Pyx_GIVEREF(__pyx_int_2);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_builtin_round, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__MQ), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
      goto __pyx_L28;
    }
    /*else*/ {

      /* "vcfutils.pyx":1434
 *             INFO[variant]['MQ'] = [round(sqrt(RMSMQ/(TC+TC_bad)), 2)]
 *         else:
 *             INFO[variant]['MQ'] = [0]             # <<<<<<<<<<<<<<
 * 
 *         INFO[variant]['nReadsPerSample'] = nReadsPerSample
 */
      __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_8, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__MQ), ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
    }
    __pyx_L28:;

    /* "vcfutils.pyx":1436
 *             INFO[variant]['MQ'] = [0]
 * 
 *         INFO[variant]['nReadsPerSample'] = nReadsPerSample             # <<<<<<<<<<<<<<
 *         INFO[variant]['nVarReadsPerSample'] = nVarReadsPerSample
 *         INFO[variant]['FR'][0] = "%1.4f" %(INFO[variant]['FR'][0])
 */
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyObject_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__nReadsPerSample), ((PyObject *)__pyx_v_nReadsPerSample)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "vcfutils.pyx":1437
 * 
 *         INFO[variant]['nReadsPerSample'] = nReadsPerSample
 *         INFO[variant]['nVarReadsPerSample'] = nVarReadsPerSample             # <<<<<<<<<<<<<<
 *         INFO[variant]['FR'][0] = "%1.4f" %(INFO[variant]['FR'][0])
 *         INFO[variant]['HapScore'] = [HapScore]
 */
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (PyObject_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__nVarReadsPerSample), ((PyObject *)__pyx_v_nVarReadsPerSample)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "vcfutils.pyx":1438
 *         INFO[variant]['nReadsPerSample'] = nReadsPerSample
 *         INFO[variant]['nVarReadsPerSample'] = nVarReadsPerSample
 *         INFO[variant]['FR'][0] = "%1.4f" %(INFO[variant]['FR'][0])             # <<<<<<<<<<<<<<
 *         INFO[variant]['HapScore'] = [HapScore]
 * 
 */
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PyObject_GetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__FR)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_24 = PyObject_GetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__FR)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_24);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (__Pyx_SetItemInt(__pyx_t_24, 0, ((PyObject *)__pyx_t_3), sizeof(long), PyInt_FromLong, 0, 0, 0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "vcfutils.pyx":1439
 *         INFO[variant]['nVarReadsPerSample'] = nVarReadsPerSample
 *         INFO[variant]['FR'][0] = "%1.4f" %(INFO[variant]['FR'][0])
 *         INFO[variant]['HapScore'] = [HapScore]             # <<<<<<<<<<<<<<
 * 
 *         listOfMinBaseQuals.sort()
 */
    __pyx_t_3 = PyInt_FromLong(__pyx_v_HapScore); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_24 = PyList_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_24);
    PyList_SET_ITEM(__pyx_t_24, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (PyObject_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__HapScore), ((PyObject *)__pyx_t_24)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;

    /* "vcfutils.pyx":1441
 *         INFO[variant]['HapScore'] = [HapScore]
 * 
 *         listOfMinBaseQuals.sort()             # <<<<<<<<<<<<<<
 * 
 *         if len(listOfMinBaseQuals) > 0:
 */
    __pyx_t_22 = PyList_Sort(((PyObject *)__pyx_v_listOfMinBaseQuals)); if (unlikely(__pyx_t_22 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "vcfutils.pyx":1443
 *         listOfMinBaseQuals.sort()
 * 
 *         if len(listOfMinBaseQuals) > 0:             # <<<<<<<<<<<<<<
 *             INFO[variant]['MMLQ'] = [listOfMinBaseQuals[ len(listOfMinBaseQuals) // 2 ]]
 *         else:
 */
    __pyx_t_7 = PyList_GET_SIZE(((PyObject *)__pyx_v_listOfMinBaseQuals)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = ((__pyx_t_7 > 0) != 0);
    if (__pyx_t_10) {

      /* "vcfutils.pyx":1444
 * 
 *         if len(listOfMinBaseQuals) > 0:
 *             INFO[variant]['MMLQ'] = [listOfMinBaseQuals[ len(listOfMinBaseQuals) // 2 ]]             # <<<<<<<<<<<<<<
 *         else:
 *             INFO[variant]['MMLQ'] = [100]
 */
      __pyx_t_7 = PyList_GET_SIZE(((PyObject *)__pyx_v_listOfMinBaseQuals)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_25 = (__pyx_t_7 / 2);
      __pyx_t_24 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_listOfMinBaseQuals), __pyx_t_25, sizeof(Py_ssize_t), PyInt_FromSsize_t, 1, 1, 0); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_24);
      __Pyx_GIVEREF(__pyx_t_24);
      __pyx_t_24 = 0;
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_24 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      if (PyObject_SetItem(__pyx_t_24, ((PyObject *)__pyx_n_s__MMLQ), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      goto __pyx_L29;
    }
    /*else*/ {

      /* "vcfutils.pyx":1446
 *             INFO[variant]['MMLQ'] = [listOfMinBaseQuals[ len(listOfMinBaseQuals) // 2 ]]
 *         else:
 *             INFO[variant]['MMLQ'] = [100]             # <<<<<<<<<<<<<<
 * 
 *         INFO[variant]["Source"] = []
 */
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_int_100);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_100);
      __Pyx_GIVEREF(__pyx_int_100);
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_24 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      if (PyObject_SetItem(__pyx_t_24, ((PyObject *)__pyx_n_s__MMLQ), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    }
    __pyx_L29:;

    /* "vcfutils.pyx":1448
 *             INFO[variant]['MMLQ'] = [100]
 * 
 *         INFO[variant]["Source"] = []             # <<<<<<<<<<<<<<
 * 
 *         if variant.varSource & PLATYPUS_VAR:
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_24 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_24);
    if (PyObject_SetItem(__pyx_t_24, ((PyObject *)__pyx_n_s__Source), ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

    /* "vcfutils.pyx":1450
 *         INFO[variant]["Source"] = []
 * 
 *         if variant.varSource & PLATYPUS_VAR:             # <<<<<<<<<<<<<<
 *             INFO[variant]["Source"].append("Platypus")
 * 
 */
    __pyx_t_10 = ((__pyx_v_variant->varSource & __pyx_v_7variant_PLATYPUS_VAR) != 0);
    if (__pyx_t_10) {

      /* "vcfutils.pyx":1451
 * 
 *         if variant.varSource & PLATYPUS_VAR:
 *             INFO[variant]["Source"].append("Platypus")             # <<<<<<<<<<<<<<
 * 
 *         if variant.varSource & ASSEMBLER_VAR:
 */
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_24 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__Source)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_24, ((PyObject *)__pyx_n_s__Platypus)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L30;
    }
    __pyx_L30:;

    /* "vcfutils.pyx":1453
 *             INFO[variant]["Source"].append("Platypus")
 * 
 *         if variant.varSource & ASSEMBLER_VAR:             # <<<<<<<<<<<<<<
 *             INFO[variant]["Source"].append("Assembler")
 * 
 */
    __pyx_t_10 = ((__pyx_v_variant->varSource & __pyx_v_7variant_ASSEMBLER_VAR) != 0);
    if (__pyx_t_10) {

      /* "vcfutils.pyx":1454
 * 
 *         if variant.varSource & ASSEMBLER_VAR:
 *             INFO[variant]["Source"].append("Assembler")             # <<<<<<<<<<<<<<
 * 
 *         if variant.varSource & FILE_VAR:
 */
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_24 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__Source)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_24, ((PyObject *)__pyx_n_s__Assembler)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L31;
    }
    __pyx_L31:;

    /* "vcfutils.pyx":1456
 *             INFO[variant]["Source"].append("Assembler")
 * 
 *         if variant.varSource & FILE_VAR:             # <<<<<<<<<<<<<<
 *             INFO[variant]["Source"].append("File")
 * 
 */
    __pyx_t_10 = ((__pyx_v_variant->varSource & __pyx_v_7variant_FILE_VAR) != 0);
    if (__pyx_t_10) {

      /* "vcfutils.pyx":1457
 * 
 *         if variant.varSource & FILE_VAR:
 *             INFO[variant]["Source"].append("File")             # <<<<<<<<<<<<<<
 * 
 *     return INFO
 */
      if (unlikely(((PyObject *)__pyx_v_INFO) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_INFO), ((PyObject *)__pyx_v_variant)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_24 = PyObject_GetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__Source)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_24);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_24, ((PyObject *)__pyx_n_s__File)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L32;
    }
    __pyx_L32:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vcfutils.pyx":1459
 *             INFO[variant]["Source"].append("File")
 * 
 *     return INFO             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_INFO));
  __pyx_r = __pyx_v_INFO;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("vcfutils.vcfINFO", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_variant);
  __Pyx_XDECREF(__pyx_v_nReadsPerSample);
  __Pyx_XDECREF(__pyx_v_nVarReadsPerSample);
  __Pyx_XDECREF(__pyx_v_listOfMinBaseQuals);
  __Pyx_XDECREF((PyObject *)__pyx_v_readBuffer);
  __Pyx_XDECREF(__pyx_v_INFO);
  __Pyx_XDECREF(__pyx_v_sortedVars);
  __Pyx_XDECREF(__pyx_v_NR);
  __Pyx_XDECREF(__pyx_v_NF);
  __Pyx_XDECREF(__pyx_v_genotype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":1463
 * ###################################################################################################
 * 
 * cdef double andersonDarlingTest(list readPositions):             # <<<<<<<<<<<<<<
 *     """
 *     Compute the Anderson-Darling test statistic, to see if the positions
 */

static double __pyx_f_8vcfutils_andersonDarlingTest(PyObject *__pyx_v_readPositions) {
  PyObject *__pyx_v_nReads = NULL;
  PyObject *__pyx_v_Asquared = NULL;
  PyObject *__pyx_v_i = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  double __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("andersonDarlingTest", 0);

  /* "vcfutils.pyx":1469
 *     """
 *     # Sort in ascending order.
 *     readPositions.sort()             # <<<<<<<<<<<<<<
 *     nReads = len(readPositions)
 *     Asquared = -nReads
 */
  if (unlikely(((PyObject *)__pyx_v_readPositions) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "sort");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyList_Sort(((PyObject *)__pyx_v_readPositions)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "vcfutils.pyx":1470
 *     # Sort in ascending order.
 *     readPositions.sort()
 *     nReads = len(readPositions)             # <<<<<<<<<<<<<<
 *     Asquared = -nReads
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_readPositions) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_readPositions)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_nReads = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "vcfutils.pyx":1471
 *     readPositions.sort()
 *     nReads = len(readPositions)
 *     Asquared = -nReads             # <<<<<<<<<<<<<<
 * 
 *     for i in xrange(nReads):
 */
  __pyx_t_3 = PyNumber_Negative(__pyx_v_nReads); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_Asquared = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "vcfutils.pyx":1473
 *     Asquared = -nReads
 * 
 *     for i in xrange(nReads):             # <<<<<<<<<<<<<<
 *         Asquared -= (1.0/nReads)*( (2.0*i - 1.0)*log(readPositions[i]) + (2.0*nReads + 1.0  - 2.0*i)*log(1.0 - readPositions[i]) )
 * 
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_nReads);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_nReads);
  __Pyx_GIVEREF(__pyx_v_nReads);
  __pyx_t_4 = PyObject_Call(__pyx_builtin_xrange, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __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_4); __pyx_t_4 = 0;
  for (;;) {
    if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "vcfutils.pyx":1474
 * 
 *     for i in xrange(nReads):
 *         Asquared -= (1.0/nReads)*( (2.0*i - 1.0)*log(readPositions[i]) + (2.0*nReads + 1.0  - 2.0*i)*log(1.0 - readPositions[i]) )             # <<<<<<<<<<<<<<
 * 
 *     return Asquared
 */
    __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_nReads); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyNumber_Subtract(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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_4); __pyx_t_4 = 0;
    if (unlikely(((PyObject *)__pyx_v_readPositions) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_readPositions), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyFloat_FromDouble(log(__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyNumber_Multiply(__pyx_t_4, __pyx_v_nReads); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyNumber_Multiply(__pyx_t_4, __pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (unlikely(((PyObject *)__pyx_v_readPositions) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = PyObject_GetItem(((PyObject *)__pyx_v_readPositions), __pyx_v_i); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = PyNumber_Subtract(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyFloat_FromDouble(log(__pyx_t_9)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyNumber_Add(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Multiply(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyNumber_InPlaceSubtract(__pyx_v_Asquared, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_v_Asquared);
    __pyx_v_Asquared = __pyx_t_11;
    __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vcfutils.pyx":1476
 *         Asquared -= (1.0/nReads)*( (2.0*i - 1.0)*log(readPositions[i]) + (2.0*nReads + 1.0  - 2.0*i)*log(1.0 - readPositions[i]) )
 * 
 *     return Asquared             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_Asquared); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_9;
  goto __pyx_L0;

  __pyx_r = 0;
  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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_WriteUnraisable("vcfutils.andersonDarlingTest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_nReads);
  __Pyx_XDECREF(__pyx_v_Asquared);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":1480
 * ###################################################################################################
 * 
 * cdef double computeSCValue(sequence):             # <<<<<<<<<<<<<<
 *     """
 *     Compute the value for Platypus' SC filter. This is simply the
 */

static double __pyx_f_8vcfutils_computeSCValue(PyObject *__pyx_v_sequence) {
  PyObject *__pyx_v_counter = NULL;
  PyObject *__pyx_v_char = NULL;
  int __pyx_v_lenSeq;
  int __pyx_v_nCharsFromTop2Bases;
  double __pyx_v_SC;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_base = NULL;
  PyObject *__pyx_v_nChars = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("computeSCValue", 0);

  /* "vcfutils.pyx":1487
 *     value of 1.0, as would a homopolymer.
 *     """
 *     counter = {}             # <<<<<<<<<<<<<<
 * 
 *     for char in sequence:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_counter = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1489
 *     counter = {}
 * 
 *     for char in sequence:             # <<<<<<<<<<<<<<
 *         if char not in counter:
 *             counter[char] = 1
 */
  if (PyList_CheckExact(__pyx_v_sequence) || PyTuple_CheckExact(__pyx_v_sequence)) {
    __pyx_t_1 = __pyx_v_sequence; __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_sequence); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __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 = 1489; __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 = 1489; __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 = 1489; __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 = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_char);
    __pyx_v_char = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "vcfutils.pyx":1490
 * 
 *     for char in sequence:
 *         if char not in counter:             # <<<<<<<<<<<<<<
 *             counter[char] = 1
 *         else:
 */
    __pyx_t_5 = (__Pyx_PyDict_Contains(__pyx_v_char, ((PyObject *)__pyx_v_counter), Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "vcfutils.pyx":1491
 *     for char in sequence:
 *         if char not in counter:
 *             counter[char] = 1             # <<<<<<<<<<<<<<
 *         else:
 *             counter[char] += 1
 */
      if (PyDict_SetItem(((PyObject *)__pyx_v_counter), __pyx_v_char, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    /*else*/ {

      /* "vcfutils.pyx":1493
 *             counter[char] = 1
 *         else:
 *             counter[char] += 1             # <<<<<<<<<<<<<<
 * 
 *     cdef int lenSeq = len(sequence)
 */
      __Pyx_INCREF(__pyx_v_char);
      __pyx_t_4 = __pyx_v_char;
      __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_counter), __pyx_t_4); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (PyDict_SetItem(((PyObject *)__pyx_v_counter), __pyx_t_4, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vcfutils.pyx":1495
 *             counter[char] += 1
 * 
 *     cdef int lenSeq = len(sequence)             # <<<<<<<<<<<<<<
 *     cdef int nCharsFromTop2Bases = sum([x[0] for x in sorted( [(nChars,base) for base,nChars in counter.iteritems()], reverse=True)[0:2] ])
 *     cdef double SC = <double>(nCharsFromTop2Bases)/<double>(lenSeq)
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_sequence); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_lenSeq = __pyx_t_2;

  /* "vcfutils.pyx":1496
 * 
 *     cdef int lenSeq = len(sequence)
 *     cdef int nCharsFromTop2Bases = sum([x[0] for x in sorted( [(nChars,base) for base,nChars in counter.iteritems()], reverse=True)[0:2] ])             # <<<<<<<<<<<<<<
 *     cdef double SC = <double>(nCharsFromTop2Bases)/<double>(lenSeq)
 *     return SC
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_dict_iterator(((PyObject *)__pyx_v_counter), 1, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __pyx_t_8 = __pyx_t_7;
  __pyx_t_7 = 0;
  while (1) {
    __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_9, &__pyx_t_2, &__pyx_t_7, &__pyx_t_11, NULL, __pyx_t_10);
    if (unlikely(__pyx_t_12 == 0)) break;
    if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_XDECREF(__pyx_v_base);
    __pyx_v_base = __pyx_t_7;
    __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_nChars);
    __pyx_v_nChars = __pyx_t_11;
    __pyx_t_11 = 0;
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_v_nChars);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_nChars);
    __Pyx_GIVEREF(__pyx_v_nChars);
    __Pyx_INCREF(__pyx_v_base);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_base);
    __Pyx_GIVEREF(__pyx_v_base);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  }
  __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 = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  __pyx_t_4 = 0;
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__reverse), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_8), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_11, 0, 2, NULL, NULL, &__pyx_k_slice_40, 1, 1, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_11 = __pyx_t_4; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_3 = Py_TYPE(__pyx_t_11)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_11)) {
      if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_11)) {
      if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_11);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF(__pyx_v_x);
    __pyx_v_x = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_builtin_sum, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nCharsFromTop2Bases = __pyx_t_10;

  /* "vcfutils.pyx":1497
 *     cdef int lenSeq = len(sequence)
 *     cdef int nCharsFromTop2Bases = sum([x[0] for x in sorted( [(nChars,base) for base,nChars in counter.iteritems()], reverse=True)[0:2] ])
 *     cdef double SC = <double>(nCharsFromTop2Bases)/<double>(lenSeq)             # <<<<<<<<<<<<<<
 *     return SC
 * 
 */
  __pyx_v_SC = (((double)__pyx_v_nCharsFromTop2Bases) / ((double)__pyx_v_lenSeq));

  /* "vcfutils.pyx":1498
 *     cdef int nCharsFromTop2Bases = sum([x[0] for x in sorted( [(nChars,base) for base,nChars in counter.iteritems()], reverse=True)[0:2] ])
 *     cdef double SC = <double>(nCharsFromTop2Bases)/<double>(lenSeq)
 *     return SC             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __pyx_r = __pyx_v_SC;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __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_11);
  __Pyx_WriteUnraisable("vcfutils.computeSCValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_counter);
  __Pyx_XDECREF(__pyx_v_char);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_XDECREF(__pyx_v_nChars);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "vcfutils.pyx":1502
 * ###################################################################################################
 * 
 * cdef dict vcfFILTER(list genotypeCalls, list haplotypes, dict vcfInfo, dict varsByPos, options):             # <<<<<<<<<<<<<<
 *     """
 *     FILTER field for vcf output, two level dictionary of variant - info field - value
 */

static PyObject *__pyx_f_8vcfutils_vcfFILTER(CYTHON_UNUSED PyObject *__pyx_v_genotypeCalls, CYTHON_UNUSED PyObject *__pyx_v_haplotypes, PyObject *__pyx_v_vcfInfo, PyObject *__pyx_v_varsByPos, PyObject *__pyx_v_options) {
  struct __pyx_obj_7variant_Variant *__pyx_v_v = 0;
  PyObject *__pyx_v_FILTER = 0;
  PyObject *__pyx_v_infoThisVar = 0;
  int __pyx_v_nVars;
  int __pyx_v_nVarsQD;
  int __pyx_v_nVarsHapScore;
  int __pyx_v_nVarsSB;
  int __pyx_v_nVarsAB;
  int __pyx_v_nVarsRMSMQ;
  CYTHON_UNUSED int __pyx_v_totalVarReads;
  int __pyx_v_hapScore;
  int __pyx_v_totalReads;
  CYTHON_UNUSED int __pyx_v_totalFwdReads;
  CYTHON_UNUSED int __pyx_v_totalRevReads;
  int __pyx_v_nVarsFailingMMLQFilter;
  int __pyx_v_medMinQualBases;
  double __pyx_v_abPVal;
  double __pyx_v_sbPVal;
  double __pyx_v_BRF;
  double __pyx_v_RMSMQ;
  double __pyx_v_QD;
  int __pyx_v_bestQual;
  int __pyx_v_thisQual;
  int __pyx_v_badReadsThreshold;
  double __pyx_v_abThreshold;
  double __pyx_v_sbThreshold;
  double __pyx_v_rmsmqThreshold;
  double __pyx_v_filteredReadsFrac;
  double __pyx_v_qdThreshold;
  double __pyx_v_hapScoreThreshold;
  double __pyx_v_scThreshold;
  int __pyx_v_failsSCFilter;
  CYTHON_UNUSED PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_varsAtPos = NULL;
  PyObject *__pyx_v_sequence = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_totalForwardVarReads = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_totalReverseVarReads = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  double __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vcfFILTER", 0);

  /* "vcfutils.pyx":1507
 *     """
 *     cdef Variant v
 *     cdef dict FILTER = {}             # <<<<<<<<<<<<<<
 *     cdef dict hapFILTER
 *     cdef dict infoThisVar
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_FILTER = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "vcfutils.pyx":1510
 *     cdef dict hapFILTER
 *     cdef dict infoThisVar
 *     cdef int nVars = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarsQD = 0
 *     cdef int nVarsHapScore = 0
 */
  __pyx_v_nVars = 0;

  /* "vcfutils.pyx":1511
 *     cdef dict infoThisVar
 *     cdef int nVars = 0
 *     cdef int nVarsQD = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarsHapScore = 0
 *     cdef int nVarsSB = 0
 */
  __pyx_v_nVarsQD = 0;

  /* "vcfutils.pyx":1512
 *     cdef int nVars = 0
 *     cdef int nVarsQD = 0
 *     cdef int nVarsHapScore = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarsSB = 0
 *     cdef int nVarsAB = 0
 */
  __pyx_v_nVarsHapScore = 0;

  /* "vcfutils.pyx":1513
 *     cdef int nVarsQD = 0
 *     cdef int nVarsHapScore = 0
 *     cdef int nVarsSB = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarsAB = 0
 *     cdef int nVarsRMSMQ = 0
 */
  __pyx_v_nVarsSB = 0;

  /* "vcfutils.pyx":1514
 *     cdef int nVarsHapScore = 0
 *     cdef int nVarsSB = 0
 *     cdef int nVarsAB = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarsRMSMQ = 0
 *     cdef int totalVarReads = 0
 */
  __pyx_v_nVarsAB = 0;

  /* "vcfutils.pyx":1515
 *     cdef int nVarsSB = 0
 *     cdef int nVarsAB = 0
 *     cdef int nVarsRMSMQ = 0             # <<<<<<<<<<<<<<
 *     cdef int totalVarReads = 0
 *     cdef int hapScore = 0
 */
  __pyx_v_nVarsRMSMQ = 0;

  /* "vcfutils.pyx":1516
 *     cdef int nVarsAB = 0
 *     cdef int nVarsRMSMQ = 0
 *     cdef int totalVarReads = 0             # <<<<<<<<<<<<<<
 *     cdef int hapScore = 0
 *     cdef int totalReads = 0
 */
  __pyx_v_totalVarReads = 0;

  /* "vcfutils.pyx":1517
 *     cdef int nVarsRMSMQ = 0
 *     cdef int totalVarReads = 0
 *     cdef int hapScore = 0             # <<<<<<<<<<<<<<
 *     cdef int totalReads = 0
 *     cdef int totalFwdReads = 0
 */
  __pyx_v_hapScore = 0;

  /* "vcfutils.pyx":1518
 *     cdef int totalVarReads = 0
 *     cdef int hapScore = 0
 *     cdef int totalReads = 0             # <<<<<<<<<<<<<<
 *     cdef int totalFwdReads = 0
 *     cdef int totalRevReads = 0
 */
  __pyx_v_totalReads = 0;

  /* "vcfutils.pyx":1519
 *     cdef int hapScore = 0
 *     cdef int totalReads = 0
 *     cdef int totalFwdReads = 0             # <<<<<<<<<<<<<<
 *     cdef int totalRevReads = 0
 *     cdef int nVarsFailingMMLQFilter = 0
 */
  __pyx_v_totalFwdReads = 0;

  /* "vcfutils.pyx":1520
 *     cdef int totalReads = 0
 *     cdef int totalFwdReads = 0
 *     cdef int totalRevReads = 0             # <<<<<<<<<<<<<<
 *     cdef int nVarsFailingMMLQFilter = 0
 *     cdef int medMinQualBases = 0
 */
  __pyx_v_totalRevReads = 0;

  /* "vcfutils.pyx":1521
 *     cdef int totalFwdReads = 0
 *     cdef int totalRevReads = 0
 *     cdef int nVarsFailingMMLQFilter = 0             # <<<<<<<<<<<<<<
 *     cdef int medMinQualBases = 0
 *     cdef double abPVal = 0.0
 */
  __pyx_v_nVarsFailingMMLQFilter = 0;

  /* "vcfutils.pyx":1522
 *     cdef int totalRevReads = 0
 *     cdef int nVarsFailingMMLQFilter = 0
 *     cdef int medMinQualBases = 0             # <<<<<<<<<<<<<<
 *     cdef double abPVal = 0.0
 *     cdef double sbPVal = 0.0
 */
  __pyx_v_medMinQualBases = 0;

  /* "vcfutils.pyx":1523
 *     cdef int nVarsFailingMMLQFilter = 0
 *     cdef int medMinQualBases = 0
 *     cdef double abPVal = 0.0             # <<<<<<<<<<<<<<
 *     cdef double sbPVal = 0.0
 *     cdef double BRF = 0.0
 */
  __pyx_v_abPVal = 0.0;

  /* "vcfutils.pyx":1524
 *     cdef int medMinQualBases = 0
 *     cdef double abPVal = 0.0
 *     cdef double sbPVal = 0.0             # <<<<<<<<<<<<<<
 *     cdef double BRF = 0.0
 *     cdef double RMSMQ = 0.0
 */
  __pyx_v_sbPVal = 0.0;

  /* "vcfutils.pyx":1525
 *     cdef double abPVal = 0.0
 *     cdef double sbPVal = 0.0
 *     cdef double BRF = 0.0             # <<<<<<<<<<<<<<
 *     cdef double RMSMQ = 0.0
 *     cdef double QD = 0.0
 */
  __pyx_v_BRF = 0.0;

  /* "vcfutils.pyx":1526
 *     cdef double sbPVal = 0.0
 *     cdef double BRF = 0.0
 *     cdef double RMSMQ = 0.0             # <<<<<<<<<<<<<<
 *     cdef double QD = 0.0
 *     cdef int bestQual = 0
 */
  __pyx_v_RMSMQ = 0.0;

  /* "vcfutils.pyx":1527
 *     cdef double BRF = 0.0
 *     cdef double RMSMQ = 0.0
 *     cdef double QD = 0.0             # <<<<<<<<<<<<<<
 *     cdef int bestQual = 0
 *     cdef int thisQual = 0
 */
  __pyx_v_QD = 0.0;

  /* "vcfutils.pyx":1528
 *     cdef double RMSMQ = 0.0
 *     cdef double QD = 0.0
 *     cdef int bestQual = 0             # <<<<<<<<<<<<<<
 *     cdef int thisQual = 0
 *     cdef int badReadsThreshold = options.badReadsThreshold
 */
  __pyx_v_bestQual = 0;

  /* "vcfutils.pyx":1529
 *     cdef double QD = 0.0
 *     cdef int bestQual = 0
 *     cdef int thisQual = 0             # <<<<<<<<<<<<<<
 *     cdef int badReadsThreshold = options.badReadsThreshold
 *     cdef double abThreshold = options.abThreshold
 */
  __pyx_v_thisQual = 0;

  /* "vcfutils.pyx":1530
 *     cdef int bestQual = 0
 *     cdef int thisQual = 0
 *     cdef int badReadsThreshold = options.badReadsThreshold             # <<<<<<<<<<<<<<
 *     cdef double abThreshold = options.abThreshold
 *     cdef double sbThreshold = options.sbThreshold
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__badReadsThreshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_badReadsThreshold = __pyx_t_2;

  /* "vcfutils.pyx":1531
 *     cdef int thisQual = 0
 *     cdef int badReadsThreshold = options.badReadsThreshold
 *     cdef double abThreshold = options.abThreshold             # <<<<<<<<<<<<<<
 *     cdef double sbThreshold = options.sbThreshold
 *     cdef double rmsmqThreshold = options.rmsmqThreshold
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__abThreshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_abThreshold = __pyx_t_3;

  /* "vcfutils.pyx":1532
 *     cdef int badReadsThreshold = options.badReadsThreshold
 *     cdef double abThreshold = options.abThreshold
 *     cdef double sbThreshold = options.sbThreshold             # <<<<<<<<<<<<<<
 *     cdef double rmsmqThreshold = options.rmsmqThreshold
 *     cdef double filteredReadsFrac = options.filteredReadsFrac
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__sbThreshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_sbThreshold = __pyx_t_3;

  /* "vcfutils.pyx":1533
 *     cdef double abThreshold = options.abThreshold
 *     cdef double sbThreshold = options.sbThreshold
 *     cdef double rmsmqThreshold = options.rmsmqThreshold             # <<<<<<<<<<<<<<
 *     cdef double filteredReadsFrac = options.filteredReadsFrac
 *     cdef double qdThreshold = options.qdThreshold
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__rmsmqThreshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rmsmqThreshold = __pyx_t_3;

  /* "vcfutils.pyx":1534
 *     cdef double sbThreshold = options.sbThreshold
 *     cdef double rmsmqThreshold = options.rmsmqThreshold
 *     cdef double filteredReadsFrac = options.filteredReadsFrac             # <<<<<<<<<<<<<<
 *     cdef double qdThreshold = options.qdThreshold
 *     cdef double hapScoreThreshold = options.hapScoreThreshold
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__filteredReadsFrac); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_filteredReadsFrac = __pyx_t_3;

  /* "vcfutils.pyx":1535
 *     cdef double rmsmqThreshold = options.rmsmqThreshold
 *     cdef double filteredReadsFrac = options.filteredReadsFrac
 *     cdef double qdThreshold = options.qdThreshold             # <<<<<<<<<<<<<<
 *     cdef double hapScoreThreshold = options.hapScoreThreshold
 *     cdef double scThreshold = options.scThreshold
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__qdThreshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_qdThreshold = __pyx_t_3;

  /* "vcfutils.pyx":1536
 *     cdef double filteredReadsFrac = options.filteredReadsFrac
 *     cdef double qdThreshold = options.qdThreshold
 *     cdef double hapScoreThreshold = options.hapScoreThreshold             # <<<<<<<<<<<<<<
 *     cdef double scThreshold = options.scThreshold
 *     cdef int failsSCFilter = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__hapScoreThreshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_hapScoreThreshold = __pyx_t_3;

  /* "vcfutils.pyx":1537
 *     cdef double qdThreshold = options.qdThreshold
 *     cdef double hapScoreThreshold = options.hapScoreThreshold
 *     cdef double scThreshold = options.scThreshold             # <<<<<<<<<<<<<<
 *     cdef int failsSCFilter = 0
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s__scThreshold); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_scThreshold = __pyx_t_3;

  /* "vcfutils.pyx":1538
 *     cdef double hapScoreThreshold = options.hapScoreThreshold
 *     cdef double scThreshold = options.scThreshold
 *     cdef int failsSCFilter = 0             # <<<<<<<<<<<<<<
 * 
 *     for pos,varsAtPos in varsByPos.iteritems():
 */
  __pyx_v_failsSCFilter = 0;

  /* "vcfutils.pyx":1540
 *     cdef int failsSCFilter = 0
 * 
 *     for pos,varsAtPos in varsByPos.iteritems():             # <<<<<<<<<<<<<<
 * 
 *         nVars = len(varsAtPos)
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_varsByPos) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = __Pyx_dict_iterator(((PyObject *)__pyx_v_varsByPos), 1, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_5), (&__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_6;
  __pyx_t_6 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_5, &__pyx_t_4, &__pyx_t_6, &__pyx_t_7, NULL, __pyx_t_2);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_v_pos);
    __pyx_v_pos = __pyx_t_6;
    __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_v_varsAtPos);
    __pyx_v_varsAtPos = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "vcfutils.pyx":1542
 *     for pos,varsAtPos in varsByPos.iteritems():
 * 
 *         nVars = len(varsAtPos)             # <<<<<<<<<<<<<<
 *         nVarsSB = 0
 *         nVarsAB = 0
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_varsAtPos); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nVars = __pyx_t_9;

    /* "vcfutils.pyx":1543
 * 
 *         nVars = len(varsAtPos)
 *         nVarsSB = 0             # <<<<<<<<<<<<<<
 *         nVarsAB = 0
 *         nVarsQD = 0
 */
    __pyx_v_nVarsSB = 0;

    /* "vcfutils.pyx":1544
 *         nVars = len(varsAtPos)
 *         nVarsSB = 0
 *         nVarsAB = 0             # <<<<<<<<<<<<<<
 *         nVarsQD = 0
 *         nVarsHapScore = 0
 */
    __pyx_v_nVarsAB = 0;

    /* "vcfutils.pyx":1545
 *         nVarsSB = 0
 *         nVarsAB = 0
 *         nVarsQD = 0             # <<<<<<<<<<<<<<
 *         nVarsHapScore = 0
 *         nVarsRMSMQ = 0
 */
    __pyx_v_nVarsQD = 0;

    /* "vcfutils.pyx":1546
 *         nVarsAB = 0
 *         nVarsQD = 0
 *         nVarsHapScore = 0             # <<<<<<<<<<<<<<
 *         nVarsRMSMQ = 0
 *         nVarsFailingMMLQFilter = 0
 */
    __pyx_v_nVarsHapScore = 0;

    /* "vcfutils.pyx":1547
 *         nVarsQD = 0
 *         nVarsHapScore = 0
 *         nVarsRMSMQ = 0             # <<<<<<<<<<<<<<
 *         nVarsFailingMMLQFilter = 0
 *         hapScore = 0
 */
    __pyx_v_nVarsRMSMQ = 0;

    /* "vcfutils.pyx":1548
 *         nVarsHapScore = 0
 *         nVarsRMSMQ = 0
 *         nVarsFailingMMLQFilter = 0             # <<<<<<<<<<<<<<
 *         hapScore = 0
 *         QD = 0.0
 */
    __pyx_v_nVarsFailingMMLQFilter = 0;

    /* "vcfutils.pyx":1549
 *         nVarsRMSMQ = 0
 *         nVarsFailingMMLQFilter = 0
 *         hapScore = 0             # <<<<<<<<<<<<<<
 *         QD = 0.0
 *         bestQual = 0
 */
    __pyx_v_hapScore = 0;

    /* "vcfutils.pyx":1550
 *         nVarsFailingMMLQFilter = 0
 *         hapScore = 0
 *         QD = 0.0             # <<<<<<<<<<<<<<
 *         bestQual = 0
 * 
 */
    __pyx_v_QD = 0.0;

    /* "vcfutils.pyx":1551
 *         hapScore = 0
 *         QD = 0.0
 *         bestQual = 0             # <<<<<<<<<<<<<<
 * 
 *         sequence = vcfInfo[varsAtPos[0]]['SC'][0]
 */
    __pyx_v_bestQual = 0;

    /* "vcfutils.pyx":1553
 *         bestQual = 0
 * 
 *         sequence = vcfInfo[varsAtPos[0]]['SC'][0]             # <<<<<<<<<<<<<<
 * 
 *         if computeSCValue(sequence) > scThreshold:
 */
    if (unlikely(((PyObject *)__pyx_v_vcfInfo) == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_varsAtPos, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfInfo), __pyx_t_7); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__SC)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __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_t_7, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_v_sequence);
    __pyx_v_sequence = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "vcfutils.pyx":1555
 *         sequence = vcfInfo[varsAtPos[0]]['SC'][0]
 * 
 *         if computeSCValue(sequence) > scThreshold:             # <<<<<<<<<<<<<<
 *             failsSCFilter = 1
 *         else:
 */
    __pyx_t_10 = ((__pyx_f_8vcfutils_computeSCValue(__pyx_v_sequence) > __pyx_v_scThreshold) != 0);
    if (__pyx_t_10) {

      /* "vcfutils.pyx":1556
 * 
 *         if computeSCValue(sequence) > scThreshold:
 *             failsSCFilter = 1             # <<<<<<<<<<<<<<
 *         else:
 *             failsSCFilter = 0
 */
      __pyx_v_failsSCFilter = 1;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "vcfutils.pyx":1558
 *             failsSCFilter = 1
 *         else:
 *             failsSCFilter = 0             # <<<<<<<<<<<<<<
 * 
 *         for v in varsAtPos:
 */
      __pyx_v_failsSCFilter = 0;
    }
    __pyx_L5:;

    /* "vcfutils.pyx":1560
 *             failsSCFilter = 0
 * 
 *         for v in varsAtPos:             # <<<<<<<<<<<<<<
 * 
 *             FILTER[v] = []
 */
    if (PyList_CheckExact(__pyx_v_varsAtPos) || PyTuple_CheckExact(__pyx_v_varsAtPos)) {
      __pyx_t_6 = __pyx_v_varsAtPos; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_varsAtPos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_7 = __pyx_t_11(__pyx_t_6);
        if (unlikely(!__pyx_t_7)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_7variant_Variant))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_v));
      __pyx_v_v = ((struct __pyx_obj_7variant_Variant *)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "vcfutils.pyx":1562
 *         for v in varsAtPos:
 * 
 *             FILTER[v] = []             # <<<<<<<<<<<<<<
 *             infoThisVar = vcfInfo[v]
 *             hapScore = int(infoThisVar['HapScore'][0])
 */
      __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v), ((PyObject *)__pyx_t_7)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;

      /* "vcfutils.pyx":1563
 * 
 *             FILTER[v] = []
 *             infoThisVar = vcfInfo[v]             # <<<<<<<<<<<<<<
 *             hapScore = int(infoThisVar['HapScore'][0])
 *             QD = float(infoThisVar['QD'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_vcfInfo) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_vcfInfo), ((PyObject *)__pyx_v_v)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (!(likely(PyDict_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_infoThisVar));
      __pyx_v_infoThisVar = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "vcfutils.pyx":1564
 *             FILTER[v] = []
 *             infoThisVar = vcfInfo[v]
 *             hapScore = int(infoThisVar['HapScore'][0])             # <<<<<<<<<<<<<<
 *             QD = float(infoThisVar['QD'][0])
 *             BRF = float(infoThisVar['BRF'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__HapScore)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __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 = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_hapScore = __pyx_t_8;

      /* "vcfutils.pyx":1565
 *             infoThisVar = vcfInfo[v]
 *             hapScore = int(infoThisVar['HapScore'][0])
 *             QD = float(infoThisVar['QD'][0])             # <<<<<<<<<<<<<<
 *             BRF = float(infoThisVar['BRF'][0])
 *             RMSMQ = float(infoThisVar['MQ'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__QD)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_t_7); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_QD = __pyx_t_3;

      /* "vcfutils.pyx":1566
 *             hapScore = int(infoThisVar['HapScore'][0])
 *             QD = float(infoThisVar['QD'][0])
 *             BRF = float(infoThisVar['BRF'][0])             # <<<<<<<<<<<<<<
 *             RMSMQ = float(infoThisVar['MQ'][0])
 *             totalForwardVarReads = int(infoThisVar['NF'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__BRF)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_t_12); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_BRF = __pyx_t_3;

      /* "vcfutils.pyx":1567
 *             QD = float(infoThisVar['QD'][0])
 *             BRF = float(infoThisVar['BRF'][0])
 *             RMSMQ = float(infoThisVar['MQ'][0])             # <<<<<<<<<<<<<<
 *             totalForwardVarReads = int(infoThisVar['NF'][0])
 *             totalReverseVarReads = int(infoThisVar['NR'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__MQ)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_t_7); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_RMSMQ = __pyx_t_3;

      /* "vcfutils.pyx":1568
 *             BRF = float(infoThisVar['BRF'][0])
 *             RMSMQ = float(infoThisVar['MQ'][0])
 *             totalForwardVarReads = int(infoThisVar['NF'][0])             # <<<<<<<<<<<<<<
 *             totalReverseVarReads = int(infoThisVar['NR'][0])
 *             totalVarReads = int(infoThisVar['TR'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__NF)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __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 = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_v_totalForwardVarReads);
      __pyx_v_totalForwardVarReads = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "vcfutils.pyx":1569
 *             RMSMQ = float(infoThisVar['MQ'][0])
 *             totalForwardVarReads = int(infoThisVar['NF'][0])
 *             totalReverseVarReads = int(infoThisVar['NR'][0])             # <<<<<<<<<<<<<<
 *             totalVarReads = int(infoThisVar['TR'][0])
 *             totalReads = int(infoThisVar['TC'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__NR)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_v_totalReverseVarReads);
      __pyx_v_totalReverseVarReads = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "vcfutils.pyx":1570
 *             totalForwardVarReads = int(infoThisVar['NF'][0])
 *             totalReverseVarReads = int(infoThisVar['NR'][0])
 *             totalVarReads = int(infoThisVar['TR'][0])             # <<<<<<<<<<<<<<
 *             totalReads = int(infoThisVar['TC'][0])
 *             totalFwdReads = int(infoThisVar['TCF'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__TR)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __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 = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_totalVarReads = __pyx_t_8;

      /* "vcfutils.pyx":1571
 *             totalReverseVarReads = int(infoThisVar['NR'][0])
 *             totalVarReads = int(infoThisVar['TR'][0])
 *             totalReads = int(infoThisVar['TC'][0])             # <<<<<<<<<<<<<<
 *             totalFwdReads = int(infoThisVar['TCF'][0])
 *             totalRevReads = int(infoThisVar['TCR'][0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__TC)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_totalReads = __pyx_t_8;

      /* "vcfutils.pyx":1572
 *             totalVarReads = int(infoThisVar['TR'][0])
 *             totalReads = int(infoThisVar['TC'][0])
 *             totalFwdReads = int(infoThisVar['TCF'][0])             # <<<<<<<<<<<<<<
 *             totalRevReads = int(infoThisVar['TCR'][0])
 *             medMinQualBases = int(infoThisVar.get('MMLQ', [100])[0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__TCF)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __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 = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_totalFwdReads = __pyx_t_8;

      /* "vcfutils.pyx":1573
 *             totalReads = int(infoThisVar['TC'][0])
 *             totalFwdReads = int(infoThisVar['TCF'][0])
 *             totalRevReads = int(infoThisVar['TCR'][0])             # <<<<<<<<<<<<<<
 *             medMinQualBases = int(infoThisVar.get('MMLQ', [100])[0])
 *             thisQual = int(infoThisVar.get('PP', [0])[0])
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__TCR)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_totalRevReads = __pyx_t_8;

      /* "vcfutils.pyx":1574
 *             totalFwdReads = int(infoThisVar['TCF'][0])
 *             totalRevReads = int(infoThisVar['TCR'][0])
 *             medMinQualBases = int(infoThisVar.get('MMLQ', [100])[0])             # <<<<<<<<<<<<<<
 *             thisQual = int(infoThisVar.get('PP', [0])[0])
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_int_100);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_100);
      __Pyx_GIVEREF(__pyx_int_100);
      __pyx_t_12 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__MMLQ), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_medMinQualBases = __pyx_t_8;

      /* "vcfutils.pyx":1575
 *             totalRevReads = int(infoThisVar['TCR'][0])
 *             medMinQualBases = int(infoThisVar.get('MMLQ', [100])[0])
 *             thisQual = int(infoThisVar.get('PP', [0])[0])             # <<<<<<<<<<<<<<
 * 
 *             if thisQual > bestQual:
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_int_0);
      PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      __pyx_t_12 = __Pyx_PyDict_GetItemDefault(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__PP), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
      __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_thisQual = __pyx_t_8;

      /* "vcfutils.pyx":1577
 *             thisQual = int(infoThisVar.get('PP', [0])[0])
 * 
 *             if thisQual > bestQual:             # <<<<<<<<<<<<<<
 *                 bestQual = thisQual
 * 
 */
      __pyx_t_10 = ((__pyx_v_thisQual > __pyx_v_bestQual) != 0);
      if (__pyx_t_10) {

        /* "vcfutils.pyx":1578
 * 
 *             if thisQual > bestQual:
 *                 bestQual = thisQual             # <<<<<<<<<<<<<<
 * 
 *             if medMinQualBases < badReadsThreshold:
 */
        __pyx_v_bestQual = __pyx_v_thisQual;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "vcfutils.pyx":1580
 *                 bestQual = thisQual
 * 
 *             if medMinQualBases < badReadsThreshold:             # <<<<<<<<<<<<<<
 *                 nVarsFailingMMLQFilter += 1
 * 
 */
      __pyx_t_10 = ((__pyx_v_medMinQualBases < __pyx_v_badReadsThreshold) != 0);
      if (__pyx_t_10) {

        /* "vcfutils.pyx":1581
 * 
 *             if medMinQualBases < badReadsThreshold:
 *                 nVarsFailingMMLQFilter += 1             # <<<<<<<<<<<<<<
 * 
 *             abPVal = float(infoThisVar['ABPV'][0])
 */
        __pyx_v_nVarsFailingMMLQFilter = (__pyx_v_nVarsFailingMMLQFilter + 1);
        goto __pyx_L9;
      }
      __pyx_L9:;

      /* "vcfutils.pyx":1583
 *                 nVarsFailingMMLQFilter += 1
 * 
 *             abPVal = float(infoThisVar['ABPV'][0])             # <<<<<<<<<<<<<<
 *             sbPVal = float(infoThisVar['SbPval'][0])
 * 
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__ABPV)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_t_12); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_abPVal = __pyx_t_3;

      /* "vcfutils.pyx":1584
 * 
 *             abPVal = float(infoThisVar['ABPV'][0])
 *             sbPVal = float(infoThisVar['SbPval'][0])             # <<<<<<<<<<<<<<
 * 
 *             if QD < qdThreshold:
 */
      if (unlikely(((PyObject *)__pyx_v_infoThisVar) == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_infoThisVar), ((PyObject *)__pyx_n_s__SbPval)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 0); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_3 = __Pyx_PyObject_AsDouble(__pyx_t_7); if (unlikely(__pyx_t_3 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_sbPVal = __pyx_t_3;

      /* "vcfutils.pyx":1586
 *             sbPVal = float(infoThisVar['SbPval'][0])
 * 
 *             if QD < qdThreshold:             # <<<<<<<<<<<<<<
 *                 nVarsQD += 1
 * 
 */
      __pyx_t_10 = ((__pyx_v_QD < __pyx_v_qdThreshold) != 0);
      if (__pyx_t_10) {

        /* "vcfutils.pyx":1587
 * 
 *             if QD < qdThreshold:
 *                 nVarsQD += 1             # <<<<<<<<<<<<<<
 * 
 *             if hapScore > hapScoreThreshold:
 */
        __pyx_v_nVarsQD = (__pyx_v_nVarsQD + 1);
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "vcfutils.pyx":1589
 *                 nVarsQD += 1
 * 
 *             if hapScore > hapScoreThreshold:             # <<<<<<<<<<<<<<
 *                 nVarsHapScore += 1
 * 
 */
      __pyx_t_10 = ((__pyx_v_hapScore > __pyx_v_hapScoreThreshold) != 0);
      if (__pyx_t_10) {

        /* "vcfutils.pyx":1590
 * 
 *             if hapScore > hapScoreThreshold:
 *                 nVarsHapScore += 1             # <<<<<<<<<<<<<<
 * 
 *             if totalReads > 0 and abPVal < abThreshold:
 */
        __pyx_v_nVarsHapScore = (__pyx_v_nVarsHapScore + 1);
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "vcfutils.pyx":1592
 *                 nVarsHapScore += 1
 * 
 *             if totalReads > 0 and abPVal < abThreshold:             # <<<<<<<<<<<<<<
 *                 nVarsAB += 1
 * 
 */
      __pyx_t_10 = ((__pyx_v_totalReads > 0) != 0);
      if (__pyx_t_10) {
        __pyx_t_13 = ((__pyx_v_abPVal < __pyx_v_abThreshold) != 0);
        __pyx_t_14 = __pyx_t_13;
      } else {
        __pyx_t_14 = __pyx_t_10;
      }
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1593
 * 
 *             if totalReads > 0 and abPVal < abThreshold:
 *                 nVarsAB += 1             # <<<<<<<<<<<<<<
 * 
 *             if sbPVal < sbThreshold:
 */
        __pyx_v_nVarsAB = (__pyx_v_nVarsAB + 1);
        goto __pyx_L12;
      }
      __pyx_L12:;

      /* "vcfutils.pyx":1595
 *                 nVarsAB += 1
 * 
 *             if sbPVal < sbThreshold:             # <<<<<<<<<<<<<<
 *                 nVarsSB += 1
 * 
 */
      __pyx_t_14 = ((__pyx_v_sbPVal < __pyx_v_sbThreshold) != 0);
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1596
 * 
 *             if sbPVal < sbThreshold:
 *                 nVarsSB += 1             # <<<<<<<<<<<<<<
 * 
 *             if RMSMQ < rmsmqThreshold:
 */
        __pyx_v_nVarsSB = (__pyx_v_nVarsSB + 1);
        goto __pyx_L13;
      }
      __pyx_L13:;

      /* "vcfutils.pyx":1598
 *                 nVarsSB += 1
 * 
 *             if RMSMQ < rmsmqThreshold:             # <<<<<<<<<<<<<<
 *                 nVarsRMSMQ += 1
 * 
 */
      __pyx_t_14 = ((__pyx_v_RMSMQ < __pyx_v_rmsmqThreshold) != 0);
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1599
 * 
 *             if RMSMQ < rmsmqThreshold:
 *                 nVarsRMSMQ += 1             # <<<<<<<<<<<<<<
 * 
 *             if failsSCFilter:
 */
        __pyx_v_nVarsRMSMQ = (__pyx_v_nVarsRMSMQ + 1);
        goto __pyx_L14;
      }
      __pyx_L14:;

      /* "vcfutils.pyx":1601
 *                 nVarsRMSMQ += 1
 * 
 *             if failsSCFilter:             # <<<<<<<<<<<<<<
 *                 FILTER[v].append('SC')
 * 
 */
      __pyx_t_14 = (__pyx_v_failsSCFilter != 0);
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1602
 * 
 *             if failsSCFilter:
 *                 FILTER[v].append('SC')             # <<<<<<<<<<<<<<
 * 
 *         for v in varsAtPos:
 */
        __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_7, ((PyObject *)__pyx_n_s__SC)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __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_12); __pyx_t_12 = 0;
        goto __pyx_L15;
      }
      __pyx_L15:;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "vcfutils.pyx":1604
 *                 FILTER[v].append('SC')
 * 
 *         for v in varsAtPos:             # <<<<<<<<<<<<<<
 * 
 *             if nVarsQD == nVars:
 */
    if (PyList_CheckExact(__pyx_v_varsAtPos) || PyTuple_CheckExact(__pyx_v_varsAtPos)) {
      __pyx_t_6 = __pyx_v_varsAtPos; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_varsAtPos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
    }
    for (;;) {
      if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_12 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_12); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_12 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_12); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_12 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_12 = __pyx_t_11(__pyx_t_6);
        if (unlikely(!__pyx_t_12)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_12);
      }
      if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_7variant_Variant))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF(((PyObject *)__pyx_v_v));
      __pyx_v_v = ((struct __pyx_obj_7variant_Variant *)__pyx_t_12);
      __pyx_t_12 = 0;

      /* "vcfutils.pyx":1606
 *         for v in varsAtPos:
 * 
 *             if nVarsQD == nVars:             # <<<<<<<<<<<<<<
 *                 FILTER[v].append('QD')
 * 
 */
      __pyx_t_14 = ((__pyx_v_nVarsQD == __pyx_v_nVars) != 0);
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1607
 * 
 *             if nVarsQD == nVars:
 *                 FILTER[v].append('QD')             # <<<<<<<<<<<<<<
 * 
 *             if nVarsHapScore == nVars:
 */
        __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_12, ((PyObject *)__pyx_n_s__QD)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L18;
      }
      __pyx_L18:;

      /* "vcfutils.pyx":1609
 *                 FILTER[v].append('QD')
 * 
 *             if nVarsHapScore == nVars:             # <<<<<<<<<<<<<<
 *                 FILTER[v].append('HapScore')
 * 
 */
      __pyx_t_14 = ((__pyx_v_nVarsHapScore == __pyx_v_nVars) != 0);
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1610
 * 
 *             if nVarsHapScore == nVars:
 *                 FILTER[v].append('HapScore')             # <<<<<<<<<<<<<<
 * 
 *             if nVarsRMSMQ == nVars:
 */
        __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_7, ((PyObject *)__pyx_n_s__HapScore)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __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_12); __pyx_t_12 = 0;
        goto __pyx_L19;
      }
      __pyx_L19:;

      /* "vcfutils.pyx":1612
 *                 FILTER[v].append('HapScore')
 * 
 *             if nVarsRMSMQ == nVars:             # <<<<<<<<<<<<<<
 *                 FILTER[v].append('MQ')
 * 
 */
      __pyx_t_14 = ((__pyx_v_nVarsRMSMQ == __pyx_v_nVars) != 0);
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1613
 * 
 *             if nVarsRMSMQ == nVars:
 *                 FILTER[v].append('MQ')             # <<<<<<<<<<<<<<
 * 
 *             if nVarsSB == nVars:
 */
        __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_12, ((PyObject *)__pyx_n_s__MQ)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L20;
      }
      __pyx_L20:;

      /* "vcfutils.pyx":1615
 *                 FILTER[v].append('MQ')
 * 
 *             if nVarsSB == nVars:             # <<<<<<<<<<<<<<
 *                 FILTER[v].append('strandBias')
 * 
 */
      __pyx_t_14 = ((__pyx_v_nVarsSB == __pyx_v_nVars) != 0);
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1616
 * 
 *             if nVarsSB == nVars:
 *                 FILTER[v].append('strandBias')             # <<<<<<<<<<<<<<
 * 
 *             if nVarsAB == nVars:
 */
        __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_7, ((PyObject *)__pyx_n_s__strandBias)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; __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_12); __pyx_t_12 = 0;
        goto __pyx_L21;
      }
      __pyx_L21:;

      /* "vcfutils.pyx":1618
 *                 FILTER[v].append('strandBias')
 * 
 *             if nVarsAB == nVars:             # <<<<<<<<<<<<<<
 *                 FILTER[v].append('alleleBias')
 * 
 */
      __pyx_t_14 = ((__pyx_v_nVarsAB == __pyx_v_nVars) != 0);
      if (__pyx_t_14) {

        /* "vcfutils.pyx":1619
 * 
 *             if nVarsAB == nVars:
 *                 FILTER[v].append('alleleBias')             # <<<<<<<<<<<<<<
 * 
 *             if nVarsFailingMMLQFilter == nVars or BRF >= filteredReadsFrac:
 */
        __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_12, ((PyObject *)__pyx_n_s__alleleBias)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L22;
      }
      __pyx_L22:;

      /* "vcfutils.pyx":1621
 *                 FILTER[v].append('alleleBias')
 * 
 *             if nVarsFailingMMLQFilter == nVars or BRF >= filteredReadsFrac:             # <<<<<<<<<<<<<<
 *                 FILTER[v].append('badReads')
 * 
 */
      __pyx_t_14 = ((__pyx_v_nVarsFailingMMLQFilter == __pyx_v_nVars) != 0);
      if (!__pyx_t_14) {
        __pyx_t_10 = ((__pyx_v_BRF >= __pyx_v_filteredReadsFrac) != 0);
        __pyx_t_13 = __pyx_t_10;
      } else {
        __pyx_t_13 = __pyx_t_14;
      }
      if (__pyx_t_13) {

        /* "vcfutils.pyx":1622
 * 
 *             if nVarsFailingMMLQFilter == nVars or BRF >= filteredReadsFrac:
 *                 FILTER[v].append('badReads')             # <<<<<<<<<<<<<<
 * 
 *             if bestQual < 20:
 */
        __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_7, ((PyObject *)__pyx_n_s__badReads)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; __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_12); __pyx_t_12 = 0;
        goto __pyx_L23;
      }
      __pyx_L23:;

      /* "vcfutils.pyx":1624
 *                 FILTER[v].append('badReads')
 * 
 *             if bestQual < 20:             # <<<<<<<<<<<<<<
 *                 FILTER[v].append('Q20')
 * 
 */
      __pyx_t_13 = ((__pyx_v_bestQual < 20) != 0);
      if (__pyx_t_13) {

        /* "vcfutils.pyx":1625
 * 
 *             if bestQual < 20:
 *                 FILTER[v].append('Q20')             # <<<<<<<<<<<<<<
 * 
 *     return FILTER
 */
        __pyx_t_12 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_FILTER), ((PyObject *)__pyx_v_v)); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_12, ((PyObject *)__pyx_n_s__Q20)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L24;
      }
      __pyx_L24:;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "vcfutils.pyx":1627
 *                 FILTER[v].append('Q20')
 * 
 *     return FILTER             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_FILTER));
  __pyx_r = __pyx_v_FILTER;
  goto __pyx_L0;

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("vcfutils.vcfFILTER", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_FILTER);
  __Pyx_XDECREF(__pyx_v_infoThisVar);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_varsAtPos);
  __Pyx_XDECREF(__pyx_v_sequence);
  __Pyx_XDECREF(__pyx_v_totalForwardVarReads);
  __Pyx_XDECREF(__pyx_v_totalReverseVarReads);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "htslibWrapper.pxd":250
 * 
 * # And here are accessor functions for the bit-fields
 * cdef inline int Read_IsReverse(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FREVERSE) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsReverse(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":251
 * # And here are accessor functions for the bit-fields
 * cdef inline int Read_IsReverse(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FREVERSE) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_IsPaired(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 16) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":253
 *     return ( (theRead.bitFlag & BAM_FREVERSE) != 0)
 * 
 * cdef inline int Read_IsPaired(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FPAIRED) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsPaired(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":254
 * 
 * cdef inline int Read_IsPaired(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FPAIRED) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_IsProperPair(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 1) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":256
 *     return ( (theRead.bitFlag & BAM_FPAIRED) != 0)
 * 
 * cdef inline int Read_IsProperPair(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FPROPER_PAIR) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsProperPair(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":257
 * 
 * cdef inline int Read_IsProperPair(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FPROPER_PAIR) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_IsDuplicate(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 2) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":259
 *     return ( (theRead.bitFlag & BAM_FPROPER_PAIR) != 0)
 * 
 * cdef inline int Read_IsDuplicate(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FDUP) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsDuplicate(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":260
 * 
 * cdef inline int Read_IsDuplicate(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FDUP) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_IsUnmapped(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 1024) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":262
 *     return ( (theRead.bitFlag & BAM_FDUP) != 0)
 * 
 * cdef inline int Read_IsUnmapped(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FUNMAP) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsUnmapped(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":263
 * 
 * cdef inline int Read_IsUnmapped(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FUNMAP) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_MateIsUnmapped(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 4) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":265
 *     return ( (theRead.bitFlag & BAM_FUNMAP) != 0)
 * 
 * cdef inline int Read_MateIsUnmapped(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FMUNMAP) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_MateIsUnmapped(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":266
 * 
 * cdef inline int Read_MateIsUnmapped(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FMUNMAP) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_MateIsReverse(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 8) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":268
 *     return ( (theRead.bitFlag & BAM_FMUNMAP) != 0)
 * 
 * cdef inline int Read_MateIsReverse(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FMREVERSE) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_MateIsReverse(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":269
 * 
 * cdef inline int Read_MateIsReverse(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FMREVERSE) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_IsQCFail(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 32) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":271
 *     return ( (theRead.bitFlag & BAM_FMREVERSE) != 0)
 * 
 * cdef inline int Read_IsQCFail(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FQCFAIL) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsQCFail(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":272
 * 
 * cdef inline int Read_IsQCFail(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FQCFAIL) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_IsReadOne(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 512) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":274
 *     return ( (theRead.bitFlag & BAM_FQCFAIL) != 0)
 * 
 * cdef inline int Read_IsReadOne(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FREAD1) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsReadOne(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":275
 * 
 * cdef inline int Read_IsReadOne(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FREAD1) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_IsSecondaryAlignment(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 64) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":277
 *     return ( (theRead.bitFlag & BAM_FREAD1) != 0)
 * 
 * cdef inline int Read_IsSecondaryAlignment(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FSECONDARY) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsSecondaryAlignment(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":278
 * 
 * cdef inline int Read_IsSecondaryAlignment(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FSECONDARY) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_IsCompressed(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 256) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":280
 *     return ( (theRead.bitFlag & BAM_FSECONDARY) != 0)
 * 
 * cdef inline int Read_IsCompressed(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     return ( (theRead.bitFlag & BAM_FCOMPRESSED) != 0)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_IsCompressed(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":281
 * 
 * cdef inline int Read_IsCompressed(cAlignedRead* theRead) nogil:
 *     return ( (theRead.bitFlag & BAM_FCOMPRESSED) != 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_SetIsNotReverse(cAlignedRead* theRead) nogil:
 */
  __pyx_r = ((__pyx_v_theRead->bitFlag & 2048) != 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "htslibWrapper.pxd":283
 *     return ( (theRead.bitFlag & BAM_FCOMPRESSED) != 0)
 * 
 * cdef inline int Read_SetIsNotReverse(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     theRead.bitFlag &= (~BAM_FREVERSE)
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_SetIsNotReverse(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":284
 * 
 * cdef inline int Read_SetIsNotReverse(cAlignedRead* theRead) nogil:
 *     theRead.bitFlag &= (~BAM_FREVERSE)             # <<<<<<<<<<<<<<
 * 
 * cdef inline int Read_SetIsReverse(cAlignedRead* theRead) nogil:
 */
  __pyx_v_theRead->bitFlag = (__pyx_v_theRead->bitFlag & (~16));

  __pyx_r = 0;
  return __pyx_r;
}

/* "htslibWrapper.pxd":286
 *     theRead.bitFlag &= (~BAM_FREVERSE)
 * 
 * cdef inline int Read_SetIsReverse(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     theRead.bitFlag |= BAM_FREVERSE
 * 
 */

static CYTHON_INLINE int __pyx_f_13htslibWrapper_Read_SetIsReverse(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {
  int __pyx_r;

  /* "htslibWrapper.pxd":287
 * 
 * cdef inline int Read_SetIsReverse(cAlignedRead* theRead) nogil:
 *     theRead.bitFlag |= BAM_FREVERSE             # <<<<<<<<<<<<<<
 * 
 * cdef inline void Read_SetQCFail(cAlignedRead* theRead) nogil:
 */
  __pyx_v_theRead->bitFlag = (__pyx_v_theRead->bitFlag | 16);

  __pyx_r = 0;
  return __pyx_r;
}

/* "htslibWrapper.pxd":289
 *     theRead.bitFlag |= BAM_FREVERSE
 * 
 * cdef inline void Read_SetQCFail(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     theRead.bitFlag |= BAM_FQCFAIL
 * 
 */

static CYTHON_INLINE void __pyx_f_13htslibWrapper_Read_SetQCFail(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {

  /* "htslibWrapper.pxd":290
 * 
 * cdef inline void Read_SetQCFail(cAlignedRead* theRead) nogil:
 *     theRead.bitFlag |= BAM_FQCFAIL             # <<<<<<<<<<<<<<
 * 
 * cdef inline void Read_SetCompressed(cAlignedRead* theRead) nogil:
 */
  __pyx_v_theRead->bitFlag = (__pyx_v_theRead->bitFlag | 512);

}

/* "htslibWrapper.pxd":292
 *     theRead.bitFlag |= BAM_FQCFAIL
 * 
 * cdef inline void Read_SetCompressed(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     theRead.bitFlag |= BAM_FCOMPRESSED
 * 
 */

static CYTHON_INLINE void __pyx_f_13htslibWrapper_Read_SetCompressed(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {

  /* "htslibWrapper.pxd":293
 * 
 * cdef inline void Read_SetCompressed(cAlignedRead* theRead) nogil:
 *     theRead.bitFlag |= BAM_FCOMPRESSED             # <<<<<<<<<<<<<<
 * 
 * cdef inline void Read_SetUnCompressed(cAlignedRead* theRead) nogil:
 */
  __pyx_v_theRead->bitFlag = (__pyx_v_theRead->bitFlag | 2048);

}

/* "htslibWrapper.pxd":295
 *     theRead.bitFlag |= BAM_FCOMPRESSED
 * 
 * cdef inline void Read_SetUnCompressed(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     theRead.bitFlag &= (~BAM_FCOMPRESSED)
 * 
 */

static CYTHON_INLINE void __pyx_f_13htslibWrapper_Read_SetUnCompressed(__pyx_t_13htslibWrapper_cAlignedRead *__pyx_v_theRead) {

  /* "htslibWrapper.pxd":296
 * 
 * cdef inline void Read_SetUnCompressed(cAlignedRead* theRead) nogil:
 *     theRead.bitFlag &= (~BAM_FCOMPRESSED)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_theRead->bitFlag = (__pyx_v_theRead->bitFlag & (~2048));

}

static struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *__pyx_freelist_8vcfutils___pyx_scope_struct__trimLeftPadding[8];
static int __pyx_freecount_8vcfutils___pyx_scope_struct__trimLeftPadding = 0;

static PyObject *__pyx_tp_new_8vcfutils___pyx_scope_struct__trimLeftPadding(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *p;
  PyObject *o;
  if (likely((__pyx_freecount_8vcfutils___pyx_scope_struct__trimLeftPadding > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding)))) {
    o = (PyObject*)__pyx_freelist_8vcfutils___pyx_scope_struct__trimLeftPadding[--__pyx_freecount_8vcfutils___pyx_scope_struct__trimLeftPadding];
    memset(o, 0, sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding));
    PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *)o);
  p->__pyx_v_alt = 0;
  return o;
}

static void __pyx_tp_dealloc_8vcfutils___pyx_scope_struct__trimLeftPadding(PyObject *o) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *p = (struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_alt);
  if ((__pyx_freecount_8vcfutils___pyx_scope_struct__trimLeftPadding < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding))) {
    __pyx_freelist_8vcfutils___pyx_scope_struct__trimLeftPadding[__pyx_freecount_8vcfutils___pyx_scope_struct__trimLeftPadding++] = ((struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8vcfutils___pyx_scope_struct__trimLeftPadding(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *p = (struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *)o;
  if (p->__pyx_v_alt) {
    e = (*v)(p->__pyx_v_alt, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8vcfutils___pyx_scope_struct__trimLeftPadding(PyObject *o) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *p = (struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_v_alt);
  p->__pyx_v_alt = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyTypeObject __pyx_type_8vcfutils___pyx_scope_struct__trimLeftPadding = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("vcfutils.__pyx_scope_struct__trimLeftPadding"), /*tp_name*/
  sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8vcfutils___pyx_scope_struct__trimLeftPadding, /*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_8vcfutils___pyx_scope_struct__trimLeftPadding, /*tp_traverse*/
  __pyx_tp_clear_8vcfutils___pyx_scope_struct__trimLeftPadding, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8vcfutils___pyx_scope_struct__trimLeftPadding, /*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_8vcfutils___pyx_scope_struct__trimLeftPadding, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *__pyx_freelist_8vcfutils___pyx_scope_struct_2_genexpr[8];
static int __pyx_freecount_8vcfutils___pyx_scope_struct_2_genexpr = 0;

static PyObject *__pyx_tp_new_8vcfutils___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *p;
  PyObject *o;
  if (likely((__pyx_freecount_8vcfutils___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8vcfutils___pyx_scope_struct_2_genexpr[--__pyx_freecount_8vcfutils___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr));
    PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_allele = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_8vcfutils___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_allele);
  Py_CLEAR(p->__pyx_t_0);
  if ((__pyx_freecount_8vcfutils___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr))) {
    __pyx_freelist_8vcfutils___pyx_scope_struct_2_genexpr[__pyx_freecount_8vcfutils___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8vcfutils___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_8vcfutils___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_allele) {
    e = (*v)(p->__pyx_v_allele, 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_8vcfutils___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_allele);
  p->__pyx_v_allele = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyTypeObject __pyx_type_8vcfutils___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("vcfutils.__pyx_scope_struct_2_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8vcfutils___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_8vcfutils___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  __pyx_tp_clear_8vcfutils___pyx_scope_struct_2_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8vcfutils___pyx_scope_struct_2_genexpr, /*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_8vcfutils___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
};

static struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *__pyx_freelist_8vcfutils___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_8vcfutils___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_8vcfutils___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *p;
  PyObject *o;
  if (likely((__pyx_freecount_8vcfutils___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8vcfutils___pyx_scope_struct_1_genexpr[--__pyx_freecount_8vcfutils___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr));
    PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *)o);
  p->__pyx_outer_scope = 0;
  p->__pyx_v_allele = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_8vcfutils___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_allele);
  Py_CLEAR(p->__pyx_t_0);
  if ((__pyx_freecount_8vcfutils___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr))) {
    __pyx_freelist_8vcfutils___pyx_scope_struct_1_genexpr[__pyx_freecount_8vcfutils___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8vcfutils___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8vcfutils___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_allele) {
    e = (*v)(p->__pyx_v_allele, 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_8vcfutils___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_8vcfutils___pyx_scope_struct__trimLeftPadding *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_allele);
  p->__pyx_v_allele = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyTypeObject __pyx_type_8vcfutils___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("vcfutils.__pyx_scope_struct_1_genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_8vcfutils___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8vcfutils___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_8vcfutils___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  __pyx_tp_clear_8vcfutils___pyx_scope_struct_1_genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8vcfutils___pyx_scope_struct_1_genexpr, /*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_8vcfutils___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
};

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("vcfutils"),
    __Pyx_DOCSTR(__pyx_k_41), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_s_101, __pyx_k_101, sizeof(__pyx_k_101), 0, 0, 1, 0},
  {&__pyx_kp_s_103, __pyx_k_103, sizeof(__pyx_k_103), 0, 0, 1, 0},
  {&__pyx_kp_s_105, __pyx_k_105, sizeof(__pyx_k_105), 0, 0, 1, 0},
  {&__pyx_kp_s_107, __pyx_k_107, sizeof(__pyx_k_107), 0, 0, 1, 0},
  {&__pyx_kp_s_109, __pyx_k_109, sizeof(__pyx_k_109), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_s_111, __pyx_k_111, sizeof(__pyx_k_111), 0, 0, 1, 0},
  {&__pyx_kp_s_113, __pyx_k_113, sizeof(__pyx_k_113), 0, 0, 1, 0},
  {&__pyx_kp_s_115, __pyx_k_115, sizeof(__pyx_k_115), 0, 0, 1, 0},
  {&__pyx_kp_s_117, __pyx_k_117, sizeof(__pyx_k_117), 0, 0, 1, 0},
  {&__pyx_kp_s_119, __pyx_k_119, sizeof(__pyx_k_119), 0, 0, 1, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_s_121, __pyx_k_121, sizeof(__pyx_k_121), 0, 0, 1, 0},
  {&__pyx_kp_s_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 1, 0},
  {&__pyx_kp_s_125, __pyx_k_125, sizeof(__pyx_k_125), 0, 0, 1, 0},
  {&__pyx_kp_s_127, __pyx_k_127, sizeof(__pyx_k_127), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 1, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1},
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 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_22, __pyx_k_22, sizeof(__pyx_k_22), 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_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
  {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
  {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
  {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1},
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0},
  {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
  {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
  {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
  {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
  {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
  {&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
  {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
  {&__pyx_kp_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 0},
  {&__pyx_kp_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 0},
  {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
  {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
  {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
  {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_kp_s_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 1, 0},
  {&__pyx_kp_s_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 1, 0},
  {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
  {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
  {&__pyx_kp_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_kp_s_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 0, 1, 0},
  {&__pyx_kp_s_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 1, 0},
  {&__pyx_kp_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 0},
  {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 0},
  {&__pyx_kp_s_99, __pyx_k_99, sizeof(__pyx_k_99), 0, 0, 1, 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__ABPV, __pyx_k__ABPV, sizeof(__pyx_k__ABPV), 0, 0, 1, 1},
  {&__pyx_n_s__Assembler, __pyx_k__Assembler, sizeof(__pyx_k__Assembler), 0, 0, 1, 1},
  {&__pyx_n_s__BRF, __pyx_k__BRF, sizeof(__pyx_k__BRF), 0, 0, 1, 1},
  {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1},
  {&__pyx_n_s__END, __pyx_k__END, sizeof(__pyx_k__END), 0, 0, 1, 1},
  {&__pyx_n_s__FORMAT, __pyx_k__FORMAT, sizeof(__pyx_k__FORMAT), 0, 0, 1, 1},
  {&__pyx_n_s__FR, __pyx_k__FR, sizeof(__pyx_k__FR), 0, 0, 1, 1},
  {&__pyx_n_s__FS, __pyx_k__FS, sizeof(__pyx_k__FS), 0, 0, 1, 1},
  {&__pyx_n_s__File, __pyx_k__File, sizeof(__pyx_k__File), 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__GOF, __pyx_k__GOF, sizeof(__pyx_k__GOF), 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__HLATyping, __pyx_k__HLATyping, sizeof(__pyx_k__HLATyping), 0, 0, 1, 1},
  {&__pyx_n_s__HP, __pyx_k__HP, sizeof(__pyx_k__HP), 0, 0, 1, 1},
  {&__pyx_n_s__HapScore, __pyx_k__HapScore, sizeof(__pyx_k__HapScore), 0, 0, 1, 1},
  {&__pyx_n_s__Integer, __pyx_k__Integer, sizeof(__pyx_k__Integer), 0, 0, 1, 1},
  {&__pyx_n_s__Log, __pyx_k__Log, sizeof(__pyx_k__Log), 0, 0, 1, 1},
  {&__pyx_n_s__MGOF, __pyx_k__MGOF, sizeof(__pyx_k__MGOF), 0, 0, 1, 1},
  {&__pyx_n_s__MMLQ, __pyx_k__MMLQ, sizeof(__pyx_k__MMLQ), 0, 0, 1, 1},
  {&__pyx_n_s__MQ, __pyx_k__MQ, sizeof(__pyx_k__MQ), 0, 0, 1, 1},
  {&__pyx_n_s__NF, __pyx_k__NF, sizeof(__pyx_k__NF), 0, 0, 1, 1},
  {&__pyx_n_s__NR, __pyx_k__NR, sizeof(__pyx_k__NR), 0, 0, 1, 1},
  {&__pyx_n_s__NV, __pyx_k__NV, sizeof(__pyx_k__NV), 0, 0, 1, 1},
  {&__pyx_n_s__PASS, __pyx_k__PASS, sizeof(__pyx_k__PASS), 0, 0, 1, 1},
  {&__pyx_n_s__PP, __pyx_k__PP, sizeof(__pyx_k__PP), 0, 0, 1, 1},
  {&__pyx_n_s__Platypus, __pyx_k__Platypus, sizeof(__pyx_k__Platypus), 0, 0, 1, 1},
  {&__pyx_n_s__Q20, __pyx_k__Q20, sizeof(__pyx_k__Q20), 0, 0, 1, 1},
  {&__pyx_n_s__QD, __pyx_k__QD, sizeof(__pyx_k__QD), 0, 0, 1, 1},
  {&__pyx_n_s__QualDepth, __pyx_k__QualDepth, sizeof(__pyx_k__QualDepth), 0, 0, 1, 1},
  {&__pyx_n_s__REFCALL, __pyx_k__REFCALL, sizeof(__pyx_k__REFCALL), 0, 0, 1, 1},
  {&__pyx_n_s__ReadPosRankSum, __pyx_k__ReadPosRankSum, sizeof(__pyx_k__ReadPosRankSum), 0, 0, 1, 1},
  {&__pyx_n_s__SC, __pyx_k__SC, sizeof(__pyx_k__SC), 0, 0, 1, 1},
  {&__pyx_n_s__START, __pyx_k__START, sizeof(__pyx_k__START), 0, 0, 1, 1},
  {&__pyx_n_s__SbPval, __pyx_k__SbPval, sizeof(__pyx_k__SbPval), 0, 0, 1, 1},
  {&__pyx_n_s__Size, __pyx_k__Size, sizeof(__pyx_k__Size), 0, 0, 1, 1},
  {&__pyx_n_s__Source, __pyx_k__Source, sizeof(__pyx_k__Source), 0, 0, 1, 1},
  {&__pyx_n_s__String, __pyx_k__String, sizeof(__pyx_k__String), 0, 0, 1, 1},
  {&__pyx_n_s__T, __pyx_k__T, sizeof(__pyx_k__T), 0, 0, 1, 1},
  {&__pyx_n_s__TC, __pyx_k__TC, sizeof(__pyx_k__TC), 0, 0, 1, 1},
  {&__pyx_n_s__TCF, __pyx_k__TCF, sizeof(__pyx_k__TCF), 0, 0, 1, 1},
  {&__pyx_n_s__TCR, __pyx_k__TCR, sizeof(__pyx_k__TCR), 0, 0, 1, 1},
  {&__pyx_n_s__TR, __pyx_k__TR, sizeof(__pyx_k__TR), 0, 0, 1, 1},
  {&__pyx_n_s__WE, __pyx_k__WE, sizeof(__pyx_k__WE), 0, 0, 1, 1},
  {&__pyx_n_s__WS, __pyx_k__WS, sizeof(__pyx_k__WS), 0, 0, 1, 1},
  {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 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____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
  {&__pyx_n_s__abThreshold, __pyx_k__abThreshold, sizeof(__pyx_k__abThreshold), 0, 0, 1, 1},
  {&__pyx_n_s__alignScoreFile, __pyx_k__alignScoreFile, sizeof(__pyx_k__alignScoreFile), 0, 0, 1, 1},
  {&__pyx_n_s__allele, __pyx_k__allele, sizeof(__pyx_k__allele), 0, 0, 1, 1},
  {&__pyx_n_s__alleleBias, __pyx_k__alleleBias, sizeof(__pyx_k__alleleBias), 0, 0, 1, 1},
  {&__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__args, __pyx_k__args, sizeof(__pyx_k__args), 0, 0, 1, 1},
  {&__pyx_n_s__badReads, __pyx_k__badReads, sizeof(__pyx_k__badReads), 0, 0, 1, 1},
  {&__pyx_n_s__badReadsThreshold, __pyx_k__badReadsThreshold, sizeof(__pyx_k__badReadsThreshold), 0, 0, 1, 1},
  {&__pyx_n_s__badReadsWindow, __pyx_k__badReadsWindow, sizeof(__pyx_k__badReadsWindow), 0, 0, 1, 1},
  {&__pyx_n_s__canonicalBases, __pyx_k__canonicalBases, sizeof(__pyx_k__canonicalBases), 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__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__debug, __pyx_k__debug, sizeof(__pyx_k__debug), 0, 0, 1, 1},
  {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
  {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
  {&__pyx_n_s__filter, __pyx_k__filter, sizeof(__pyx_k__filter), 0, 0, 1, 1},
  {&__pyx_n_s__filteredReadsFrac, __pyx_k__filteredReadsFrac, sizeof(__pyx_k__filteredReadsFrac), 0, 0, 1, 1},
  {&__pyx_n_s__firstAltChars, __pyx_k__firstAltChars, sizeof(__pyx_k__firstAltChars), 0, 0, 1, 1},
  {&__pyx_n_s__firstRefChar, __pyx_k__firstRefChar, sizeof(__pyx_k__firstRefChar), 0, 0, 1, 1},
  {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
  {&__pyx_n_s__genexpr, __pyx_k__genexpr, sizeof(__pyx_k__genexpr), 0, 0, 1, 1},
  {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
  {&__pyx_n_s__getLogger, __pyx_k__getLogger, sizeof(__pyx_k__getLogger), 0, 0, 1, 1},
  {&__pyx_n_s__getfilter, __pyx_k__getfilter, sizeof(__pyx_k__getfilter), 0, 0, 1, 1},
  {&__pyx_n_s__hapScoreThreshold, __pyx_k__hapScoreThreshold, sizeof(__pyx_k__hapScoreThreshold), 0, 0, 1, 1},
  {&__pyx_n_s__hp10, __pyx_k__hp10, sizeof(__pyx_k__hp10), 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__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
  {&__pyx_n_s__info, __pyx_k__info, sizeof(__pyx_k__info), 0, 0, 1, 1},
  {&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1},
  {&__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__len, __pyx_k__len, sizeof(__pyx_k__len), 0, 0, 1, 1},
  {&__pyx_n_s__logger, __pyx_k__logger, sizeof(__pyx_k__logger), 0, 0, 1, 1},
  {&__pyx_n_s__logging, __pyx_k__logging, sizeof(__pyx_k__logging), 0, 0, 1, 1},
  {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1},
  {&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1},
  {&__pyx_n_s__maxGOF, __pyx_k__maxGOF, sizeof(__pyx_k__maxGOF), 0, 0, 1, 1},
  {&__pyx_n_s__maxLenDiff, __pyx_k__maxLenDiff, sizeof(__pyx_k__maxLenDiff), 0, 0, 1, 1},
  {&__pyx_n_s__maxRefPos, __pyx_k__maxRefPos, sizeof(__pyx_k__maxRefPos), 0, 0, 1, 1},
  {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1},
  {&__pyx_n_s__minBaseQual, __pyx_k__minBaseQual, sizeof(__pyx_k__minBaseQual), 0, 0, 1, 1},
  {&__pyx_n_s__minLenRefAlt, __pyx_k__minLenRefAlt, sizeof(__pyx_k__minLenRefAlt), 0, 0, 1, 1},
  {&__pyx_n_s__minMapQual, __pyx_k__minMapQual, sizeof(__pyx_k__minMapQual), 0, 0, 1, 1},
  {&__pyx_n_s__minPosterior, __pyx_k__minPosterior, sizeof(__pyx_k__minPosterior), 0, 0, 1, 1},
  {&__pyx_n_s__minReads, __pyx_k__minReads, sizeof(__pyx_k__minReads), 0, 0, 1, 1},
  {&__pyx_n_s__minRefPos, __pyx_k__minRefPos, sizeof(__pyx_k__minRefPos), 0, 0, 1, 1},
  {&__pyx_n_s__nReadsPerSample, __pyx_k__nReadsPerSample, sizeof(__pyx_k__nReadsPerSample), 0, 0, 1, 1},
  {&__pyx_n_s__nVarReadsPerSample, __pyx_k__nVarReadsPerSample, sizeof(__pyx_k__nVarReadsPerSample), 0, 0, 1, 1},
  {&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1},
  {&__pyx_n_s__options, __pyx_k__options, sizeof(__pyx_k__options), 0, 0, 1, 1},
  {&__pyx_n_s__outputFile, __pyx_k__outputFile, sizeof(__pyx_k__outputFile), 0, 0, 1, 1},
  {&__pyx_n_s__outputRefCalls, __pyx_k__outputRefCalls, sizeof(__pyx_k__outputRefCalls), 0, 0, 1, 1},
  {&__pyx_n_s__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1},
  {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1},
  {&__pyx_n_s__qdThreshold, __pyx_k__qdThreshold, sizeof(__pyx_k__qdThreshold), 0, 0, 1, 1},
  {&__pyx_n_s__qual, __pyx_k__qual, sizeof(__pyx_k__qual), 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_n_s__refName, __pyx_k__refName, sizeof(__pyx_k__refName), 0, 0, 1, 1},
  {&__pyx_n_s__reverse, __pyx_k__reverse, sizeof(__pyx_k__reverse), 0, 0, 1, 1},
  {&__pyx_n_s__rmsmqThreshold, __pyx_k__rmsmqThreshold, sizeof(__pyx_k__rmsmqThreshold), 0, 0, 1, 1},
  {&__pyx_n_s__round, __pyx_k__round, sizeof(__pyx_k__round), 0, 0, 1, 1},
  {&__pyx_n_s__sbThreshold, __pyx_k__sbThreshold, sizeof(__pyx_k__sbThreshold), 0, 0, 1, 1},
  {&__pyx_n_s__scThreshold, __pyx_k__scThreshold, sizeof(__pyx_k__scThreshold), 0, 0, 1, 1},
  {&__pyx_n_s__secondAltChars, __pyx_k__secondAltChars, sizeof(__pyx_k__secondAltChars), 0, 0, 1, 1},
  {&__pyx_n_s__send, __pyx_k__send, sizeof(__pyx_k__send), 0, 0, 1, 1},
  {&__pyx_n_s__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 0, 0, 1, 1},
  {&__pyx_n_s__strandBias, __pyx_k__strandBias, sizeof(__pyx_k__strandBias), 0, 0, 1, 1},
  {&__pyx_n_s__sum, __pyx_k__sum, sizeof(__pyx_k__sum), 0, 0, 1, 1},
  {&__pyx_n_s__throw, __pyx_k__throw, sizeof(__pyx_k__throw), 0, 0, 1, 1},
  {&__pyx_n_s__trimLeftPadding, __pyx_k__trimLeftPadding, sizeof(__pyx_k__trimLeftPadding), 0, 0, 1, 1},
  {&__pyx_n_s__upper, __pyx_k__upper, sizeof(__pyx_k__upper), 0, 0, 1, 1},
  {&__pyx_n_s__values, __pyx_k__values, sizeof(__pyx_k__values), 0, 0, 1, 1},
  {&__pyx_n_s__vcf, __pyx_k__vcf, sizeof(__pyx_k__vcf), 0, 0, 1, 1},
  {&__pyx_n_s__vcfDataLine, __pyx_k__vcfDataLine, sizeof(__pyx_k__vcfDataLine), 0, 0, 1, 1},
  {&__pyx_n_s__vcfFile, __pyx_k__vcfFile, sizeof(__pyx_k__vcfFile), 0, 0, 1, 1},
  {&__pyx_n_s__vcfFilterSignature, __pyx_k__vcfFilterSignature, sizeof(__pyx_k__vcfFilterSignature), 0, 0, 1, 1},
  {&__pyx_n_s__vcfFormatSignature, __pyx_k__vcfFormatSignature, sizeof(__pyx_k__vcfFormatSignature), 0, 0, 1, 1},
  {&__pyx_n_s__vcfInfoSignature, __pyx_k__vcfInfoSignature, sizeof(__pyx_k__vcfInfoSignature), 0, 0, 1, 1},
  {&__pyx_n_s__vcfutils, __pyx_k__vcfutils, sizeof(__pyx_k__vcfutils), 0, 0, 1, 1},
  {&__pyx_n_s__verbosity, __pyx_k__verbosity, sizeof(__pyx_k__verbosity), 0, 0, 1, 1},
  {&__pyx_n_s__warning, __pyx_k__warning, sizeof(__pyx_k__warning), 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__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_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __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 = 386; __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 = 409; __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 = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s__round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __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 = 661; __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 = 714; __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 = 810; __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 = 1473; __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 = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s__sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __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);

  /* "vcfutils.pyx":431
 *         if options.verbosity >= 3:
 *             logger.debug("Haps are %s" %(haplotypes))
 *             logger.debug("Logging mutated sequences...")             # <<<<<<<<<<<<<<
 *             logger.debug("Lengths are %s" %([len(str(haplotype.getMutatedSequence())) for haplotype in haplotypes]))
 * 
 */
  __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_3);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));

  /* "vcfutils.pyx":435
 * 
 *             for haplotype in haplotypes:
 *                 logger.debug(str(haplotype.getMutatedSequence())[50:-50])             # <<<<<<<<<<<<<<
 * 
 *             logger.debug("Unfiltered variants are %s" %(sorted(variants)))
 */
  __pyx_k_slice_5 = PySlice_New(__pyx_int_50, __pyx_int_neg_50, Py_None); if (unlikely(!__pyx_k_slice_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_5);
  __Pyx_GIVEREF(__pyx_k_slice_5);

  /* "vcfutils.pyx":557
 * 
 *         # These are just temporary values. Don't output them
 *         vcfDataLine['info'].pop('nReadsPerSample')             # <<<<<<<<<<<<<<
 *         vcfDataLine['info'].pop('nVarReadsPerSample')
 *         vcfDataLine['info'].pop('ABPV')
 */
  __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__nReadsPerSample)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_14);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));

  /* "vcfutils.pyx":558
 *         # These are just temporary values. Don't output them
 *         vcfDataLine['info'].pop('nReadsPerSample')
 *         vcfDataLine['info'].pop('nVarReadsPerSample')             # <<<<<<<<<<<<<<
 *         vcfDataLine['info'].pop('ABPV')
 *         vcfDataLine['info']['MGOF'] = [int(round(maxGofValue, 2))]
 */
  __pyx_k_tuple_15 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__nVarReadsPerSample)); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_15);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));

  /* "vcfutils.pyx":559
 *         vcfDataLine['info'].pop('nReadsPerSample')
 *         vcfDataLine['info'].pop('nVarReadsPerSample')
 *         vcfDataLine['info'].pop('ABPV')             # <<<<<<<<<<<<<<
 *         vcfDataLine['info']['MGOF'] = [int(round(maxGofValue, 2))]
 * 
 */
  __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ABPV)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_16);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));

  /* "vcfutils.pyx":656
 * 
 *     varSource = set()
 *     logger.debug("Start output to vcf")             # <<<<<<<<<<<<<<
 *     ref = ''
 *     memset(gof, 0, sizeof(double)* (nIndividuals+3))
 */
  __pyx_k_tuple_20 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_19)); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_20);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));

  /* "vcfutils.pyx":792
 *     outputFile.write("%s\n" %(theLine))
 *     free(gof)
 *     logger.debug('Out vcf writing')             # <<<<<<<<<<<<<<
 * ###################################################################################################
 * 
 */
  __pyx_k_tuple_34 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_34);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));

  /* "vcfutils.pyx":833
 * 
 *             # Trim one base from ref and all alts, and adjust position
 *             ref, alt = ref[1:], [allele[1:] for allele in alt]             # <<<<<<<<<<<<<<
 *             vcfDataLine['pos'] += 1
 * 
 */
  __pyx_k_slice_35 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_35);
  __Pyx_GIVEREF(__pyx_k_slice_35);
  __pyx_k_slice_36 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_36);
  __Pyx_GIVEREF(__pyx_k_slice_36);

  /* "vcfutils.pyx":1496
 * 
 *     cdef int lenSeq = len(sequence)
 *     cdef int nCharsFromTop2Bases = sum([x[0] for x in sorted( [(nChars,base) for base,nChars in counter.iteritems()], reverse=True)[0:2] ])             # <<<<<<<<<<<<<<
 *     cdef double SC = <double>(nCharsFromTop2Bases)/<double>(lenSeq)
 *     return SC
 */
  __pyx_k_slice_40 = PySlice_New(__pyx_int_0, __pyx_int_2, Py_None); if (unlikely(!__pyx_k_slice_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_slice_40);
  __Pyx_GIVEREF(__pyx_k_slice_40);

  /* "vcfutils.pyx":35
 * from htslibWrapper cimport Read_SetQCFail
 * 
 * logger = logging.getLogger("Log")             # <<<<<<<<<<<<<<
 * 
 * canonicalBases = set(["A", "C", "T", "G"])
 */
  __pyx_k_tuple_42 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__Log)); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_42);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));

  /* "vcfutils.pyx":73
 * # Definititons for the individual and filter fields included in the header
 * vcfInfoSignature = {
 *     "FR":vcf.FORMAT('FR',1,".",'Float','Estimated population frequency of variant',-1),             # <<<<<<<<<<<<<<
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),
 */
  __pyx_k_tuple_44 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__FR), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_43), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_44);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));

  /* "vcfutils.pyx":74
 * vcfInfoSignature = {
 *     "FR":vcf.FORMAT('FR',1,".",'Float','Estimated population frequency of variant',-1),
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),             # <<<<<<<<<<<<<<
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),
 */
  __pyx_k_tuple_46 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__PP), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_45), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_46);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));

  /* "vcfutils.pyx":75
 *     "FR":vcf.FORMAT('FR',1,".",'Float','Estimated population frequency of variant',-1),
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),             # <<<<<<<<<<<<<<
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),
 */
  __pyx_k_tuple_48 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__TC), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_47), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_48);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));

  /* "vcfutils.pyx":76
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),             # <<<<<<<<<<<<<<
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),
 */
  __pyx_k_tuple_50 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__WS), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_49), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_50);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));

  /* "vcfutils.pyx":77
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),             # <<<<<<<<<<<<<<
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),
 */
  __pyx_k_tuple_52 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__WE), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_51), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_52);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));

  /* "vcfutils.pyx":78
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),             # <<<<<<<<<<<<<<
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),
 */
  __pyx_k_tuple_54 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__TCR), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_53), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_54);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));

  /* "vcfutils.pyx":79
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),             # <<<<<<<<<<<<<<
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),
 */
  __pyx_k_tuple_56 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__TCF), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_55), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));

  /* "vcfutils.pyx":80
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),             # <<<<<<<<<<<<<<
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),
 */
  __pyx_k_tuple_58 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__TR), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_57), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_58);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));

  /* "vcfutils.pyx":81
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),             # <<<<<<<<<<<<<<
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),
 */
  __pyx_k_tuple_60 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__NF), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_59), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_60);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));

  /* "vcfutils.pyx":82
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),             # <<<<<<<<<<<<<<
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),
 */
  __pyx_k_tuple_62 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__NR), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_61), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_62);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));

  /* "vcfutils.pyx":83
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),             # <<<<<<<<<<<<<<
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),
 */
  __pyx_k_tuple_64 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__MGOF), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_63), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_64);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));

  /* "vcfutils.pyx":84
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),             # <<<<<<<<<<<<<<
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),
 */
  __pyx_k_tuple_66 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__SC), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__String), ((PyObject *)__pyx_kp_s_65), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_66);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_66));

  /* "vcfutils.pyx":85
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),             # <<<<<<<<<<<<<<
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),
 */
  __pyx_k_tuple_68 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__HP), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_67), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_68);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));

  /* "vcfutils.pyx":86
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),             # <<<<<<<<<<<<<<
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),
 */
  __pyx_k_tuple_70 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__BRF), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_69), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_70);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));

  /* "vcfutils.pyx":87
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),             # <<<<<<<<<<<<<<
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),
 */
  __pyx_k_tuple_72 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__MMLQ), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_71), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_72);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));

  /* "vcfutils.pyx":88
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),             # <<<<<<<<<<<<<<
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),
 */
  __pyx_k_tuple_74 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__QD), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_73), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_74);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));

  /* "vcfutils.pyx":89
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),             # <<<<<<<<<<<<<<
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),
 */
  __pyx_k_tuple_76 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__Source), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__String), ((PyObject *)__pyx_kp_s_75), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_76);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));

  /* "vcfutils.pyx":90
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),             # <<<<<<<<<<<<<<
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),
 */
  __pyx_k_tuple_78 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__START), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_77), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_78);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_78));

  /* "vcfutils.pyx":91
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),             # <<<<<<<<<<<<<<
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),
 */
  __pyx_k_tuple_80 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__END), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_79), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_80);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));

  /* "vcfutils.pyx":92
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),             # <<<<<<<<<<<<<<
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),
 */
  __pyx_k_tuple_82 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__Size), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_81), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_82);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));

  /* "vcfutils.pyx":93
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),             # <<<<<<<<<<<<<<
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),
 *     "FS":vcf.FORMAT('FS',1,".",'Float','Fisher\'s exact test for strand bias (Phred scale)',-1),
 */
  __pyx_k_tuple_84 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__HapScore), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_83), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_84);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));

  /* "vcfutils.pyx":94
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),             # <<<<<<<<<<<<<<
 *     "FS":vcf.FORMAT('FS',1,".",'Float','Fisher\'s exact test for strand bias (Phred scale)',-1),
 *     "SbPval":vcf.FORMAT('SbPval',1,".",'Float','Binomial P-value for strand bias test',-1),
 */
  __pyx_k_tuple_86 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__MQ), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_85), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_86);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_86));

  /* "vcfutils.pyx":95
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),
 *     "FS":vcf.FORMAT('FS',1,".",'Float','Fisher\'s exact test for strand bias (Phred scale)',-1),             # <<<<<<<<<<<<<<
 *     "SbPval":vcf.FORMAT('SbPval',1,".",'Float','Binomial P-value for strand bias test',-1),
 * #   "MQRankSum":vcf.FORMAT('MQRankSum',1,".",'Float','Mann-Whitney Rank sum test for mapping quality difference between ref and alt (Phred scale)',-1),
 */
  __pyx_k_tuple_88 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__FS), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_87), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_88);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_88));

  /* "vcfutils.pyx":96
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),
 *     "FS":vcf.FORMAT('FS',1,".",'Float','Fisher\'s exact test for strand bias (Phred scale)',-1),
 *     "SbPval":vcf.FORMAT('SbPval',1,".",'Float','Binomial P-value for strand bias test',-1),             # <<<<<<<<<<<<<<
 * #   "MQRankSum":vcf.FORMAT('MQRankSum',1,".",'Float','Mann-Whitney Rank sum test for mapping quality difference between ref and alt (Phred scale)',-1),
 *     "ReadPosRankSum":vcf.FORMAT('ReadPosRankSum',1,".",'Float','Mann-Whitney Rank sum test for difference between in positions of variants in reads from ref and alt',-1),
 */
  __pyx_k_tuple_90 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__SbPval), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_89), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_90);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_90));

  /* "vcfutils.pyx":98
 *     "SbPval":vcf.FORMAT('SbPval',1,".",'Float','Binomial P-value for strand bias test',-1),
 * #   "MQRankSum":vcf.FORMAT('MQRankSum',1,".",'Float','Mann-Whitney Rank sum test for mapping quality difference between ref and alt (Phred scale)',-1),
 *     "ReadPosRankSum":vcf.FORMAT('ReadPosRankSum',1,".",'Float','Mann-Whitney Rank sum test for difference between in positions of variants in reads from ref and alt',-1),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_k_tuple_92 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__ReadPosRankSum), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_91), __pyx_int_neg_1); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_92);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_92));

  /* "vcfutils.pyx":102
 * 
 * vcfFilterSignature = {
 *     "alleleBias":vcf.FORMAT('alleleBias',1,0,'Flag','Variant frequency is lower than expected for het','.'),             # <<<<<<<<<<<<<<
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),
 */
  __pyx_k_tuple_94 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__alleleBias), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_93), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_94);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));

  /* "vcfutils.pyx":103
 * vcfFilterSignature = {
 *     "alleleBias":vcf.FORMAT('alleleBias',1,0,'Flag','Variant frequency is lower than expected for het','.'),
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),             # <<<<<<<<<<<<<<
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),
 */
  __pyx_k_tuple_96 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__strandBias), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_95), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_96);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));

  /* "vcfutils.pyx":104
 *     "alleleBias":vcf.FORMAT('alleleBias',1,0,'Flag','Variant frequency is lower than expected for het','.'),
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),             # <<<<<<<<<<<<<<
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),
 */
  __pyx_k_tuple_98 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__badReads), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_97), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_98);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));

  /* "vcfutils.pyx":105
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),             # <<<<<<<<<<<<<<
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),
 */
  __pyx_k_tuple_100 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__MQ), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_99), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_100);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));

  /* "vcfutils.pyx":106
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),             # <<<<<<<<<<<<<<
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),
 */
  __pyx_k_tuple_102 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__Q20), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_101), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_102);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));

  /* "vcfutils.pyx":107
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),             # <<<<<<<<<<<<<<
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),
 */
  __pyx_k_tuple_104 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__HapScore), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_103), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_104);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));

  /* "vcfutils.pyx":108
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),             # <<<<<<<<<<<<<<
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),
 */
  __pyx_k_tuple_106 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__QualDepth), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_105), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_106);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106));

  /* "vcfutils.pyx":109
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),             # <<<<<<<<<<<<<<
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),
 */
  __pyx_k_tuple_108 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__GOF), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_107), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_108);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));

  /* "vcfutils.pyx":110
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),             # <<<<<<<<<<<<<<
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),
 *     "QD":vcf.FORMAT('QD',1,0,'Flag','Variants fail quality/depth filter.','.'),
 */
  __pyx_k_tuple_110 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__hp10), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_109), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_110);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_110));

  /* "vcfutils.pyx":111
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),             # <<<<<<<<<<<<<<
 *     "QD":vcf.FORMAT('QD',1,0,'Flag','Variants fail quality/depth filter.','.'),
 *     "SC":vcf.FORMAT('SC',1,0,'Flag','Variants fail sequence-context filter. Surrounding sequence is low-complexity','.'),
 */
  __pyx_k_tuple_112 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__REFCALL), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_112);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_112));

  /* "vcfutils.pyx":112
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),
 *     "QD":vcf.FORMAT('QD',1,0,'Flag','Variants fail quality/depth filter.','.'),             # <<<<<<<<<<<<<<
 *     "SC":vcf.FORMAT('SC',1,0,'Flag','Variants fail sequence-context filter. Surrounding sequence is low-complexity','.'),
 * }
 */
  __pyx_k_tuple_114 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__QD), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_113), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_114);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_114));

  /* "vcfutils.pyx":113
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),
 *     "QD":vcf.FORMAT('QD',1,0,'Flag','Variants fail quality/depth filter.','.'),
 *     "SC":vcf.FORMAT('SC',1,0,'Flag','Variants fail sequence-context filter. Surrounding sequence is low-complexity','.'),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_k_tuple_116 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__SC), __pyx_int_1, __pyx_int_0, ((PyObject *)__pyx_n_s__Flag), ((PyObject *)__pyx_kp_s_115), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_116);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_116));

  /* "vcfutils.pyx":117
 * 
 * vcfFormatSignature = {
 *     "GT":vcf.FORMAT('GT',1,1,'String','Unphased genotypes','.'),             # <<<<<<<<<<<<<<
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),
 */
  __pyx_k_tuple_118 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__GT), __pyx_int_1, __pyx_int_1, ((PyObject *)__pyx_n_s__String), ((PyObject *)__pyx_kp_s_117), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_118);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_118));

  /* "vcfutils.pyx":118
 * vcfFormatSignature = {
 *     "GT":vcf.FORMAT('GT',1,1,'String','Unphased genotypes','.'),
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),             # <<<<<<<<<<<<<<
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),
 */
  __pyx_k_tuple_120 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__GL), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_119), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_120);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_120));

  /* "vcfutils.pyx":119
 *     "GT":vcf.FORMAT('GT',1,1,'String','Unphased genotypes','.'),
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),             # <<<<<<<<<<<<<<
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),
 *     "NR":vcf.FORMAT('NR',1,'.','Integer','Number of reads covering variant location in this sample','.'),
 */
  __pyx_k_tuple_122 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__GQ), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_121), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_122);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122));

  /* "vcfutils.pyx":120
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),             # <<<<<<<<<<<<<<
 *     "NR":vcf.FORMAT('NR',1,'.','Integer','Number of reads covering variant location in this sample','.'),
 *     "NV":vcf.FORMAT('NV',1,'.','Integer','Number of reads containing variant in this sample','.'),
 */
  __pyx_k_tuple_124 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__GOF), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Float), ((PyObject *)__pyx_kp_s_123), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_124);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_124));

  /* "vcfutils.pyx":121
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),
 *     "NR":vcf.FORMAT('NR',1,'.','Integer','Number of reads covering variant location in this sample','.'),             # <<<<<<<<<<<<<<
 *     "NV":vcf.FORMAT('NV',1,'.','Integer','Number of reads containing variant in this sample','.'),
 * }
 */
  __pyx_k_tuple_126 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__NR), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_125), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_126);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_126));

  /* "vcfutils.pyx":122
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),
 *     "NR":vcf.FORMAT('NR',1,'.','Integer','Number of reads covering variant location in this sample','.'),
 *     "NV":vcf.FORMAT('NV',1,'.','Integer','Number of reads containing variant in this sample','.'),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_k_tuple_128 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__NV), __pyx_int_1, ((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_n_s__Integer), ((PyObject *)__pyx_kp_s_127), ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_128);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_128));

  /* "vcfutils.pyx":127
 * ###################################################################################################
 * 
 * def outputSingleLineOfVCF(dict data, object outputFile, object vcfFile, options):             # <<<<<<<<<<<<<<
 *     """
 *     """
 */
  __pyx_k_tuple_129 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__outputFile), ((PyObject *)__pyx_n_s__vcfFile), ((PyObject *)__pyx_n_s__options)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_129);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_129));
  __pyx_k_codeobj_130 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_131, __pyx_n_s_18, 127, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "vcfutils.pyx":796
 * 
 * 
 * def trimLeftPadding(vcfDataLine):             # <<<<<<<<<<<<<<
 *     """
 *     This is a small hack to make sure that no un-needed left padding is left
 */
  __pyx_k_tuple_132 = PyTuple_Pack(13, ((PyObject *)__pyx_n_s__vcfDataLine), ((PyObject *)__pyx_n_s__ref), ((PyObject *)__pyx_n_s__alt), ((PyObject *)__pyx_n_s__minLenRefAlt), ((PyObject *)__pyx_n_s__maxLenDiff), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__firstAltChars), ((PyObject *)__pyx_n_s__secondAltChars), ((PyObject *)__pyx_n_s__firstRefChar), ((PyObject *)__pyx_n_s__allele), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr), ((PyObject *)__pyx_n_s__genexpr)); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_132);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_132));
  __pyx_k_codeobj_133 = (PyObject*)__Pyx_PyCode_New(1, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_131, __pyx_n_s__trimLeftPadding, 796, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __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_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;};
  __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_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_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_50 = PyInt_FromLong(-50); if (unlikely(!__pyx_int_neg_50)) {__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;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initvcfutils(void); /*proto*/
PyMODINIT_FUNC initvcfutils(void)
#else
PyMODINIT_FUNC PyInit_vcfutils(void); /*proto*/
PyMODINIT_FUNC PyInit_vcfutils(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_vcfutils(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("vcfutils"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_41), 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);
  #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, "vcfutils")) {
      if (unlikely(PyDict_SetItemString(modules, "vcfutils", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __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_vcfutils) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("outputCallToVCF", (void (*)(void))__pyx_f_8vcfutils_outputCallToVCF, "void (PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, double *, double **, double **, int **, PyObject *, int, PyObject *, struct __pyx_obj_9fastafile_FastaFile *, PyObject *, PyObject *, PyObject *, int, int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("refAndAlt", (void (*)(void))__pyx_f_8vcfutils_refAndAlt, "PyObject *(char *, int, PyObject *, struct __pyx_obj_9fastafile_FastaFile *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("vcfINFO", (void (*)(void))__pyx_f_8vcfutils_vcfINFO, "PyObject *(double *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *, struct __pyx_obj_9fastafile_FastaFile *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("vcfFILTER", (void (*)(void))__pyx_f_8vcfutils_vcfFILTER, "PyObject *(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("outputHLACallToVCF", (void (*)(void))__pyx_f_8vcfutils_outputHLACallToVCF, "void (PyObject *, PyObject *, int, struct __pyx_obj_9fastafile_FastaFile *, PyObject *, PyObject *, int, int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_8vcfutils___pyx_scope_struct__trimLeftPadding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8vcfutils___pyx_scope_struct__trimLeftPadding = &__pyx_type_8vcfutils___pyx_scope_struct__trimLeftPadding;
  if (PyType_Ready(&__pyx_type_8vcfutils___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8vcfutils___pyx_scope_struct_2_genexpr = &__pyx_type_8vcfutils___pyx_scope_struct_2_genexpr;
  if (PyType_Ready(&__pyx_type_8vcfutils___pyx_scope_struct_1_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_8vcfutils___pyx_scope_struct_1_genexpr = &__pyx_type_8vcfutils___pyx_scope_struct_1_genexpr;
  /*--- Type import code ---*/
  __pyx_ptype_9fastafile_FastaIndex = __Pyx_ImportType("fastafile", "FastaIndex", sizeof(struct __pyx_obj_9fastafile_FastaIndex), 1); if (unlikely(!__pyx_ptype_9fastafile_FastaIndex)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9fastafile_FastaIndex = (struct __pyx_vtabstruct_9fastafile_FastaIndex*)__Pyx_GetVtable(__pyx_ptype_9fastafile_FastaIndex->tp_dict); if (unlikely(!__pyx_vtabptr_9fastafile_FastaIndex)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9fastafile_FastaFile = __Pyx_ImportType("fastafile", "FastaFile", sizeof(struct __pyx_obj_9fastafile_FastaFile), 1); if (unlikely(!__pyx_ptype_9fastafile_FastaFile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9fastafile_FastaFile = (struct __pyx_vtabstruct_9fastafile_FastaFile*)__Pyx_GetVtable(__pyx_ptype_9fastafile_FastaFile->tp_dict); if (unlikely(!__pyx_vtabptr_9fastafile_FastaFile)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; __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[2]; __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[3]; __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[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_13htslibWrapper_Samfile = __Pyx_ImportType("htslibWrapper", "Samfile", sizeof(struct __pyx_obj_13htslibWrapper_Samfile), 1); if (unlikely(!__pyx_ptype_13htslibWrapper_Samfile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_13htslibWrapper_Samfile = (struct __pyx_vtabstruct_13htslibWrapper_Samfile*)__Pyx_GetVtable(__pyx_ptype_13htslibWrapper_Samfile->tp_dict); if (unlikely(!__pyx_vtabptr_13htslibWrapper_Samfile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_13htslibWrapper_ReadIterator = __Pyx_ImportType("htslibWrapper", "ReadIterator", sizeof(struct __pyx_obj_13htslibWrapper_ReadIterator), 1); if (unlikely(!__pyx_ptype_13htslibWrapper_ReadIterator)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_13htslibWrapper_ReadIterator = (struct __pyx_vtabstruct_13htslibWrapper_ReadIterator*)__Pyx_GetVtable(__pyx_ptype_13htslibWrapper_ReadIterator->tp_dict); if (unlikely(!__pyx_vtabptr_13htslibWrapper_ReadIterator)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7variant_Variant = __Pyx_ImportType("variant", "Variant", sizeof(struct __pyx_obj_7variant_Variant), 1); if (unlikely(!__pyx_ptype_7variant_Variant)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_7variant_Variant = (struct __pyx_vtabstruct_7variant_Variant*)__Pyx_GetVtable(__pyx_ptype_7variant_Variant->tp_dict); if (unlikely(!__pyx_vtabptr_7variant_Variant)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7variant_VariantCandidateGenerator = __Pyx_ImportType("variant", "VariantCandidateGenerator", sizeof(struct __pyx_obj_7variant_VariantCandidateGenerator), 1); if (unlikely(!__pyx_ptype_7variant_VariantCandidateGenerator)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_7variant_VariantCandidateGenerator = (struct __pyx_vtabstruct_7variant_VariantCandidateGenerator*)__Pyx_GetVtable(__pyx_ptype_7variant_VariantCandidateGenerator->tp_dict); if (unlikely(!__pyx_vtabptr_7variant_VariantCandidateGenerator)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cwindow_ReadArray = __Pyx_ImportType("cwindow", "ReadArray", sizeof(struct __pyx_obj_7cwindow_ReadArray), 1); if (unlikely(!__pyx_ptype_7cwindow_ReadArray)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_7cwindow_ReadArray = (struct __pyx_vtabstruct_7cwindow_ReadArray*)__Pyx_GetVtable(__pyx_ptype_7cwindow_ReadArray->tp_dict); if (unlikely(!__pyx_vtabptr_7cwindow_ReadArray)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cwindow_bamReadBuffer = __Pyx_ImportType("cwindow", "bamReadBuffer", sizeof(struct __pyx_obj_7cwindow_bamReadBuffer), 1); if (unlikely(!__pyx_ptype_7cwindow_bamReadBuffer)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_7cwindow_bamReadBuffer = (struct __pyx_vtabstruct_7cwindow_bamReadBuffer*)__Pyx_GetVtable(__pyx_ptype_7cwindow_bamReadBuffer->tp_dict); if (unlikely(!__pyx_vtabptr_7cwindow_bamReadBuffer)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_11cpopulation_Population = __Pyx_ImportType("cpopulation", "Population", sizeof(struct __pyx_obj_11cpopulation_Population), 1); if (unlikely(!__pyx_ptype_11cpopulation_Population)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_11cpopulation_Population = (struct __pyx_vtabstruct_11cpopulation_Population*)__Pyx_GetVtable(__pyx_ptype_11cpopulation_Population->tp_dict); if (unlikely(!__pyx_vtabptr_11cpopulation_Population)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_10chaplotype_Haplotype = __Pyx_ImportType("chaplotype", "Haplotype", sizeof(struct __pyx_obj_10chaplotype_Haplotype), 1); if (unlikely(!__pyx_ptype_10chaplotype_Haplotype)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_10chaplotype_Haplotype = (struct __pyx_vtabstruct_10chaplotype_Haplotype*)__Pyx_GetVtable(__pyx_ptype_10chaplotype_Haplotype->tp_dict); if (unlikely(!__pyx_vtabptr_10chaplotype_Haplotype)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9cgenotype_DiploidGenotype = __Pyx_ImportType("cgenotype", "DiploidGenotype", sizeof(struct __pyx_obj_9cgenotype_DiploidGenotype), 1); if (unlikely(!__pyx_ptype_9cgenotype_DiploidGenotype)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9cgenotype_DiploidGenotype = (struct __pyx_vtabstruct_9cgenotype_DiploidGenotype*)__Pyx_GetVtable(__pyx_ptype_9cgenotype_DiploidGenotype->tp_dict); if (unlikely(!__pyx_vtabptr_9cgenotype_DiploidGenotype)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9cgenotype_HaploidGenotype = __Pyx_ImportType("cgenotype", "HaploidGenotype", sizeof(struct __pyx_obj_9cgenotype_HaploidGenotype), 1); if (unlikely(!__pyx_ptype_9cgenotype_HaploidGenotype)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_9cgenotype_HaploidGenotype = (struct __pyx_vtabstruct_9cgenotype_HaploidGenotype*)__Pyx_GetVtable(__pyx_ptype_9cgenotype_HaploidGenotype->tp_dict); if (unlikely(!__pyx_vtabptr_9cgenotype_HaploidGenotype)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("variant"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "PLATYPUS_VAR", (void **)&__pyx_vp_7variant_PLATYPUS_VAR, "int") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "FILE_VAR", (void **)&__pyx_vp_7variant_FILE_VAR, "int") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "ASSEMBLER_VAR", (void **)&__pyx_vp_7variant_ASSEMBLER_VAR, "int") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*--- Function import code ---*/
  __pyx_t_2 = __Pyx_ImportModule("platypusutils"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "binomial", (void (**)(void))&__pyx_f_13platypusutils_binomial, "double (int, int, double)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "betaBinomialCDF", (void (**)(void))&__pyx_f_13platypusutils_betaBinomialCDF, "double (int, int, int, int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /*--- Execution code ---*/

  /* "vcfutils.pyx":6
 * """
 * 
 * import logging             # <<<<<<<<<<<<<<
 * import vcf
 * 
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__logging), 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__logging, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vcfutils.pyx":7
 * 
 * import logging
 * import vcf             # <<<<<<<<<<<<<<
 * 
 * cimport fastafile
 */
  __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__vcf), 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__vcf, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vcfutils.pyx":35
 * from htslibWrapper cimport Read_SetQCFail
 * 
 * logger = logging.getLogger("Log")             # <<<<<<<<<<<<<<
 * 
 * canonicalBases = set(["A", "C", "T", "G"])
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logging); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__getLogger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__logger, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vcfutils.pyx":37
 * logger = logging.getLogger("Log")
 * 
 * canonicalBases = set(["A", "C", "T", "G"])             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  if (PySet_Add(__pyx_t_3, ((PyObject *)__pyx_n_s__A)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PySet_Add(__pyx_t_3, ((PyObject *)__pyx_n_s__C)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PySet_Add(__pyx_t_3, ((PyObject *)__pyx_n_s__T)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PySet_Add(__pyx_t_3, ((PyObject *)__pyx_n_s__G)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__canonicalBases, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "vcfutils.pyx":58
 * 
 * # Nasty global variables
 * cdef double LOG10_E = log10(exp(1.0))             # <<<<<<<<<<<<<<
 * cdef int CIGAR_M = 0 # Match
 * cdef int CIGAR_I = 1 # Insertion
 */
  __pyx_v_8vcfutils_LOG10_E = log10(exp(1.0));

  /* "vcfutils.pyx":59
 * # Nasty global variables
 * cdef double LOG10_E = log10(exp(1.0))
 * cdef int CIGAR_M = 0 # Match             # <<<<<<<<<<<<<<
 * cdef int CIGAR_I = 1 # Insertion
 * cdef int CIGAR_D = 2 # Deletion
 */
  __pyx_v_8vcfutils_CIGAR_M = 0;

  /* "vcfutils.pyx":60
 * cdef double LOG10_E = log10(exp(1.0))
 * cdef int CIGAR_M = 0 # Match
 * cdef int CIGAR_I = 1 # Insertion             # <<<<<<<<<<<<<<
 * cdef int CIGAR_D = 2 # Deletion
 * cdef int CIGAR_N = 3 # Skipped region from reference
 */
  __pyx_v_8vcfutils_CIGAR_I = 1;

  /* "vcfutils.pyx":61
 * cdef int CIGAR_M = 0 # Match
 * cdef int CIGAR_I = 1 # Insertion
 * cdef int CIGAR_D = 2 # Deletion             # <<<<<<<<<<<<<<
 * cdef int CIGAR_N = 3 # Skipped region from reference
 * cdef int CIGAR_S = 4 # Soft clipping. Sequence is present in read
 */
  __pyx_v_8vcfutils_CIGAR_D = 2;

  /* "vcfutils.pyx":62
 * cdef int CIGAR_I = 1 # Insertion
 * cdef int CIGAR_D = 2 # Deletion
 * cdef int CIGAR_N = 3 # Skipped region from reference             # <<<<<<<<<<<<<<
 * cdef int CIGAR_S = 4 # Soft clipping. Sequence is present in read
 * cdef int CIGAR_H = 5 # Hard clipping. Sequence is not present in read
 */
  __pyx_v_8vcfutils_CIGAR_N = 3;

  /* "vcfutils.pyx":63
 * cdef int CIGAR_D = 2 # Deletion
 * cdef int CIGAR_N = 3 # Skipped region from reference
 * cdef int CIGAR_S = 4 # Soft clipping. Sequence is present in read             # <<<<<<<<<<<<<<
 * cdef int CIGAR_H = 5 # Hard clipping. Sequence is not present in read
 * cdef int CIGAR_P = 6 # Padding. Used for padded alignment
 */
  __pyx_v_8vcfutils_CIGAR_S = 4;

  /* "vcfutils.pyx":64
 * cdef int CIGAR_N = 3 # Skipped region from reference
 * cdef int CIGAR_S = 4 # Soft clipping. Sequence is present in read
 * cdef int CIGAR_H = 5 # Hard clipping. Sequence is not present in read             # <<<<<<<<<<<<<<
 * cdef int CIGAR_P = 6 # Padding. Used for padded alignment
 * cdef int CIGAR_EQ = 7 # Alignment match; sequence match
 */
  __pyx_v_8vcfutils_CIGAR_H = 5;

  /* "vcfutils.pyx":65
 * cdef int CIGAR_S = 4 # Soft clipping. Sequence is present in read
 * cdef int CIGAR_H = 5 # Hard clipping. Sequence is not present in read
 * cdef int CIGAR_P = 6 # Padding. Used for padded alignment             # <<<<<<<<<<<<<<
 * cdef int CIGAR_EQ = 7 # Alignment match; sequence match
 * cdef int CIGAR_X = 8 # Alignment match; sequence mismatch
 */
  __pyx_v_8vcfutils_CIGAR_P = 6;

  /* "vcfutils.pyx":66
 * cdef int CIGAR_H = 5 # Hard clipping. Sequence is not present in read
 * cdef int CIGAR_P = 6 # Padding. Used for padded alignment
 * cdef int CIGAR_EQ = 7 # Alignment match; sequence match             # <<<<<<<<<<<<<<
 * cdef int CIGAR_X = 8 # Alignment match; sequence mismatch
 * 
 */
  __pyx_v_8vcfutils_CIGAR_EQ = 7;

  /* "vcfutils.pyx":67
 * cdef int CIGAR_P = 6 # Padding. Used for padded alignment
 * cdef int CIGAR_EQ = 7 # Alignment match; sequence match
 * cdef int CIGAR_X = 8 # Alignment match; sequence mismatch             # <<<<<<<<<<<<<<
 * 
 * ###################################################################################################
 */
  __pyx_v_8vcfutils_CIGAR_X = 8;

  /* "vcfutils.pyx":72
 * 
 * # Definititons for the individual and filter fields included in the header
 * vcfInfoSignature = {             # <<<<<<<<<<<<<<
 *     "FR":vcf.FORMAT('FR',1,".",'Float','Estimated population frequency of variant',-1),
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "vcfutils.pyx":73
 * # Definititons for the individual and filter fields included in the header
 * vcfInfoSignature = {
 *     "FR":vcf.FORMAT('FR',1,".",'Float','Estimated population frequency of variant',-1),             # <<<<<<<<<<<<<<
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); 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_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__FR), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":74
 * vcfInfoSignature = {
 *     "FR":vcf.FORMAT('FR',1,".",'Float','Estimated population frequency of variant',-1),
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),             # <<<<<<<<<<<<<<
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_46), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__PP), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":75
 *     "FR":vcf.FORMAT('FR',1,".",'Float','Estimated population frequency of variant',-1),
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),             # <<<<<<<<<<<<<<
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_48), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__TC), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":76
 *     "PP":vcf.FORMAT('PP',1,".",'Float','Posterior probability (phred scaled) that this variant segregates',-1),
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),             # <<<<<<<<<<<<<<
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__WS), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":77
 *     "TC":vcf.FORMAT('TC',1,1,'Integer','Total coverage at this locus',-1),
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),             # <<<<<<<<<<<<<<
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__WE), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":78
 *     "WS":vcf.FORMAT('WS',1,1,'Integer','Starting position of calling window',-1),
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),             # <<<<<<<<<<<<<<
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__TCR), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":79
 *     "WE":vcf.FORMAT('WE',1,1,'Integer','End position of calling window',-1),
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),             # <<<<<<<<<<<<<<
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); 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_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_56), NULL); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__TCF), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":80
 *     "TCR":vcf.FORMAT('TCR',1,1,'Integer','Total reverse strand coverage at this locus',-1),
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),             # <<<<<<<<<<<<<<
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_58), 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_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__TR), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":81
 *     "TCF":vcf.FORMAT('TCF',1,1,'Integer','Total forward strand coverage at this locus',-1),
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),             # <<<<<<<<<<<<<<
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_60), NULL); 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_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__NF), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":82
 *     "TR":vcf.FORMAT('TR',1,".",'Integer','Total number of reads containing this variant',-1),
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),             # <<<<<<<<<<<<<<
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__NR), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":83
 *     "NF":vcf.FORMAT('NF',1,".",'Integer','Total number of forward reads containing this variant',-1),
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),             # <<<<<<<<<<<<<<
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_64), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__MGOF), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":84
 *     "NR":vcf.FORMAT('NR',1,".",'Integer','Total number of reverse reads containing this variant',-1),
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),             # <<<<<<<<<<<<<<
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_66), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__SC), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":85
 *     "MGOF":vcf.FORMAT('MGOF',1,".",'Integer','Worst goodness-of-fit value reported across all samples',-1),
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),             # <<<<<<<<<<<<<<
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_68), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__HP), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":86
 *     "SC":vcf.FORMAT('SC',1,1,'String','Genomic sequence 10 bases either side of variant position',-1),
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),             # <<<<<<<<<<<<<<
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_70), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__BRF), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":87
 *     "HP":vcf.FORMAT('HP',1,1,'Integer','Homopolymer run length around variant locus',-1),
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),             # <<<<<<<<<<<<<<
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_72), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__MMLQ), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":88
 *     "BRF":vcf.FORMAT('BRF',1,1,'Float','Fraction of reads around this variant that failed filters',-1),
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),             # <<<<<<<<<<<<<<
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_74), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__QD), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":89
 *     "MMLQ":vcf.FORMAT('MMLQ',1,1,'Float','Median minimum base quality for bases around variant',-1),
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),             # <<<<<<<<<<<<<<
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__Source), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":90
 *     "QD":vcf.FORMAT('QD',1,1,'Float','Variant-quality/read-depth for this variant',-1),
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),             # <<<<<<<<<<<<<<
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_78), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__START), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":91
 *     "Source":vcf.FORMAT('Source',1,".",'String','Was this variant suggested by Playtypus, Assembler, or from a VCF?',-1),
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),             # <<<<<<<<<<<<<<
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__END), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":92
 *     "START":vcf.FORMAT('START',1,".",'Integer','Start position of reference call block', -1),
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),             # <<<<<<<<<<<<<<
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_82), 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_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__Size), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":93
 *     "END":vcf.FORMAT('END',1,".",'Integer','End position of reference call block', -1),
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),             # <<<<<<<<<<<<<<
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),
 *     "FS":vcf.FORMAT('FS',1,".",'Float','Fisher\'s exact test for strand bias (Phred scale)',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__HapScore), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":94
 *     "Size":vcf.FORMAT('Size',1,".",'Integer','Size of reference call block', -1),
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),             # <<<<<<<<<<<<<<
 *     "FS":vcf.FORMAT('FS',1,".",'Float','Fisher\'s exact test for strand bias (Phred scale)',-1),
 *     "SbPval":vcf.FORMAT('SbPval',1,".",'Float','Binomial P-value for strand bias test',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_86), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__MQ), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":95
 *     "HapScore":vcf.FORMAT('HapScore',1,".",'Integer','Haplotype score measuring the number of haplotypes the variant is segregating into in a window', -1),
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),
 *     "FS":vcf.FORMAT('FS',1,".",'Float','Fisher\'s exact test for strand bias (Phred scale)',-1),             # <<<<<<<<<<<<<<
 *     "SbPval":vcf.FORMAT('SbPval',1,".",'Float','Binomial P-value for strand bias test',-1),
 * #   "MQRankSum":vcf.FORMAT('MQRankSum',1,".",'Float','Mann-Whitney Rank sum test for mapping quality difference between ref and alt (Phred scale)',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_88), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__FS), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":96
 *     "MQ":vcf.FORMAT('MQ',1,".",'Float','Root mean square of mapping qualities of reads at the variant position',-1),
 *     "FS":vcf.FORMAT('FS',1,".",'Float','Fisher\'s exact test for strand bias (Phred scale)',-1),
 *     "SbPval":vcf.FORMAT('SbPval',1,".",'Float','Binomial P-value for strand bias test',-1),             # <<<<<<<<<<<<<<
 * #   "MQRankSum":vcf.FORMAT('MQRankSum',1,".",'Float','Mann-Whitney Rank sum test for mapping quality difference between ref and alt (Phred scale)',-1),
 *     "ReadPosRankSum":vcf.FORMAT('ReadPosRankSum',1,".",'Float','Mann-Whitney Rank sum test for difference between in positions of variants in reads from ref and alt',-1),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__SbPval), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":98
 *     "SbPval":vcf.FORMAT('SbPval',1,".",'Float','Binomial P-value for strand bias test',-1),
 * #   "MQRankSum":vcf.FORMAT('MQRankSum',1,".",'Float','Mann-Whitney Rank sum test for mapping quality difference between ref and alt (Phred scale)',-1),
 *     "ReadPosRankSum":vcf.FORMAT('ReadPosRankSum',1,".",'Float','Mann-Whitney Rank sum test for difference between in positions of variants in reads from ref and alt',-1),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ReadPosRankSum), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__vcfInfoSignature, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "vcfutils.pyx":101
 * }
 * 
 * vcfFilterSignature = {             # <<<<<<<<<<<<<<
 *     "alleleBias":vcf.FORMAT('alleleBias',1,0,'Flag','Variant frequency is lower than expected for het','.'),
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "vcfutils.pyx":102
 * 
 * vcfFilterSignature = {
 *     "alleleBias":vcf.FORMAT('alleleBias',1,0,'Flag','Variant frequency is lower than expected for het','.'),             # <<<<<<<<<<<<<<
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__alleleBias), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":103
 * vcfFilterSignature = {
 *     "alleleBias":vcf.FORMAT('alleleBias',1,0,'Flag','Variant frequency is lower than expected for het','.'),
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),             # <<<<<<<<<<<<<<
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__strandBias), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":104
 *     "alleleBias":vcf.FORMAT('alleleBias',1,0,'Flag','Variant frequency is lower than expected for het','.'),
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),             # <<<<<<<<<<<<<<
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_98), 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_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__badReads), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":105
 *     "strandBias":vcf.FORMAT('strandBias',1,0,'Flag','Variant fails strand-bias filter','.'),
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),             # <<<<<<<<<<<<<<
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__MQ), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":106
 *     "badReads":vcf.FORMAT('badReads',1,0,'Flag','Variant supported only by reads with low quality bases close to variant position, and not present on both strands.','.'),
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),             # <<<<<<<<<<<<<<
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__Q20), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":107
 *     "MQ":vcf.FORMAT('MQ',1,0,'Flag','Root-mean-square mapping quality across calling region is low.','.'),
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),             # <<<<<<<<<<<<<<
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__QualDepth), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":108
 *     "Q20":vcf.FORMAT('Q20',1,0,'Flag','Variant quality is below 20.','.'),
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),             # <<<<<<<<<<<<<<
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); 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);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_106), 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_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__HapScore), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":109
 *     "QualDepth":vcf.FORMAT('HapScore',1,0,'Flag','Too many haplotypes are supported by the data in this region.','.'),
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),             # <<<<<<<<<<<<<<
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GOF), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":110
 *     "HapScore":vcf.FORMAT('QualDepth',1,0,'Flag','Variant quality/Read depth ratio is low.','.'),
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),             # <<<<<<<<<<<<<<
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),
 *     "QD":vcf.FORMAT('QD',1,0,'Flag','Variants fail quality/depth filter.','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__hp10), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":111
 *     "GOF":vcf.FORMAT('GOF',1,0,'Flag','Variant fails goodness-of-fit test.','.'),
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),             # <<<<<<<<<<<<<<
 *     "QD":vcf.FORMAT('QD',1,0,'Flag','Variants fail quality/depth filter.','.'),
 *     "SC":vcf.FORMAT('SC',1,0,'Flag','Variants fail sequence-context filter. Surrounding sequence is low-complexity','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); 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);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__REFCALL), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":112
 *     "hp10":vcf.FORMAT('hp10',1,0,'Flag','Flanking sequence contains homopolymer of length 10 or greater','.'),
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),
 *     "QD":vcf.FORMAT('QD',1,0,'Flag','Variants fail quality/depth filter.','.'),             # <<<<<<<<<<<<<<
 *     "SC":vcf.FORMAT('SC',1,0,'Flag','Variants fail sequence-context filter. Surrounding sequence is low-complexity','.'),
 * }
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); 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_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__QD), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":113
 *     "REFCALL":vcf.FORMAT('REFCALL',1,0,'Flag','This line represents a homozygous reference call','.'),
 *     "QD":vcf.FORMAT('QD',1,0,'Flag','Variants fail quality/depth filter.','.'),
 *     "SC":vcf.FORMAT('SC',1,0,'Flag','Variants fail sequence-context filter. Surrounding sequence is low-complexity','.'),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__SC), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__vcfFilterSignature, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "vcfutils.pyx":116
 * }
 * 
 * vcfFormatSignature = {             # <<<<<<<<<<<<<<
 *     "GT":vcf.FORMAT('GT',1,1,'String','Unphased genotypes','.'),
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),
 */
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));

  /* "vcfutils.pyx":117
 * 
 * vcfFormatSignature = {
 *     "GT":vcf.FORMAT('GT',1,1,'String','Unphased genotypes','.'),             # <<<<<<<<<<<<<<
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_118), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GT), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":118
 * vcfFormatSignature = {
 *     "GT":vcf.FORMAT('GT',1,1,'String','Unphased genotypes','.'),
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),             # <<<<<<<<<<<<<<
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GL), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":119
 *     "GT":vcf.FORMAT('GT',1,1,'String','Unphased genotypes','.'),
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),             # <<<<<<<<<<<<<<
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),
 *     "NR":vcf.FORMAT('NR',1,'.','Integer','Number of reads covering variant location in this sample','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GQ), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":120
 *     "GL":vcf.FORMAT('GL',1,'.','Float','Genotype log10-likelihoods for AA,AB and BB genotypes, where A = ref and B = variant. Only applicable for bi-allelic sites','.'),
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),             # <<<<<<<<<<<<<<
 *     "NR":vcf.FORMAT('NR',1,'.','Integer','Number of reads covering variant location in this sample','.'),
 *     "NV":vcf.FORMAT('NV',1,'.','Integer','Number of reads containing variant in this sample','.'),
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__GOF), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":121
 *     "GQ":vcf.FORMAT('GQ',1,'.','Integer','Genotype quality as phred score','.'),
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),
 *     "NR":vcf.FORMAT('NR',1,'.','Integer','Number of reads covering variant location in this sample','.'),             # <<<<<<<<<<<<<<
 *     "NV":vcf.FORMAT('NV',1,'.','Integer','Number of reads containing variant in this sample','.'),
 * }
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__NR), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "vcfutils.pyx":122
 *     "GOF":vcf.FORMAT('GOF',1,'.','Float','Goodness of fit value','.'),
 *     "NR":vcf.FORMAT('NR',1,'.','Integer','Number of reads covering variant location in this sample','.'),
 *     "NV":vcf.FORMAT('NV',1,'.','Integer','Number of reads containing variant in this sample','.'),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__vcf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__FORMAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__NV), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__vcfFormatSignature, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "vcfutils.pyx":127
 * ###################################################################################################
 * 
 * def outputSingleLineOfVCF(dict data, object outputFile, object vcfFile, options):             # <<<<<<<<<<<<<<
 *     """
 *     """
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_8vcfutils_1outputSingleLineOfVCF, NULL, __pyx_n_s__vcfutils); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_18, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vcfutils.pyx":796
 * 
 * 
 * def trimLeftPadding(vcfDataLine):             # <<<<<<<<<<<<<<
 *     """
 *     This is a small hack to make sure that no un-needed left padding is left
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_8vcfutils_3trimLeftPadding, NULL, __pyx_n_s__vcfutils); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__trimLeftPadding, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vcfutils.pyx":1
 * """             # <<<<<<<<<<<<<<
 * Utility code for Platypus. This is mostly concerned with processing needed to produce
 * VCF output from the various data structures used by Platypus.
 */
  __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(((PyObject *)__pyx_t_3));
  if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;

  /* "htslibWrapper.pxd":295
 *     theRead.bitFlag |= BAM_FCOMPRESSED
 * 
 * cdef inline void Read_SetUnCompressed(cAlignedRead* theRead) nogil:             # <<<<<<<<<<<<<<
 *     theRead.bitFlag &= (~BAM_FCOMPRESSED)
 * 
 */
  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 vcfutils", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init vcfutils");
  }
  __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 '%s' 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,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" 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,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

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

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

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #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);
    }
}

#if PY_MAJOR_VERSION >= 3
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
    return PyObject_CallMethodObjArgs(d, __pyx_n_s__keys, NULL);
}
#endif

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

static CYTHON_INLINE 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 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%s to unpack",
                 index, (index == 1) ? "" : "s");
}

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

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 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_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, 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_ass_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_ass_slice(obj, cstart, cstop, value);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int 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_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object does not support slice %s",
        Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
    return -1;
}

#if PY_MAJOR_VERSION >= 3
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return PyObject_CallMethodObjArgs(d, __pyx_n_s__values, NULL);
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    } else {
        return __Pyx_PyObject_CallMethod1(L, __pyx_n_s__append, x);
    }
}

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

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

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

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

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

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

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

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

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

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

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

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(unsigned long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(unsigned long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (unsigned 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 unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#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_AsLong(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))) {
        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;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } 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
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#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_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if 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;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } 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
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(signed long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(signed long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (signed 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 signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    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 *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 = PyEval_CallObject(type, args);
        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 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);
    PyObject_GC_Track(self);
    if (gen->resume_label > 0) {
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
            return;                     /* resurrected.  :( */
    }
    PyObject_GC_UnTrack(self);
    __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 ;
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Generator_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
    /* Undo the temporary resurrection; can't use DECREF here, it would
     * cause a recursive call.
     */
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0)
        return; /* this is the normal path out */
    /* close() resurrected it!  Make it look like the original Py_DECREF
     * never happened.
     */
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#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
}
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, /* 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*/
    __Pyx_Generator_del,                /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
};
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure) {
    __pyx_GeneratorObject *gen =
        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_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;
    if (PyType_Ready(&__pyx_GeneratorType_type)) {
        return -1;
    }
    __pyx_GeneratorType = &__pyx_GeneratorType_type;
    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;
}

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,
            "%s.%s 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,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

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

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

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

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

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

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 */
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (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,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
           PyErr_SetString(PyExc_OverflowError,
                           "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
