/* Generated by Cython 0.22 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/faidx.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/kstring.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/bgzf.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/hfile.h", 
            "/Library/Python/2.7/site-packages/pysam/samfile_util.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/sam.h", 
            "/Library/Python/2.7/site-packages/numpy/core/include/numpy/ufuncobject.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/tbx.h", 
            "/Library/Python/2.7/site-packages/pysam/pysam_stream.h", 
            "/Library/Python/2.7/site-packages/numpy/core/include/numpy/arrayobject.h", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib/htslib/hts.h", 
            "/Library/Python/2.7/site-packages/pysam/htslib_util.h"
        ], 
        "define_macros": [
            [
                "_FILE_OFFSET_BITS", 
                "64"
            ], 
            [
                "_USE_KNETFILE", 
                ""
            ]
        ], 
        "include_dirs": [
            "/Library/Python/2.7/site-packages/numpy/core/include", 
            "/Library/Python/2.7/site-packages/pysam", 
            "/Library/Python/2.7/site-packages/pysam/include/htslib", 
            "/Library/Python/2.7/site-packages/pysam/include/samtools"
        ]
    }
}
END: Cython Metadata */

#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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_22"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_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_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None)
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(T& ref) : ptr(&ref) { }
    T *operator->() { return ptr; }
    operator T&() { return *ptr; }
  private:
    T *ptr;
};
#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__SomVarIUS_calling
#define __PYX_HAVE_API__SomVarIUS_calling
#include "stdint.h"
#include "math.h"
#include "string.h"
#include "stdio.h"
#include "pythread.h"
#include "stdlib.h"
#include "zlib.h"
#include "htslib/kstring.h"
#include "htslib/hfile.h"
#include "htslib/bgzf.h"
#include "htslib/hts.h"
#include "htslib/sam.h"
#include "pysam_stream.h"
#include "htslib/faidx.h"
#include "htslib/tbx.h"
#include "htslib_util.h"
#include "samfile_util.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.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;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
    (sizeof(type) > sizeof(Py_ssize_t) &&               \
          likely(v < (type)PY_SSIZE_T_MAX ||            \
                 v == (type)PY_SSIZE_T_MAX)  &&         \
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
                                v == (type)PY_SSIZE_T_MIN)))  ||  \
    (sizeof(type) == sizeof(Py_ssize_t) &&              \
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const 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 (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        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) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #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;

#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "SomVarIUS_calling.pyx",
  "__init__.pxd",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
  "cfaidx.pxd",
  "calignmentfile.pxd",
  "csamfile.pxd",
};
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;


/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
 * # in Cython to enable them only on the right systems.
 * 
 * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 */
typedef npy_int8 __pyx_t_5numpy_int8_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":727
 * 
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t
 */
typedef npy_int16 __pyx_t_5numpy_int16_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":728
 * ctypedef npy_int8       int8_t
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_int64      int64_t
 * #ctypedef npy_int96      int96_t
 */
typedef npy_int32 __pyx_t_5numpy_int32_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":729
 * ctypedef npy_int16      int16_t
 * ctypedef npy_int32      int32_t
 * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_int96      int96_t
 * #ctypedef npy_int128     int128_t
 */
typedef npy_int64 __pyx_t_5numpy_int64_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
 * #ctypedef npy_int128     int128_t
 * 
 * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 */
typedef npy_uint8 __pyx_t_5numpy_uint8_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":734
 * 
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t
 */
typedef npy_uint16 __pyx_t_5numpy_uint16_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":735
 * ctypedef npy_uint8      uint8_t
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uint64     uint64_t
 * #ctypedef npy_uint96     uint96_t
 */
typedef npy_uint32 __pyx_t_5numpy_uint32_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":736
 * ctypedef npy_uint16     uint16_t
 * ctypedef npy_uint32     uint32_t
 * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_uint96     uint96_t
 * #ctypedef npy_uint128    uint128_t
 */
typedef npy_uint64 __pyx_t_5numpy_uint64_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
 * #ctypedef npy_uint128    uint128_t
 * 
 * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
 * ctypedef npy_float64    float64_t
 * #ctypedef npy_float80    float80_t
 */
typedef npy_float32 __pyx_t_5numpy_float32_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":741
 * 
 * ctypedef npy_float32    float32_t
 * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
 * #ctypedef npy_float80    float80_t
 * #ctypedef npy_float128   float128_t
 */
typedef npy_float64 __pyx_t_5numpy_float64_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":750
 * # The int types are mapped a bit surprising --
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t
 */
typedef npy_long __pyx_t_5numpy_int_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
 * # numpy.int corresponds to 'l' and numpy.long to 'q'
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longlong   longlong_t
 * 
 */
typedef npy_longlong __pyx_t_5numpy_long_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
 * ctypedef npy_long       int_t
 * ctypedef npy_longlong   long_t
 * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_ulong      uint_t
 */
typedef npy_longlong __pyx_t_5numpy_longlong_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
 * ctypedef npy_longlong   longlong_t
 * 
 * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t
 */
typedef npy_ulong __pyx_t_5numpy_uint_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
 * 
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 */
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
 * ctypedef npy_ulong      uint_t
 * ctypedef npy_ulonglong  ulong_t
 * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_intp       intp_t
 */
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
 * ctypedef npy_ulonglong  ulonglong_t
 * 
 * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
 * ctypedef npy_uintp      uintp_t
 * 
 */
typedef npy_intp __pyx_t_5numpy_intp_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
 * 
 * ctypedef npy_intp       intp_t
 * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_double     float_t
 */
typedef npy_uintp __pyx_t_5numpy_uintp_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":761
 * ctypedef npy_uintp      uintp_t
 * 
 * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t
 */
typedef npy_double __pyx_t_5numpy_float_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
 * 
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
 * ctypedef npy_longdouble longdouble_t
 * 
 */
typedef npy_double __pyx_t_5numpy_double_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
 * ctypedef npy_double     float_t
 * ctypedef npy_double     double_t
 * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cfloat      cfloat_t
 */
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< float > __pyx_t_float_complex;
  #else
    typedef float _Complex __pyx_t_float_complex;
  #endif
#else
    typedef struct { float real, imag; } __pyx_t_float_complex;
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif


/*--- Type declarations ---*/
struct __pyx_obj_5pysam_6cfaidx_FastaFile;
struct __pyx_obj_5pysam_6cfaidx_FastqProxy;
struct __pyx_obj_5pysam_6cfaidx_FastqFile;
struct __pyx_obj_5pysam_6cfaidx_Fastafile;
struct __pyx_obj_5pysam_6cfaidx_Fastqfile;
struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment;
struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile;
struct __pyx_obj_5pysam_14calignmentfile_PileupColumn;
struct __pyx_obj_5pysam_14calignmentfile_PileupRead;
struct __pyx_obj_5pysam_14calignmentfile_IteratorRow;
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion;
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead;
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll;
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs;
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection;
struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn;
struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion;
struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs;
struct __pyx_obj_5pysam_14calignmentfile_IndexedReads;
struct __pyx_obj_5pysam_8csamfile_AlignedRead;
struct __pyx_obj_5pysam_8csamfile_Samfile;
struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations;
struct __pyx_t_5pysam_14calignmentfile___iterdata;
typedef struct __pyx_t_5pysam_14calignmentfile___iterdata __pyx_t_5pysam_14calignmentfile___iterdata;
struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag;
struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData;

/* "pysam/calignmentfile.pxd":53
 * # Utility types
 * 
 * ctypedef struct __iterdata:             # <<<<<<<<<<<<<<
 *     htsFile * htsfile
 *     bam_hdr_t * header
 */
struct __pyx_t_5pysam_14calignmentfile___iterdata {
  htsFile *htsfile;
  bam_hdr_t *header;
  hts_itr_t *iter;
  faidx_t *fastafile;
  int tid;
  char *seq;
  int seq_len;
};

/* "pysam/calignmentfile.pxd":72
 *     # add an alignment tag with value to the AlignedSegment
 *     # an existing tag of the same name will be replaced.
 *     cpdef setTag( self, tag, value, value_type = ?, replace = ? )             # <<<<<<<<<<<<<<
 * 
 * cdef class AlignmentFile:
 */
struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag {
  int __pyx_n;
  PyObject *value_type;
  PyObject *replace;
};

/* "pysam/calignmentfile.pxd":179
 *     cdef char * getSequence( self )
 *     cdef setMask(self, mask)
 *     cdef setupIteratorData(self,             # <<<<<<<<<<<<<<
 *                            int tid,
 *                            int start,
 */
struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData {
  int __pyx_n;
  int multiple_iterators;
};

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
 * ctypedef npy_longdouble longdouble_t
 * 
 * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t
 */
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
 * 
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
 * ctypedef npy_clongdouble clongdouble_t
 * 
 */
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767
 * ctypedef npy_cfloat      cfloat_t
 * ctypedef npy_cdouble     cdouble_t
 * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef npy_cdouble     complex_t
 */
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
 * ctypedef npy_clongdouble clongdouble_t
 * 
 * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 */
typedef npy_cdouble __pyx_t_5numpy_complex_t;
struct __pyx_t_17SomVarIUS_calling__CountAllele;

/* "SomVarIUS_calling.pyx":792
 * 	return seq
 * 
 * cdef struct _CountAllele:             # <<<<<<<<<<<<<<
 * 	int fwd, rev, pres, count, mapqual
 * 	double qual
 */
struct __pyx_t_17SomVarIUS_calling__CountAllele {
  int fwd;
  int rev;
  int pres;
  int count;
  int mapqual;
  double qual;
};

/* "pysam/cfaidx.pxd":14
 *         char *s
 * 
 * cdef class FastaFile:             # <<<<<<<<<<<<<<
 *     cdef object _filename, _references, _lengths, reference2length
 *     cdef faidx_t* fastafile
 */
struct __pyx_obj_5pysam_6cfaidx_FastaFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile *__pyx_vtab;
  PyObject *_filename;
  PyObject *_references;
  PyObject *_lengths;
  PyObject *reference2length;
  faidx_t *fastafile;
};


/* "pysam/cfaidx.pxd":21
 * 
 * 
 * cdef class FastqProxy:             # <<<<<<<<<<<<<<
 *     cdef kseq_t * _delegate
 * 
 */
struct __pyx_obj_5pysam_6cfaidx_FastqProxy {
  PyObject_HEAD
  kseq_t *_delegate;
};


/* "pysam/cfaidx.pxd":25
 * 
 * 
 * cdef class FastqFile:             # <<<<<<<<<<<<<<
 *     cdef object _filename
 *     cdef gzFile fastqfile
 */
struct __pyx_obj_5pysam_6cfaidx_FastqFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile *__pyx_vtab;
  PyObject *_filename;
  gzFile fastqfile;
  kseq_t *entry;
};


/* "pysam/cfaidx.pxd":35
 * 
 * # Compatibility Layer for pysam < 0.8
 * cdef class Fastafile(FastaFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_5pysam_6cfaidx_Fastafile {
  struct __pyx_obj_5pysam_6cfaidx_FastaFile __pyx_base;
};


/* "pysam/cfaidx.pxd":38
 *     pass
 * 
 * cdef class Fastqfile(FastqFile):             # <<<<<<<<<<<<<<
 *     pass
 */
struct __pyx_obj_5pysam_6cfaidx_Fastqfile {
  struct __pyx_obj_5pysam_6cfaidx_FastqFile __pyx_base;
};


/* "pysam/calignmentfile.pxd":65
 * #
 * # Note: need to declare all C fields and methods here
 * cdef class AlignedSegment:             # <<<<<<<<<<<<<<
 * 
 *     # object that this AlignedSegment represents
 */
struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment *__pyx_vtab;
  bam1_t *_delegate;
};


/* "pysam/calignmentfile.pxd":74
 *     cpdef setTag( self, tag, value, value_type = ?, replace = ? )
 * 
 * cdef class AlignmentFile:             # <<<<<<<<<<<<<<
 * 
 *     cdef object _filename
 */
struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *__pyx_vtab;
  PyObject *_filename;
  htsFile *htsfile;
  BGZF *fp;
  hts_idx_t *index;
  bam_hdr_t *header;
  int isbam;
  int isstream;
  int isremote;
  bam1_t *b;
  char *mode;
  int64_t start_offset;
};


/* "pysam/calignmentfile.pxd":111
 *     cdef char * _getrname(self, int tid)
 * 
 * cdef class PileupColumn:             # <<<<<<<<<<<<<<
 *     cdef bam_pileup1_t ** plp
 *     cdef int tid
 */
struct __pyx_obj_5pysam_14calignmentfile_PileupColumn {
  PyObject_HEAD
  bam_pileup1_t **plp;
  int tid;
  int pos;
  int n_pu;
};


/* "pysam/calignmentfile.pxd":117
 *     cdef int n_pu
 * 
 * cdef class PileupRead:             # <<<<<<<<<<<<<<
 *     cdef AlignedSegment _alignment
 *     cdef int32_t  _qpos
 */
struct __pyx_obj_5pysam_14calignmentfile_PileupRead {
  PyObject_HEAD
  struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *_alignment;
  int32_t _qpos;
  int _indel;
  int _level;
  uint32_t _is_del;
  uint32_t _is_head;
  uint32_t _is_tail;
};


/* "pysam/calignmentfile.pxd":126
 *     cdef uint32_t _is_tail
 * 
 * cdef class IteratorRow:             # <<<<<<<<<<<<<<
 *     cdef int retval
 *     cdef bam1_t * b
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorRow {
  PyObject_HEAD
  int retval;
  bam1_t *b;
  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
  htsFile *htsfile;
  bam_hdr_t *header;
  int owns_samfile;
};


/* "pysam/calignmentfile.pxd":134
 *     cdef int owns_samfile
 * 
 * cdef class IteratorRowRegion(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef hts_itr_t * iter
 *     cdef bam1_t * getCurrent( self )
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion {
  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion *__pyx_vtab;
  hts_itr_t *iter;
};


/* "pysam/calignmentfile.pxd":139
 *     cdef int cnext(self)
 * 
 * cdef class IteratorRowHead(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef int max_rows
 *     cdef int current_row
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead {
  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead *__pyx_vtab;
  int max_rows;
  int current_row;
};


/* "pysam/calignmentfile.pxd":145
 *     cdef int cnext(self)
 * 
 * cdef class IteratorRowAll(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef bam1_t * getCurrent( self )
 *     cdef int cnext(self)
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll {
  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll *__pyx_vtab;
};


/* "pysam/calignmentfile.pxd":149
 *     cdef int cnext(self)
 * 
 * cdef class IteratorRowAllRefs(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef int         tid
 *     cdef IteratorRowRegion rowiter
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs {
  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
  int tid;
  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *rowiter;
};


/* "pysam/calignmentfile.pxd":153
 *     cdef IteratorRowRegion rowiter
 * 
 * cdef class IteratorRowSelection(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef int current_pos
 *     cdef positions
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection {
  struct __pyx_obj_5pysam_14calignmentfile_IteratorRow __pyx_base;
  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection *__pyx_vtab;
  int current_pos;
  PyObject *positions;
  BGZF *fp;
};


/* "pysam/calignmentfile.pxd":160
 *     cdef BGZF * fp
 * 
 * cdef class IteratorColumn:             # <<<<<<<<<<<<<<
 * 
 *     # result of the last plbuf_push
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn {
  PyObject_HEAD
  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn *__pyx_vtab;
  struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *iter;
  int tid;
  int pos;
  int n_plp;
  int mask;
  bam_pileup1_t *plp;
  bam_plp_t pileup_iter;
  __pyx_t_5pysam_14calignmentfile___iterdata iterdata;
  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
  struct __pyx_obj_5pysam_6cfaidx_Fastafile *fastafile;
  PyObject *stepper;
  int max_depth;
};


/* "pysam/calignmentfile.pxd":188
 *     cdef _free_pileup_iter(self)
 * 
 * cdef class IteratorColumnRegion(IteratorColumn):             # <<<<<<<<<<<<<<
 *     cdef int start
 *     cdef int end
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion {
  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn __pyx_base;
  int start;
  int end;
  int truncate;
};


/* "pysam/calignmentfile.pxd":193
 *     cdef int truncate
 * 
 * cdef class IteratorColumnAllRefs(IteratorColumn):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs {
  struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn __pyx_base;
};


/* "pysam/calignmentfile.pxd":196
 *     pass
 * 
 * cdef class IndexedReads:             # <<<<<<<<<<<<<<
 *     cdef AlignmentFile samfile
 *     cdef htsFile * htsfile
 */
struct __pyx_obj_5pysam_14calignmentfile_IndexedReads {
  PyObject_HEAD
  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *samfile;
  htsFile *htsfile;
  PyObject *index;
  int owns_samfile;
  BGZF *fp;
  bam_hdr_t *header;
};


/* "pysam/csamfile.pxd":9
 * from chtslib cimport *
 * 
 * cdef class AlignedRead(AlignedSegment):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_5pysam_8csamfile_AlignedRead {
  struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment __pyx_base;
};


/* "pysam/csamfile.pxd":12
 *     pass
 * 
 * cdef class Samfile(AlignmentFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_5pysam_8csamfile_Samfile {
  struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile __pyx_base;
};


/* "SomVarIUS_calling.pyx":495
 * 
 * 
 * def write_mutations(str out_file, str samfile_name, str fafile_name,             # <<<<<<<<<<<<<<
 * 						  str rna_seq_file_name='', str hapmap_file='',
 *                           int min_reads=10, int min_support=4, double min_af=0.05,
 */
struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations {
  PyObject_HEAD
  struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_A;
  struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_C;
  struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_G;
  struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_T;
  PyObject *__pyx_v_all_bed_chroms;
  bam1_t *__pyx_v_aln;
  PyObject *__pyx_v_alnbase;
  PyObject *__pyx_v_alt_allele;
  double __pyx_v_alt_allele_freq;
  int __pyx_v_alt_count;
  PyObject *__pyx_v_alt_germ;
  PyObject *__pyx_v_ba_to_bed;
  PyObject *__pyx_v_ba_to_fa;
  PyObject *__pyx_v_ba_to_hapmap;
  PyObject *__pyx_v_ba_to_rna;
  double __pyx_v_baseq;
  PyObject *__pyx_v_bed_chroms;
  int __pyx_v_binom;
  PyObject *__pyx_v_chrom;
  PyObject *__pyx_v_chrom_dist;
  PyObject *__pyx_v_chrom_list;
  PyObject *__pyx_v_chrom_record;
  PyObject *__pyx_v_chrom_regions;
  struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_col;
  PyObject *__pyx_v_copy_bed_name;
  PyObject *__pyx_v_copy_chrom;
  int __pyx_v_copy_end;
  int __pyx_v_copy_filter;
  PyObject *__pyx_v_copy_list;
  int __pyx_v_copy_list_pos;
  PyObject *__pyx_v_copy_record;
  PyObject *__pyx_v_copy_regions;
  int __pyx_v_copy_start;
  PyObject *__pyx_v_counts;
  PyObject *__pyx_v_dbsnp_bed_name;
  double __pyx_v_delta;
  PyObject *__pyx_v_dist;
  PyObject *__pyx_v_dist_out;
  struct __pyx_obj_5pysam_6cfaidx_Fastafile *__pyx_v_fafile;
  PyObject *__pyx_v_fafile_name;
  uint32_t __pyx_v_flag;
  PyObject *__pyx_v_fmt;
  double __pyx_v_forward;
  PyObject *__pyx_v_fourth_allele;
  int __pyx_v_fourth_count;
  double __pyx_v_fwd_ratio;
  PyObject *__pyx_v_genome;
  PyObject *__pyx_v_hap_alt;
  int __pyx_v_hap_filter;
  PyObject *__pyx_v_hap_ref;
  PyObject *__pyx_v_hapmap_file;
  int __pyx_v_hapmap_present;
  PyObject *__pyx_v_hapmap_record;
  int __pyx_v_i;
  int __pyx_v_in_copy;
  int __pyx_v_is_proper_pair;
  int __pyx_v_is_reverse;
  PyObject *__pyx_v_it;
  PyObject *__pyx_v_labels;
  PyObject *__pyx_v_lengths;
  PyObject *__pyx_v_line;
  PyObject *__pyx_v_maj_allele;
  int __pyx_v_maj_count;
  uint8_t __pyx_v_mapq;
  double __pyx_v_mean_mapq;
  double __pyx_v_mean_qual;
  double __pyx_v_min_af;
  int __pyx_v_min_baseq;
  double __pyx_v_min_f_r;
  double __pyx_v_min_hetero;
  uint64_t __pyx_v_min_mapq;
  double __pyx_v_min_pvalue;
  int __pyx_v_min_qual;
  int __pyx_v_min_reads;
  double __pyx_v_min_se;
  int __pyx_v_min_support;
  int __pyx_v_n;
  PyObject *__pyx_v_out_file;
  bam_pileup1_t **__pyx_v_plp;
  int __pyx_v_pos;
  PyObject *__pyx_v_possible_germs;
  long double __pyx_v_prob_not_hetero;
  long double __pyx_v_prob_not_se;
  long double __pyx_v_pvalue;
  bam_pileup1_t *__pyx_v_read;
  int __pyx_v_ref_filter;
  PyObject *__pyx_v_refbase;
  PyObject *__pyx_v_references;
  PyObject *__pyx_v_region_chrom;
  PyObject *__pyx_v_region_end;
  PyObject *__pyx_v_region_start;
  double __pyx_v_reverse;
  int __pyx_v_rna_filter;
  double __pyx_v_rna_seq;
  struct __pyx_obj_5pysam_8csamfile_Samfile *__pyx_v_rna_seq_file;
  PyObject *__pyx_v_rna_seq_file_name;
  struct __pyx_obj_5pysam_8csamfile_Samfile *__pyx_v_rnq_seq_file;
  double __pyx_v_rvs_ratio;
  struct __pyx_obj_5pysam_8csamfile_Samfile *__pyx_v_samfile;
  PyObject *__pyx_v_samfile_name;
  PyObject *__pyx_v_seen_chroms;
  PyObject *__pyx_v_third_allele;
  int __pyx_v_third_count;
  int __pyx_v_total_alleles;
  double __pyx_v_total_baseq;
  Py_ssize_t __pyx_t_0;
  PyObject *(*__pyx_t_1)(PyObject *);
  PyObject *__pyx_t_2;
};



/* "pysam/cfaidx.pxd":14
 *         char *s
 * 
 * cdef class FastaFile:             # <<<<<<<<<<<<<<
 *     cdef object _filename, _references, _lengths, reference2length
 *     cdef faidx_t* fastafile
 */

struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile {
  char *(*_fetch)(struct __pyx_obj_5pysam_6cfaidx_FastaFile *, char *, int, int, int *);
};
static struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile *__pyx_vtabptr_5pysam_6cfaidx_FastaFile;


/* "pysam/cfaidx.pxd":25
 * 
 * 
 * cdef class FastqFile:             # <<<<<<<<<<<<<<
 *     cdef object _filename
 *     cdef gzFile fastqfile
 */

struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile {
  kseq_t *(*getCurrent)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *);
  int (*cnext)(struct __pyx_obj_5pysam_6cfaidx_FastqFile *);
};
static struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile *__pyx_vtabptr_5pysam_6cfaidx_FastqFile;


/* "pysam/cfaidx.pxd":35
 * 
 * # Compatibility Layer for pysam < 0.8
 * cdef class Fastafile(FastaFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile {
  struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile __pyx_base;
};
static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile *__pyx_vtabptr_5pysam_6cfaidx_Fastafile;


/* "pysam/cfaidx.pxd":38
 *     pass
 * 
 * cdef class Fastqfile(FastqFile):             # <<<<<<<<<<<<<<
 *     pass
 */

struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile {
  struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile __pyx_base;
};
static struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile *__pyx_vtabptr_5pysam_6cfaidx_Fastqfile;


/* "pysam/calignmentfile.pxd":65
 * #
 * # Note: need to declare all C fields and methods here
 * cdef class AlignedSegment:             # <<<<<<<<<<<<<<
 * 
 *     # object that this AlignedSegment represents
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment {
  PyObject *(*setTag)(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_14calignmentfile_14AlignedSegment_setTag *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment *__pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment;


/* "pysam/calignmentfile.pxd":74
 *     cpdef setTag( self, tag, value, value_type = ?, replace = ? )
 * 
 * cdef class AlignmentFile:             # <<<<<<<<<<<<<<
 * 
 *     cdef object _filename
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile {
  bam_hdr_t *(*_buildHeader)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, PyObject *);
  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *);
  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *);
  int (*write)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment *, int __pyx_skip_dispatch);
  char *(*_getrname)(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile *, int);
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile *__pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile;


/* "pysam/calignmentfile.pxd":134
 *     cdef int owns_samfile
 * 
 * cdef class IteratorRowRegion(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef hts_itr_t * iter
 *     cdef bam1_t * getCurrent( self )
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion {
  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *);
  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion *);
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion;


/* "pysam/calignmentfile.pxd":139
 *     cdef int cnext(self)
 * 
 * cdef class IteratorRowHead(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef int max_rows
 *     cdef int current_row
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead {
  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *);
  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead *);
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead;


/* "pysam/calignmentfile.pxd":145
 *     cdef int cnext(self)
 * 
 * cdef class IteratorRowAll(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef bam1_t * getCurrent( self )
 *     cdef int cnext(self)
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll {
  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *);
  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll *);
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll;


/* "pysam/calignmentfile.pxd":153
 *     cdef IteratorRowRegion rowiter
 * 
 * cdef class IteratorRowSelection(IteratorRow):             # <<<<<<<<<<<<<<
 *     cdef int current_pos
 *     cdef positions
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection {
  bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *);
  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection *);
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection *__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection;


/* "pysam/calignmentfile.pxd":160
 *     cdef BGZF * fp
 * 
 * cdef class IteratorColumn:             # <<<<<<<<<<<<<<
 * 
 *     # result of the last plbuf_push
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn {
  int (*cnext)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
  char *(*getSequence)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
  PyObject *(*setMask)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, PyObject *);
  PyObject *(*setupIteratorData)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, int, int, int, struct __pyx_opt_args_5pysam_14calignmentfile_14IteratorColumn_setupIteratorData *__pyx_optional_args);
  PyObject *(*reset)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *, PyObject *, PyObject *, PyObject *);
  PyObject *(*_free_pileup_iter)(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn *);
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn;


/* "pysam/calignmentfile.pxd":188
 *     cdef _free_pileup_iter(self)
 * 
 * cdef class IteratorColumnRegion(IteratorColumn):             # <<<<<<<<<<<<<<
 *     cdef int start
 *     cdef int end
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion {
  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn __pyx_base;
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion;


/* "pysam/calignmentfile.pxd":193
 *     cdef int truncate
 * 
 * cdef class IteratorColumnAllRefs(IteratorColumn):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs {
  struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn __pyx_base;
};
static struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs *__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs;


/* "pysam/csamfile.pxd":9
 * from chtslib cimport *
 * 
 * cdef class AlignedRead(AlignedSegment):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_5pysam_8csamfile_AlignedRead {
  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment __pyx_base;
};
static struct __pyx_vtabstruct_5pysam_8csamfile_AlignedRead *__pyx_vtabptr_5pysam_8csamfile_AlignedRead;


/* "pysam/csamfile.pxd":12
 *     pass
 * 
 * cdef class Samfile(AlignmentFile):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_5pysam_8csamfile_Samfile {
  struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile __pyx_base;
};
static struct __pyx_vtabstruct_5pysam_8csamfile_Samfile *__pyx_vtabptr_5pysam_8csamfile_Samfile;

/* --- Runtime support code (head) --- */
#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);
  #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
#define __Pyx_XDECREF_SET(r, v) do {                            \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_XDECREF(tmp);                              \
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {                             \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_DECREF(tmp);                               \
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

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

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

static void __Pyx_RaiseBufferFallbackError(void);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback);

#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

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

#include <string.h>

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
    const char* function_name);

static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#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 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 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_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
    if (it) {
        PyObject* result;
#if CYTHON_COMPILING_IN_PYPY
        PyObject* args;
        args = PyTuple_Pack(1, it);
        if (unlikely(!args))
            return NULL;
        result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
        Py_DECREF(args);
        return result;
#else
        if (PyFrozenSet_CheckExact(it)) {
            Py_INCREF(it);
            return it;
        }
        result = PyFrozenSet_New(it);
        if (unlikely(!result))
            return NULL;
        if (likely(PySet_GET_SIZE(result)))
            return result;
        Py_DECREF(result);
#endif
    }
#if CYTHON_COMPILING_IN_CPYTHON
    return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#else
    return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
#endif
}

static double __Pyx__PyObject_AsDouble(PyObject* obj);
#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

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

static CYTHON_INLINE int __Pyx_IterFinish(void);

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

static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */

static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */

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

static void* __Pyx_GetVtable(PyObject *dict);

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

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

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

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


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

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

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject* stream, PyObject *o);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value);

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

static PyObject* __Pyx_Globals(void);

struct __pyx_t_17SomVarIUS_calling__CountAllele;
static PyObject* __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(struct __pyx_t_17SomVarIUS_calling__CountAllele s);
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eqf(a, b)   ((a)==(b))
    #define __Pyx_c_sumf(a, b)  ((a)+(b))
    #define __Pyx_c_difff(a, b) ((a)-(b))
    #define __Pyx_c_prodf(a, b) ((a)*(b))
    #define __Pyx_c_quotf(a, b) ((a)/(b))
    #define __Pyx_c_negf(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zerof(z) ((z)==(float)0)
    #define __Pyx_c_conjf(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_absf(z)     (::std::abs(z))
        #define __Pyx_c_powf(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zerof(z) ((z)==0)
    #define __Pyx_c_conjf(z)    (conjf(z))
    #if 1
        #define __Pyx_c_absf(z)     (cabsf(z))
        #define __Pyx_c_powf(a, b)  (cpowf(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
    #endif
#endif

static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);

#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq(a, b)   ((a)==(b))
    #define __Pyx_c_sum(a, b)  ((a)+(b))
    #define __Pyx_c_diff(a, b) ((a)-(b))
    #define __Pyx_c_prod(a, b) ((a)*(b))
    #define __Pyx_c_quot(a, b) ((a)/(b))
    #define __Pyx_c_neg(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero(z) ((z)==(double)0)
    #define __Pyx_c_conj(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (::std::abs(z))
        #define __Pyx_c_pow(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero(z) ((z)==0)
    #define __Pyx_c_conj(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs(z)     (cabs(z))
        #define __Pyx_c_pow(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

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

#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;
    PyObject *gi_name;
    PyObject *gi_qualname;
    int resume_label;
    char is_running;
} __pyx_GeneratorObject;
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure, PyObject *name, PyObject *qualname);
static int __pyx_Generator_init(void);
static int __Pyx_Generator_clear(PyObject* self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

static int __Pyx_check_binary_version(void);

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

static PyObject *__Pyx_ImportModule(const char *name);

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

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


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

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

/* 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 'libc.stdlib' */

/* Module declarations from 'pysam.chtslib' */

/* Module declarations from 'pysam.cfaidx' */
static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastaFile = 0;
static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastqProxy = 0;
static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_FastqFile = 0;
static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_Fastafile = 0;
static PyTypeObject *__pyx_ptype_5pysam_6cfaidx_Fastqfile = 0;

/* Module declarations from 'pysam.calignmentfile' */
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_AlignedSegment = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_AlignmentFile = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_PileupColumn = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_PileupRead = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRow = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowHead = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumn = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs = 0;
static PyTypeObject *__pyx_ptype_5pysam_14calignmentfile_IndexedReads = 0;

/* Module declarations from 'pysam.csamfile' */
static PyTypeObject *__pyx_ptype_5pysam_8csamfile_AlignedRead = 0;
static PyTypeObject *__pyx_ptype_5pysam_8csamfile_Samfile = 0;

/* Module declarations from 'numpy' */

/* Module declarations from 'numpy' */
static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/

/* Module declarations from 'SomVarIUS_calling' */
static PyTypeObject *__pyx_ptype_17SomVarIUS_calling___pyx_scope_struct__write_mutations = 0;
static char *__pyx_v_17SomVarIUS_calling_CODE2CIGAR;
static char *__pyx_v_17SomVarIUS_calling_bam_nt16_rev_table;
static PyObject *__pyx_f_17SomVarIUS_calling_fit_beta_binomial(PyArrayObject *, PyArrayObject *); /*proto*/
static long double __pyx_f_17SomVarIUS_calling_log_dcm(PyArrayObject *, PyArrayObject *); /*proto*/
static long double __pyx_f_17SomVarIUS_calling_log_betabin(int, int, long double, long double); /*proto*/
static long double __pyx_f_17SomVarIUS_calling_betabin_cdf(int, int, long double, long double); /*proto*/
static PyObject *__pyx_f_17SomVarIUS_calling_generate_chrom_dist(PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_17SomVarIUS_calling_track_copy_pos(PyObject *, int, PyObject *, PyObject *, int); /*proto*/
static PyObject *__pyx_f_17SomVarIUS_calling_filter_regions(PyObject *, PyObject *); /*proto*/
static long double __pyx_f_17SomVarIUS_calling_calc_se_pval(PyObject *, int, PyObject *, int, int, PyObject *, int, int, PyObject *, int); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling_chernoff(double, double, int, int, double, double, int, PyObject *, int, PyObject *, PyObject *, int, int, PyObject *, int); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling_multi_alleles(PyObject *, PyObject *, PyObject *, struct __pyx_t_17SomVarIUS_calling__CountAllele, struct __pyx_t_17SomVarIUS_calling__CountAllele, struct __pyx_t_17SomVarIUS_calling__CountAllele, struct __pyx_t_17SomVarIUS_calling__CountAllele, int, int, int); /*proto*/
static CYTHON_INLINE double __pyx_f_17SomVarIUS_calling_rna_seq_filter(PyObject *, int, PyObject *, struct __pyx_obj_5pysam_8csamfile_Samfile *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling_get_highest(int, int, int, int); /*proto*/
static PyObject *__pyx_f_17SomVarIUS_calling_samfile_ref_dicts(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling__get_seq_base(bam1_t *, uint32_t); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling__init_count(struct __pyx_t_17SomVarIUS_calling__CountAllele *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling__incr_count(struct __pyx_t_17SomVarIUS_calling__CountAllele *, int, double, int); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_double_t = { "double_t", NULL, sizeof(__pyx_t_5numpy_double_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 };
#define __Pyx_MODULE_NAME "SomVarIUS_calling"
int __pyx_module_is_main_SomVarIUS_calling = 0;

/* Implementation of 'SomVarIUS_calling' */
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_eval;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_pf_17SomVarIUS_calling_get_dist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_copy_record, struct __pyx_obj_5pysam_8csamfile_Samfile *__pyx_v_samfile, PyObject *__pyx_v_ba_to_bed, int __pyx_v_min_reads, int __pyx_v_min_support, int __pyx_v_min_mapq, int __pyx_v_min_baseq, CYTHON_UNUSED PyObject *__pyx_v_genome, CYTHON_UNUSED int __pyx_v_copy_bed); /* proto */
static PyObject *__pyx_pf_17SomVarIUS_calling_2write_mutations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_out_file, PyObject *__pyx_v_samfile_name, PyObject *__pyx_v_fafile_name, PyObject *__pyx_v_rna_seq_file_name, PyObject *__pyx_v_hapmap_file, int __pyx_v_min_reads, int __pyx_v_min_support, double __pyx_v_min_af, double __pyx_v_min_pvalue, double __pyx_v_min_f_r, int __pyx_v_rna_filter, int __pyx_v_hap_filter, int __pyx_v_min_qual, double __pyx_v_min_se, double __pyx_v_min_hetero, int __pyx_v_ref_filter, uint64_t __pyx_v_min_mapq, PyObject *__pyx_v_dbsnp_bed_name, PyObject *__pyx_v_copy_bed_name, int __pyx_v_binom, PyObject *__pyx_v_region_chrom, PyObject *__pyx_v_region_start, PyObject *__pyx_v_region_end, int __pyx_v_min_baseq, PyObject *__pyx_v_dist); /* proto */
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
static PyObject *__pyx_tp_new_17SomVarIUS_calling___pyx_scope_struct__write_mutations(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_A[] = "A";
static char __pyx_k_B[] = "B";
static char __pyx_k_C[] = "C";
static char __pyx_k_G[] = "G";
static char __pyx_k_H[] = "H";
static char __pyx_k_I[] = "I";
static char __pyx_k_L[] = "L";
static char __pyx_k_O[] = "O";
static char __pyx_k_Q[] = "Q";
static char __pyx_k_T[] = "T";
static char __pyx_k_b[] = "b";
static char __pyx_k_d[] = "d";
static char __pyx_k_f[] = "f";
static char __pyx_k_g[] = "g";
static char __pyx_k_h[] = "h";
static char __pyx_k_i[] = "i";
static char __pyx_k_l[] = "l";
static char __pyx_k_n[] = "n";
static char __pyx_k_q[] = "q";
static char __pyx_k_r[] = "r";
static char __pyx_k_w[] = "w";
static char __pyx_k_Zd[] = "Zd";
static char __pyx_k_Zf[] = "Zf";
static char __pyx_k_Zg[] = "Zg";
static char __pyx_k__2[] = "\t";
static char __pyx_k__4[] = ",";
static char __pyx_k__6[] = "";
static char __pyx_k__8[] = "\n";
static char __pyx_k_it[] = "it";
static char __pyx_k_np[] = "np";
static char __pyx_k_rb[] = "rb";
static char __pyx_k_NaN[] = "NaN";
static char __pyx_k_aln[] = "aln";
static char __pyx_k_cdf[] = "cdf";
static char __pyx_k_chr[] = "chr";
static char __pyx_k_col[] = "col";
static char __pyx_k_end[] = "end";
static char __pyx_k_exp[] = "exp";
static char __pyx_k_fmt[] = "fmt";
static char __pyx_k_fwd[] = "fwd";
static char __pyx_k_map[] = "map";
static char __pyx_k_plp[] = "plp";
static char __pyx_k_pos[] = "pos";
static char __pyx_k_rev[] = "rev";
static char __pyx_k_sum[] = "sum";
static char __pyx_k_0_15[] = "0.15";
static char __pyx_k_None[] = "None";
static char __pyx_k_args[] = "args";
static char __pyx_k_base[] = "base";
static char __pyx_k_beta[] = "beta";
static char __pyx_k_dist[] = "dist";
static char __pyx_k_eval[] = "eval";
static char __pyx_k_file[] = "file";
static char __pyx_k_flag[] = "flag";
static char __pyx_k_join[] = "join";
static char __pyx_k_keys[] = "keys";
static char __pyx_k_line[] = "line";
static char __pyx_k_load[] = "load";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_mapq[] = "mapq";
static char __pyx_k_mean[] = "mean";
static char __pyx_k_open[] = "open";
static char __pyx_k_pres[] = "pres";
static char __pyx_k_qual[] = "qual";
static char __pyx_k_read[] = "read";
static char __pyx_k_send[] = "send";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_alpha[] = "alpha";
static char __pyx_k_array[] = "array";
static char __pyx_k_baseq[] = "baseq";
static char __pyx_k_binom[] = "binom";
static char __pyx_k_chrom[] = "chrom";
static char __pyx_k_close[] = "close";
static char __pyx_k_count[] = "count";
static char __pyx_k_delta[] = "delta";
static char __pyx_k_dtype[] = "dtype";
static char __pyx_k_fetch[] = "fetch";
static char __pyx_k_numpy[] = "numpy";
static char __pyx_k_print[] = "print";
static char __pyx_k_range[] = "range";
static char __pyx_k_scipy[] = "scipy";
static char __pyx_k_split[] = "split";
static char __pyx_k_start[] = "start";
static char __pyx_k_stats[] = "stats";
static char __pyx_k_strip[] = "strip";
static char __pyx_k_throw[] = "throw";
static char __pyx_k_upper[] = "upper";
static char __pyx_k_write[] = "write";
static char __pyx_k_append[] = "append";
static char __pyx_k_counts[] = "counts";
static char __pyx_k_fafile[] = "fafile";
static char __pyx_k_format[] = "format";
static char __pyx_k_genome[] = "genome";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_labels[] = "labels";
static char __pyx_k_min_af[] = "min_af";
static char __pyx_k_min_se[] = "min_se";
static char __pyx_k_pileup[] = "pileup";
static char __pyx_k_pvalue[] = "pvalue";
static char __pyx_k_record[] = "record";
static char __pyx_k_repeat[] = "repeat";
static char __pyx_k_xrange[] = "xrange";
static char __pyx_k_alleles[] = "alleles";
static char __pyx_k_alnbase[] = "alnbase";
static char __pyx_k_cPickle[] = "cPickle";
static char __pyx_k_float64[] = "float64";
static char __pyx_k_forward[] = "forward";
static char __pyx_k_gammaln[] = "gammaln";
static char __pyx_k_hap_alt[] = "hap_alt";
static char __pyx_k_hap_ref[] = "hap_ref";
static char __pyx_k_in_copy[] = "in_copy";
static char __pyx_k_lengths[] = "lengths";
static char __pyx_k_mapqual[] = "mapqual";
static char __pyx_k_min_f_r[] = "min_f_r";
static char __pyx_k_refbase[] = "refbase";
static char __pyx_k_reverse[] = "reverse";
static char __pyx_k_rna_seq[] = "rna_seq";
static char __pyx_k_samfile[] = "samfile";
static char __pyx_k_version[] = "__version__";
static char __pyx_k_KeyError[] = "KeyError";
static char __pyx_k_alt_germ[] = "alt_germ";
static char __pyx_k_ba_to_fa[] = "ba_to_fa";
static char __pyx_k_copy_bed[] = "copy_bed";
static char __pyx_k_copy_end[] = "copy_end";
static char __pyx_k_dist_out[] = "dist_out";
static char __pyx_k_get_dist[] = "get_dist";
static char __pyx_k_getrname[] = "getrname";
static char __pyx_k_min_mapq[] = "min_mapq";
static char __pyx_k_min_qual[] = "min_qual";
static char __pyx_k_out_file[] = "out_file";
static char __pyx_k_truncate[] = "truncate";
static char __pyx_k_MIDNSHP_X[] = "MIDNSHP=X";
static char __pyx_k_alt_count[] = "alt_count";
static char __pyx_k_ba_to_bed[] = "ba_to_bed";
static char __pyx_k_ba_to_rna[] = "ba_to_rna";
static char __pyx_k_copy_list[] = "copy_list";
static char __pyx_k_factorial[] = "factorial";
static char __pyx_k_fwd_ratio[] = "fwd_ratio";
static char __pyx_k_maj_count[] = "maj_count";
static char __pyx_k_max_depth[] = "max_depth";
static char __pyx_k_mean_mapq[] = "mean_mapq";
static char __pyx_k_mean_qual[] = "mean_qual";
static char __pyx_k_min_baseq[] = "min_baseq";
static char __pyx_k_min_reads[] = "min_reads";
static char __pyx_k_reference[] = "reference";
static char __pyx_k_rvs_ratio[] = "rvs_ratio";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_alt_allele[] = "alt_allele";
static char __pyx_k_bed_chroms[] = "bed_chroms";
static char __pyx_k_chrom_dist[] = "chrom_dist";
static char __pyx_k_chrom_list[] = "chrom_list";
static char __pyx_k_copy_chrom[] = "copy_chrom";
static char __pyx_k_copy_start[] = "copy_start";
static char __pyx_k_hap_filter[] = "hap_filter";
static char __pyx_k_is_reverse[] = "is_reverse";
static char __pyx_k_maj_allele[] = "maj_allele";
static char __pyx_k_min_hetero[] = "min_hetero";
static char __pyx_k_min_pvalue[] = "min_pvalue";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_ref_filter[] = "ref_filter";
static char __pyx_k_references[] = "references";
static char __pyx_k_region_end[] = "region_end";
static char __pyx_k_rna_filter[] = "rna_filter";
static char __pyx_k_scipy_misc[] = "scipy.misc";
static char __pyx_k_OrderedDict[] = "OrderedDict";
static char __pyx_k_alt_alleles[] = "alt_alleles";
static char __pyx_k_binned_data[] = "binned_data";
static char __pyx_k_collections[] = "collections";
static char __pyx_k_copy_filter[] = "copy_filter";
static char __pyx_k_copy_record[] = "copy_record";
static char __pyx_k_copy_region[] = "copy_region";
static char __pyx_k_fafile_name[] = "fafile_name";
static char __pyx_k_hapmap_file[] = "hapmap_file";
static char __pyx_k_min_support[] = "min_support";
static char __pyx_k_obs_alleles[] = "obs_alleles";
static char __pyx_k_prob_not_se[] = "prob_not_se";
static char __pyx_k_scipy_stats[] = "scipy.stats";
static char __pyx_k_seen_chroms[] = "seen_chroms";
static char __pyx_k_third_count[] = "third_count";
static char __pyx_k_total_baseq[] = "total_baseq";
static char __pyx_k_RuntimeError[] = "RuntimeError";
static char __pyx_k_ba_to_hapmap[] = "ba_to_hapmap";
static char __pyx_k_chrom_record[] = "chrom_record";
static char __pyx_k_copy_regions[] = "copy_regions";
static char __pyx_k_fourth_count[] = "fourth_count";
static char __pyx_k_region_chrom[] = "region_chrom";
static char __pyx_k_region_start[] = "region_start";
static char __pyx_k_rna_seq_file[] = "rna_seq_file";
static char __pyx_k_rnq_seq_file[] = "rnq_seq_file";
static char __pyx_k_samfile_name[] = "samfile_name";
static char __pyx_k_third_allele[] = "third_allele";
static char __pyx_k_total_counts[] = "total_counts";
static char __pyx_k_chrom_regions[] = "chrom_regions";
static char __pyx_k_copy_bed_name[] = "copy_bed_name";
static char __pyx_k_copy_list_pos[] = "copy_list_pos";
static char __pyx_k_fourth_allele[] = "fourth_allele";
static char __pyx_k_hapmap_record[] = "hapmap_record";
static char __pyx_k_scipy_special[] = "scipy.special";
static char __pyx_k_total_alleles[] = "total_alleles";
static char __pyx_k_all_bed_chroms[] = "all_bed_chroms";
static char __pyx_k_dbsnp_bed_name[] = "dbsnp_bed_name";
static char __pyx_k_hapmap_present[] = "hapmap_present";
static char __pyx_k_is_proper_pair[] = "is_proper_pair";
static char __pyx_k_possible_germs[] = "possible_germs";
static char __pyx_k_ACMGRSVTWYHKDBN[] = "=ACMGRSVTWYHKDBN";
static char __pyx_k_alt_allele_freq[] = "alt_allele_freq";
static char __pyx_k_prob_not_hetero[] = "prob_not_hetero";
static char __pyx_k_write_mutations[] = "write_mutations";
static char __pyx_k_dbsnp_maj_allele[] = "dbsnp_maj_allele";
static char __pyx_k_SomVarIUS_calling[] = "SomVarIUS_calling";
static char __pyx_k_calling_mutations[] = "calling mutations";
static char __pyx_k_dbsnp_alt_alleles[] = "dbsnp_alt_alleles";
static char __pyx_k_dbsnp_obs_overlap[] = "dbsnp_obs_overlap";
static char __pyx_k_rna_seq_file_name[] = "rna_seq_file_name";
static char __pyx_k_previous_copy_region[] = "previous_copy_region";
static char __pyx_k_loading_germline_record[] = "loading germline record...";
static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
static char __pyx_k_done_loading_germline_record[] = "done loading germline record";
static char __pyx_k_GT_GQ_DP_1_0_60_total_alleles[] = "GT:GQ:DP\t1|0:60:{total_alleles}\n";
static char __pyx_k_Users_smithk_Documents_git_repo[] = "/Users/smithk/Documents/git_repos/SomVarIUS/SomVarIUS/SomVarIUS_calling.pyx";
static char __pyx_k_alt_allele_freq_pvalue_prob_not[] = "\t{alt_allele_freq}\t{pvalue}\t{prob_not_se}\t{prob_not_hetero}";
static char __pyx_k_chrom_pos_refbase_alt_allele_PA[] = "{chrom}\t{pos}\t.\t{refbase}\t{alt_allele}\t.\tPASS\t";
static char __pyx_k_chrom_pos_refbase_maj_allele_al[] = "{chrom}\t{pos}\t{refbase}\t{maj_allele}\t{alt_allele}";
static char __pyx_k_n_alt_count_rvs_ratio_fwd_ratio[] = "\t{n}\t{alt_count}\t{rvs_ratio}\t{fwd_ratio}\t{mean_qual}\t{mean_mapq}\t{rna_seq}\n";
static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_GP_prob_not_hetero_DP_total_alle[] = "GP={prob_not_hetero};DP={total_alleles};MQ={mean_mapq};BQ={mean_qual}\t";
static char __pyx_k_NS_1_AF_alt_allele_freq_P_pvalue[] = "NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_not_se};";
static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
static char __pyx_k_calculating_allele_frequency_dis[] = "calculating allele frequency distribution...";
static char __pyx_k_calculating_chromosome_allele_fr[] = "calculating chromosome allele frequency distribution...";
static char __pyx_k_done_calculating_chromosome_dist[] = "done calculating chromosome distributions";
static char __pyx_k_done_calculating_copy_number_dis[] = "done calculating copy number distributions";
static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
static char __pyx_k_storing_chromosome_dbsnp_interse[] = "storing chromosome/dbsnp intersection in memory...";
static char __pyx_k_storing_dbsnp_copy_number_inters[] = "storing dbsnp/copy number intersection in memory...";
static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static PyObject *__pyx_kp_s_0_15;
static PyObject *__pyx_n_b_A;
static PyObject *__pyx_n_s_A;
static PyObject *__pyx_n_b_C;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
static PyObject *__pyx_n_b_G;
static PyObject *__pyx_n_s_G;
static PyObject *__pyx_kp_s_GP_prob_not_hetero_DP_total_alle;
static PyObject *__pyx_kp_s_GT_GQ_DP_1_0_60_total_alleles;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_s_NS_1_AF_alt_allele_freq_P_pvalue;
static PyObject *__pyx_n_s_NaN;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_n_s_None;
static PyObject *__pyx_n_s_OrderedDict;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_SomVarIUS_calling;
static PyObject *__pyx_n_b_T;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_kp_s_Users_smithk_Documents_git_repo;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s__2;
static PyObject *__pyx_kp_s__4;
static PyObject *__pyx_kp_s__6;
static PyObject *__pyx_kp_s__8;
static PyObject *__pyx_n_s_all_bed_chroms;
static PyObject *__pyx_n_s_alleles;
static PyObject *__pyx_n_s_aln;
static PyObject *__pyx_n_s_alnbase;
static PyObject *__pyx_n_s_alpha;
static PyObject *__pyx_n_s_alt_allele;
static PyObject *__pyx_n_s_alt_allele_freq;
static PyObject *__pyx_kp_s_alt_allele_freq_pvalue_prob_not;
static PyObject *__pyx_n_s_alt_alleles;
static PyObject *__pyx_n_s_alt_count;
static PyObject *__pyx_n_s_alt_germ;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_ba_to_bed;
static PyObject *__pyx_n_s_ba_to_fa;
static PyObject *__pyx_n_s_ba_to_hapmap;
static PyObject *__pyx_n_s_ba_to_rna;
static PyObject *__pyx_n_s_base;
static PyObject *__pyx_n_s_baseq;
static PyObject *__pyx_n_s_bed_chroms;
static PyObject *__pyx_n_s_beta;
static PyObject *__pyx_n_s_binned_data;
static PyObject *__pyx_n_s_binom;
static PyObject *__pyx_n_s_cPickle;
static PyObject *__pyx_kp_s_calculating_allele_frequency_dis;
static PyObject *__pyx_kp_s_calculating_chromosome_allele_fr;
static PyObject *__pyx_kp_s_calling_mutations;
static PyObject *__pyx_n_s_cdf;
static PyObject *__pyx_n_s_chr;
static PyObject *__pyx_n_s_chrom;
static PyObject *__pyx_n_s_chrom_dist;
static PyObject *__pyx_n_s_chrom_list;
static PyObject *__pyx_kp_s_chrom_pos_refbase_alt_allele_PA;
static PyObject *__pyx_kp_s_chrom_pos_refbase_maj_allele_al;
static PyObject *__pyx_n_s_chrom_record;
static PyObject *__pyx_n_s_chrom_regions;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_col;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_copy_bed;
static PyObject *__pyx_n_s_copy_bed_name;
static PyObject *__pyx_n_s_copy_chrom;
static PyObject *__pyx_n_s_copy_end;
static PyObject *__pyx_n_s_copy_filter;
static PyObject *__pyx_n_s_copy_list;
static PyObject *__pyx_n_s_copy_list_pos;
static PyObject *__pyx_n_s_copy_record;
static PyObject *__pyx_n_s_copy_region;
static PyObject *__pyx_n_s_copy_regions;
static PyObject *__pyx_n_s_copy_start;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_counts;
static PyObject *__pyx_n_s_dbsnp_alt_alleles;
static PyObject *__pyx_n_s_dbsnp_bed_name;
static PyObject *__pyx_n_s_dbsnp_maj_allele;
static PyObject *__pyx_n_s_dbsnp_obs_overlap;
static PyObject *__pyx_n_s_delta;
static PyObject *__pyx_n_s_dist;
static PyObject *__pyx_n_s_dist_out;
static PyObject *__pyx_kp_s_done_calculating_chromosome_dist;
static PyObject *__pyx_kp_s_done_calculating_copy_number_dis;
static PyObject *__pyx_kp_s_done_loading_germline_record;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_eval;
static PyObject *__pyx_n_s_exp;
static PyObject *__pyx_n_s_factorial;
static PyObject *__pyx_n_s_fafile;
static PyObject *__pyx_n_s_fafile_name;
static PyObject *__pyx_n_s_fetch;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_flag;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_fmt;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_forward;
static PyObject *__pyx_n_s_fourth_allele;
static PyObject *__pyx_n_s_fourth_count;
static PyObject *__pyx_n_s_fwd;
static PyObject *__pyx_n_s_fwd_ratio;
static PyObject *__pyx_n_s_gammaln;
static PyObject *__pyx_n_s_genome;
static PyObject *__pyx_n_s_get_dist;
static PyObject *__pyx_n_s_getrname;
static PyObject *__pyx_n_s_hap_alt;
static PyObject *__pyx_n_s_hap_filter;
static PyObject *__pyx_n_s_hap_ref;
static PyObject *__pyx_n_s_hapmap_file;
static PyObject *__pyx_n_s_hapmap_present;
static PyObject *__pyx_n_s_hapmap_record;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_copy;
static PyObject *__pyx_n_s_is_proper_pair;
static PyObject *__pyx_n_s_is_reverse;
static PyObject *__pyx_n_s_it;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_labels;
static PyObject *__pyx_n_s_lengths;
static PyObject *__pyx_n_s_line;
static PyObject *__pyx_n_s_load;
static PyObject *__pyx_kp_s_loading_germline_record;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_maj_allele;
static PyObject *__pyx_n_s_maj_count;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_mapq;
static PyObject *__pyx_n_s_mapqual;
static PyObject *__pyx_n_s_max_depth;
static PyObject *__pyx_n_s_mean;
static PyObject *__pyx_n_s_mean_mapq;
static PyObject *__pyx_n_s_mean_qual;
static PyObject *__pyx_n_s_min_af;
static PyObject *__pyx_n_s_min_baseq;
static PyObject *__pyx_n_s_min_f_r;
static PyObject *__pyx_n_s_min_hetero;
static PyObject *__pyx_n_s_min_mapq;
static PyObject *__pyx_n_s_min_pvalue;
static PyObject *__pyx_n_s_min_qual;
static PyObject *__pyx_n_s_min_reads;
static PyObject *__pyx_n_s_min_se;
static PyObject *__pyx_n_s_min_support;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_kp_s_n_alt_count_rvs_ratio_fwd_ratio;
static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_obs_alleles;
static PyObject *__pyx_n_s_open;
static PyObject *__pyx_n_s_out_file;
static PyObject *__pyx_n_s_pileup;
static PyObject *__pyx_n_s_plp;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_possible_germs;
static PyObject *__pyx_n_s_pres;
static PyObject *__pyx_n_s_previous_copy_region;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_prob_not_hetero;
static PyObject *__pyx_n_s_prob_not_se;
static PyObject *__pyx_n_s_pvalue;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qual;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rb;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_record;
static PyObject *__pyx_n_s_ref_filter;
static PyObject *__pyx_n_s_refbase;
static PyObject *__pyx_n_s_reference;
static PyObject *__pyx_n_s_references;
static PyObject *__pyx_n_s_region_chrom;
static PyObject *__pyx_n_s_region_end;
static PyObject *__pyx_n_s_region_start;
static PyObject *__pyx_n_s_repeat;
static PyObject *__pyx_n_s_rev;
static PyObject *__pyx_n_s_reverse;
static PyObject *__pyx_n_s_rna_filter;
static PyObject *__pyx_n_s_rna_seq;
static PyObject *__pyx_n_s_rna_seq_file;
static PyObject *__pyx_n_s_rna_seq_file_name;
static PyObject *__pyx_n_s_rnq_seq_file;
static PyObject *__pyx_n_s_rvs_ratio;
static PyObject *__pyx_n_s_samfile;
static PyObject *__pyx_n_s_samfile_name;
static PyObject *__pyx_n_s_scipy;
static PyObject *__pyx_n_s_scipy_misc;
static PyObject *__pyx_n_s_scipy_special;
static PyObject *__pyx_n_s_scipy_stats;
static PyObject *__pyx_n_s_seen_chroms;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_stats;
static PyObject *__pyx_kp_s_storing_chromosome_dbsnp_interse;
static PyObject *__pyx_kp_s_storing_dbsnp_copy_number_inters;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_third_allele;
static PyObject *__pyx_n_s_third_count;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_total_alleles;
static PyObject *__pyx_n_s_total_baseq;
static PyObject *__pyx_n_s_total_counts;
static PyObject *__pyx_n_s_truncate;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_write_mutations;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_float_1_;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_float_0_0001;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_8000;
static PyObject *__pyx_int_80000;
static PyObject *__pyx_slice_;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_codeobj__17;
static PyObject *__pyx_codeobj__19;

/* "SomVarIUS_calling.pyx":25
 * 
 * 
 * cdef tuple fit_beta_binomial(np.ndarray[np.double_t, ndim=1] xi,             # <<<<<<<<<<<<<<
 *  	 						np.ndarray[np.double_t, ndim=1] ni):
 * 
 */

static PyObject *__pyx_f_17SomVarIUS_calling_fit_beta_binomial(PyArrayObject *__pyx_v_xi, PyArrayObject *__pyx_v_ni) {
  PyArrayObject *__pyx_v_pi = 0;
  PyArrayObject *__pyx_v_wi = 0;
  CYTHON_UNUSED int __pyx_v_i;
  long double __pyx_v_w;
  long double __pyx_v_p;
  long double __pyx_v_q;
  long double __pyx_v_mu;
  long double __pyx_v_gamma;
  long double __pyx_v_old_gamma;
  CYTHON_UNUSED long double __pyx_v_rho;
  long double __pyx_v_beta;
  long double __pyx_v_alpha;
  PyObject *__pyx_v_S = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_theta = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_ni;
  __Pyx_Buffer __pyx_pybuffer_ni;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_pi;
  __Pyx_Buffer __pyx_pybuffer_pi;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_wi;
  __Pyx_Buffer __pyx_pybuffer_wi;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_xi;
  __Pyx_Buffer __pyx_pybuffer_xi;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyArrayObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  long double __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  long double __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fit_beta_binomial", 0);
  __pyx_pybuffer_pi.pybuffer.buf = NULL;
  __pyx_pybuffer_pi.refcount = 0;
  __pyx_pybuffernd_pi.data = NULL;
  __pyx_pybuffernd_pi.rcbuffer = &__pyx_pybuffer_pi;
  __pyx_pybuffer_wi.pybuffer.buf = NULL;
  __pyx_pybuffer_wi.refcount = 0;
  __pyx_pybuffernd_wi.data = NULL;
  __pyx_pybuffernd_wi.rcbuffer = &__pyx_pybuffer_wi;
  __pyx_pybuffer_xi.pybuffer.buf = NULL;
  __pyx_pybuffer_xi.refcount = 0;
  __pyx_pybuffernd_xi.data = NULL;
  __pyx_pybuffernd_xi.rcbuffer = &__pyx_pybuffer_xi;
  __pyx_pybuffer_ni.pybuffer.buf = NULL;
  __pyx_pybuffer_ni.refcount = 0;
  __pyx_pybuffernd_ni.data = NULL;
  __pyx_pybuffernd_ni.rcbuffer = &__pyx_pybuffer_ni;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_xi.rcbuffer->pybuffer, (PyObject*)__pyx_v_xi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_xi.diminfo[0].strides = __pyx_pybuffernd_xi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_xi.diminfo[0].shape = __pyx_pybuffernd_xi.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ni.rcbuffer->pybuffer, (PyObject*)__pyx_v_ni, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_ni.diminfo[0].strides = __pyx_pybuffernd_ni.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ni.diminfo[0].shape = __pyx_pybuffernd_ni.rcbuffer->pybuffer.shape[0];

  /* "SomVarIUS_calling.pyx":33
 * 	cdef long double rho, beta, alpha
 * 
 * 	pi=xi/ni             # <<<<<<<<<<<<<<
 * 
 * 	# initializing weights and gamma. The weights will be updated recursively later on.
 */
  __pyx_t_1 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_xi), ((PyObject *)__pyx_v_ni)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pi.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pi.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pi.rcbuffer->pybuffer, (PyObject*)__pyx_v_pi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      }
    }
    __pyx_pybuffernd_pi.diminfo[0].strides = __pyx_pybuffernd_pi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pi.diminfo[0].shape = __pyx_pybuffernd_pi.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = 0;
  __pyx_v_pi = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":36
 * 
 * 	# initializing weights and gamma. The weights will be updated recursively later on.
 * 	wi = np.repeat(1.0, len(xi))             # <<<<<<<<<<<<<<
 * 	gamma=1
 * 
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_repeat); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = PyObject_Length(((PyObject *)__pyx_v_xi)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_9 = 1;
    }
  }
  __pyx_t_11 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_10) {
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
  }
  __Pyx_INCREF(__pyx_float_1_0);
  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_9, __pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_9, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_wi.rcbuffer->pybuffer);
    __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wi.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
    if (unlikely(__pyx_t_3 < 0)) {
      PyErr_Fetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
      if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wi.rcbuffer->pybuffer, (PyObject*)__pyx_v_wi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
        Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_4);
        __Pyx_RaiseBufferFallbackError();
      } else {
        PyErr_Restore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
      }
    }
    __pyx_pybuffernd_wi.diminfo[0].strides = __pyx_pybuffernd_wi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wi.diminfo[0].shape = __pyx_pybuffernd_wi.rcbuffer->pybuffer.shape[0];
    if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = 0;
  __pyx_v_wi = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":37
 * 	# initializing weights and gamma. The weights will be updated recursively later on.
 * 	wi = np.repeat(1.0, len(xi))
 * 	gamma=1             # <<<<<<<<<<<<<<
 * 
 * 	for i in xrange(1,100):
 */
  __pyx_v_gamma = 1.0;

  /* "SomVarIUS_calling.pyx":39
 * 	gamma=1
 * 
 * 	for i in xrange(1,100):             # <<<<<<<<<<<<<<
 * 		w = sum(wi)
 * 		p = sum(wi*pi)/w
 */
  for (__pyx_t_3 = 1; __pyx_t_3 < 100; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "SomVarIUS_calling.pyx":40
 * 
 * 	for i in xrange(1,100):
 * 		w = sum(wi)             # <<<<<<<<<<<<<<
 * 		p = sum(wi*pi)/w
 * 		q = (1-p)
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)__pyx_v_wi));
    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_wi));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_wi));
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_12 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_w = __pyx_t_12;

    /* "SomVarIUS_calling.pyx":41
 * 	for i in xrange(1,100):
 * 		w = sum(wi)
 * 		p = sum(wi*pi)/w             # <<<<<<<<<<<<<<
 * 		q = (1-p)
 * 
 */
    __pyx_t_8 = PyNumber_Multiply(((PyObject *)__pyx_v_wi), ((PyObject *)__pyx_v_pi)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __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_1); __pyx_t_1 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_12 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_p = __pyx_t_12;

    /* "SomVarIUS_calling.pyx":42
 * 		w = sum(wi)
 * 		p = sum(wi*pi)/w
 * 		q = (1-p)             # <<<<<<<<<<<<<<
 * 
 * 		S = sum(wi*(pi-p)**2)
 */
    __pyx_v_q = (1.0 - __pyx_v_p);

    /* "SomVarIUS_calling.pyx":44
 * 		q = (1-p)
 * 
 * 		S = sum(wi*(pi-p)**2)             # <<<<<<<<<<<<<<
 * 
 * 		mu = p
 */
    __pyx_t_11 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_pi), __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_wi), __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __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 = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF_SET(__pyx_v_S, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":46
 * 		S = sum(wi*(pi-p)**2)
 * 
 * 		mu = p             # <<<<<<<<<<<<<<
 * 		old_gamma = gamma
 * 		gamma = (S-p*q*(sum((wi/ni)*(1-wi/w))))/(p*q*(sum(wi*(1-wi/w))-sum((wi/ni)*(1-wi/w))))
 */
    __pyx_v_mu = __pyx_v_p;

    /* "SomVarIUS_calling.pyx":47
 * 
 * 		mu = p
 * 		old_gamma = gamma             # <<<<<<<<<<<<<<
 * 		gamma = (S-p*q*(sum((wi/ni)*(1-wi/w))))/(p*q*(sum(wi*(1-wi/w))-sum((wi/ni)*(1-wi/w))))
 * 		wi=ni/(1+gamma*(ni-1))
 */
    __pyx_v_old_gamma = __pyx_v_gamma;

    /* "SomVarIUS_calling.pyx":48
 * 		mu = p
 * 		old_gamma = gamma
 * 		gamma = (S-p*q*(sum((wi/ni)*(1-wi/w))))/(p*q*(sum(wi*(1-wi/w))-sum((wi/ni)*(1-wi/w))))             # <<<<<<<<<<<<<<
 * 		wi=ni/(1+gamma*(ni-1))
 * 		if(abs(old_gamma-gamma)<0.0001):
 */
    __pyx_t_1 = PyFloat_FromDouble((__pyx_v_p * __pyx_v_q)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_wi), ((PyObject *)__pyx_v_ni)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = PyFloat_FromDouble(__pyx_v_w); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_wi), __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_Subtract(__pyx_int_1, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__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 = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Subtract(__pyx_v_S, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = PyFloat_FromDouble((__pyx_v_p * __pyx_v_q)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_wi), __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Subtract(__pyx_int_1, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = PyNumber_Multiply(((PyObject *)__pyx_v_wi), __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __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 = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_wi), ((PyObject *)__pyx_v_ni)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = PyFloat_FromDouble(__pyx_v_w); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_13 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_wi), __pyx_t_10); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Subtract(__pyx_int_1, __pyx_t_13); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Multiply(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_13);
    __pyx_t_13 = 0;
    __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_10, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = PyNumber_Subtract(__pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Multiply(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_13); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_12 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_gamma = __pyx_t_12;

    /* "SomVarIUS_calling.pyx":49
 * 		old_gamma = gamma
 * 		gamma = (S-p*q*(sum((wi/ni)*(1-wi/w))))/(p*q*(sum(wi*(1-wi/w))-sum((wi/ni)*(1-wi/w))))
 * 		wi=ni/(1+gamma*(ni-1))             # <<<<<<<<<<<<<<
 * 		if(abs(old_gamma-gamma)<0.0001):
 * 			break
 */
    __pyx_t_10 = PyFloat_FromDouble(__pyx_v_gamma); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_13 = PyNumber_Subtract(((PyObject *)__pyx_v_ni), __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_10, __pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_int_1, __pyx_t_7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_ni), __pyx_t_13); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = ((PyArrayObject *)__pyx_t_7);
    {
      __Pyx_BufFmt_StackElem __pyx_stack[1];
      __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_wi.rcbuffer->pybuffer);
      __pyx_t_14 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wi.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
      if (unlikely(__pyx_t_14 < 0)) {
        PyErr_Fetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
        if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_wi.rcbuffer->pybuffer, (PyObject*)__pyx_v_wi, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
          Py_XDECREF(__pyx_t_4); Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6);
          __Pyx_RaiseBufferFallbackError();
        } else {
          PyErr_Restore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        }
      }
      __pyx_pybuffernd_wi.diminfo[0].strides = __pyx_pybuffernd_wi.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_wi.diminfo[0].shape = __pyx_pybuffernd_wi.rcbuffer->pybuffer.shape[0];
      if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_wi, ((PyArrayObject *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "SomVarIUS_calling.pyx":50
 * 		gamma = (S-p*q*(sum((wi/ni)*(1-wi/w))))/(p*q*(sum(wi*(1-wi/w))-sum((wi/ni)*(1-wi/w))))
 * 		wi=ni/(1+gamma*(ni-1))
 * 		if(abs(old_gamma-gamma)<0.0001):             # <<<<<<<<<<<<<<
 * 			break
 * 
 */
    __pyx_t_7 = PyFloat_FromDouble((__pyx_v_old_gamma - __pyx_v_gamma)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_13, __pyx_float_0_0001, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_15) {

      /* "SomVarIUS_calling.pyx":51
 * 		wi=ni/(1+gamma*(ni-1))
 * 		if(abs(old_gamma-gamma)<0.0001):
 * 			break             # <<<<<<<<<<<<<<
 * 
 * 	rho=theta=gamma/(1-gamma)
 */
      goto __pyx_L4_break;
    }
  }
  __pyx_L4_break:;

  /* "SomVarIUS_calling.pyx":53
 * 			break
 * 
 * 	rho=theta=gamma/(1-gamma)             # <<<<<<<<<<<<<<
 * 	beta=(1-mu)*(1/gamma-1)
 * 	alpha=mu*beta/(1-mu)
 */
  __pyx_t_12 = (1.0 - __pyx_v_gamma);
  if (unlikely(__pyx_t_12 == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = (__pyx_v_gamma / __pyx_t_12);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_t_16); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_v_rho = __pyx_t_16;
  __Pyx_INCREF(__pyx_t_7);
  __pyx_v_theta = __pyx_t_7;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "SomVarIUS_calling.pyx":54
 * 
 * 	rho=theta=gamma/(1-gamma)
 * 	beta=(1-mu)*(1/gamma-1)             # <<<<<<<<<<<<<<
 * 	alpha=mu*beta/(1-mu)
 * 
 */
  if (unlikely(__pyx_v_gamma == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_beta = ((1.0 - __pyx_v_mu) * ((1.0 / __pyx_v_gamma) - 1.0));

  /* "SomVarIUS_calling.pyx":55
 * 	rho=theta=gamma/(1-gamma)
 * 	beta=(1-mu)*(1/gamma-1)
 * 	alpha=mu*beta/(1-mu)             # <<<<<<<<<<<<<<
 * 
 * 	return alpha, beta
 */
  __pyx_t_16 = (__pyx_v_mu * __pyx_v_beta);
  __pyx_t_12 = (1.0 - __pyx_v_mu);
  if (unlikely(__pyx_t_12 == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_alpha = (__pyx_t_16 / __pyx_t_12);

  /* "SomVarIUS_calling.pyx":57
 * 	alpha=mu*beta/(1-mu)
 * 
 * 	return alpha, beta             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_13 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __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);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_7 = 0;
  __pyx_t_13 = 0;
  __pyx_r = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":25
 * 
 * 
 * cdef tuple fit_beta_binomial(np.ndarray[np.double_t, ndim=1] xi,             # <<<<<<<<<<<<<<
 *  	 						np.ndarray[np.double_t, ndim=1] ni):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ni.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pi.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_wi.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xi.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("SomVarIUS_calling.fit_beta_binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ni.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pi.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_wi.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_xi.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pi);
  __Pyx_XDECREF((PyObject *)__pyx_v_wi);
  __Pyx_XDECREF(__pyx_v_S);
  __Pyx_XDECREF(__pyx_v_theta);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":97
 * 
 * 
 * cdef long double log_dcm(np.ndarray[np.int_t, ndim=1] counts,             # <<<<<<<<<<<<<<
 *  					np.ndarray[np.double_t, ndim=1] alpha):
 * 	N = sum(counts)
 */

static long double __pyx_f_17SomVarIUS_calling_log_dcm(PyArrayObject *__pyx_v_counts, PyArrayObject *__pyx_v_alpha) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_A = NULL;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
  __Pyx_Buffer __pyx_pybuffer_alpha;
  __Pyx_LocalBuf_ND __pyx_pybuffernd_counts;
  __Pyx_Buffer __pyx_pybuffer_counts;
  long double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  long double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("log_dcm", 0);
  __pyx_pybuffer_counts.pybuffer.buf = NULL;
  __pyx_pybuffer_counts.refcount = 0;
  __pyx_pybuffernd_counts.data = NULL;
  __pyx_pybuffernd_counts.rcbuffer = &__pyx_pybuffer_counts;
  __pyx_pybuffer_alpha.pybuffer.buf = NULL;
  __pyx_pybuffer_alpha.refcount = 0;
  __pyx_pybuffernd_alpha.data = NULL;
  __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_counts.rcbuffer->pybuffer, (PyObject*)__pyx_v_counts, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_counts.diminfo[0].strides = __pyx_pybuffernd_counts.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_counts.diminfo[0].shape = __pyx_pybuffernd_counts.rcbuffer->pybuffer.shape[0];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_5numpy_double_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];

  /* "SomVarIUS_calling.pyx":99
 * cdef long double log_dcm(np.ndarray[np.int_t, ndim=1] counts,
 *  					np.ndarray[np.double_t, ndim=1] alpha):
 * 	N = sum(counts)             # <<<<<<<<<<<<<<
 * 	A = sum(alpha)
 * 	return gammaln(N+1) - sum(gammaln(counts+1)) + gammaln(A) - gammaln(N + A) + sum(gammaln(counts+alpha) - gammaln(alpha))
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_counts));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_counts));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_counts));
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":100
 *  					np.ndarray[np.double_t, ndim=1] alpha):
 * 	N = sum(counts)
 * 	A = sum(alpha)             # <<<<<<<<<<<<<<
 * 	return gammaln(N+1) - sum(gammaln(counts+1)) + gammaln(A) - gammaln(N + A) + sum(gammaln(counts+alpha) - gammaln(alpha))
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_alpha));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_alpha));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_alpha));
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_A = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":101
 * 	N = sum(counts)
 * 	A = sum(alpha)
 * 	return gammaln(N+1) - sum(gammaln(counts+1)) + gammaln(A) - gammaln(N + A) + sum(gammaln(counts+alpha) - gammaln(alpha))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gammaln); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_v_N, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_gammaln); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_counts), __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gammaln); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_A); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_v_A);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_A);
    __Pyx_GIVEREF(__pyx_v_A);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_gammaln); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_Add(__pyx_v_N, __pyx_v_A); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gammaln); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_counts), ((PyObject *)__pyx_v_alpha)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_gammaln); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_alpha)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_alpha));
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_alpha));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_alpha));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":97
 * 
 * 
 * cdef long double log_dcm(np.ndarray[np.int_t, ndim=1] counts,             # <<<<<<<<<<<<<<
 *  					np.ndarray[np.double_t, ndim=1] alpha):
 * 	N = sum(counts)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
    __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_WriteUnraisable("SomVarIUS_calling.log_dcm", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
  __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_counts.rcbuffer->pybuffer);
  __pyx_L2:;
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_A);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":104
 * 
 * 
 * cdef long double log_betabin(int k, int N,             # <<<<<<<<<<<<<<
 *  							long double a, long double b):
 * 	return log_dcm(np.array([k,N-k]),np.array([a,b]))
 */

static long double __pyx_f_17SomVarIUS_calling_log_betabin(int __pyx_v_k, int __pyx_v_N, long double __pyx_v_a, long double __pyx_v_b) {
  long double __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("log_betabin", 0);

  /* "SomVarIUS_calling.pyx":106
 * cdef long double log_betabin(int k, int N,
 *  							long double a, long double b):
 * 	return log_dcm(np.array([k,N-k]),np.array([a,b]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_N - __pyx_v_k)); 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 = PyList_New(2); 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);
  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); 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_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_b); 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_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_f_17SomVarIUS_calling_log_dcm(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":104
 * 
 * 
 * cdef long double log_betabin(int k, int N,             # <<<<<<<<<<<<<<
 *  							long double a, long double b):
 * 	return log_dcm(np.array([k,N-k]),np.array([a,b]))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("SomVarIUS_calling.log_betabin", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":109
 * 
 * 
 * cdef long double betabin_cdf(int k, int N,             # <<<<<<<<<<<<<<
 *  							long double a, long double b):
 * 	cdef int x
 */

static long double __pyx_f_17SomVarIUS_calling_betabin_cdf(int __pyx_v_k, int __pyx_v_N, long double __pyx_v_a, long double __pyx_v_b) {
  int __pyx_v_x;
  PyObject *__pyx_v_p = NULL;
  long double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  long __pyx_t_10;
  long double __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("betabin_cdf", 0);

  /* "SomVarIUS_calling.pyx":113
 * 	cdef int x
 * 
 * 	if k > 0.5 * N:             # <<<<<<<<<<<<<<
 * 		p = 1. - sum([np.exp(log_betabin(x,N,a,b)) for x in xrange(k+1,N)])
 * 	else:
 */
  __pyx_t_1 = ((__pyx_v_k > (0.5 * __pyx_v_N)) != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":114
 * 
 * 	if k > 0.5 * N:
 * 		p = 1. - sum([np.exp(log_betabin(x,N,a,b)) for x in xrange(k+1,N)])             # <<<<<<<<<<<<<<
 * 	else:
 * 		p = sum([np.exp(log_betabin(x,N,a,b)) for x in xrange(k+1)])
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_N;
    for (__pyx_t_4 = (__pyx_v_k + 1); __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_x = __pyx_t_4;
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exp); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyFloat_FromDouble(__pyx_f_17SomVarIUS_calling_log_betabin(__pyx_v_x, __pyx_v_N, __pyx_v_a, __pyx_v_b)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_8) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __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 = NULL;
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Subtract(__pyx_float_1_, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_p = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "SomVarIUS_calling.pyx":116
 * 		p = 1. - sum([np.exp(log_betabin(x,N,a,b)) for x in xrange(k+1,N)])
 * 	else:
 * 		p = sum([np.exp(log_betabin(x,N,a,b)) for x in xrange(k+1)])             # <<<<<<<<<<<<<<
 * 	return p
 * 
 */
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = (__pyx_v_k + 1);
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_10; __pyx_t_3+=1) {
      __pyx_v_x = __pyx_t_3;
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyFloat_FromDouble(__pyx_f_17SomVarIUS_calling_log_betabin(__pyx_v_x, __pyx_v_N, __pyx_v_a, __pyx_v_b)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_6) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_p = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "SomVarIUS_calling.pyx":117
 * 	else:
 * 		p = sum([np.exp(log_betabin(x,N,a,b)) for x in xrange(k+1)])
 * 	return p             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_p); if (unlikely((__pyx_t_11 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_11;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":109
 * 
 * 
 * cdef long double betabin_cdf(int k, int N,             # <<<<<<<<<<<<<<
 *  							long double a, long double b):
 * 	cdef int x
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("SomVarIUS_calling.betabin_cdf", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":120
 * 
 * 
 * cdef list generate_chrom_dist(chroms, lengths):             # <<<<<<<<<<<<<<
 * 
 * 	cdef list chrom_regions = []
 */

static PyObject *__pyx_f_17SomVarIUS_calling_generate_chrom_dist(PyObject *__pyx_v_chroms, PyObject *__pyx_v_lengths) {
  PyObject *__pyx_v_chrom_regions = 0;
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_start;
  int __pyx_v_end;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generate_chrom_dist", 0);

  /* "SomVarIUS_calling.pyx":122
 * cdef list generate_chrom_dist(chroms, lengths):
 * 
 * 	cdef list chrom_regions = []             # <<<<<<<<<<<<<<
 * 	cdef str chrom
 * 	cdef int start, end
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_chrom_regions = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":125
 * 	cdef str chrom
 * 	cdef int start, end
 * 	for i in xrange(len(chroms)):             # <<<<<<<<<<<<<<
 * 		chrom = chroms[i]
 * 		start = 1
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_chroms); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "SomVarIUS_calling.pyx":126
 * 	cdef int start, end
 * 	for i in xrange(len(chroms)):
 * 		chrom = chroms[i]             # <<<<<<<<<<<<<<
 * 		start = 1
 * 		end = lengths[i]
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_chroms, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":127
 * 	for i in xrange(len(chroms)):
 * 		chrom = chroms[i]
 * 		start = 1             # <<<<<<<<<<<<<<
 * 		end = lengths[i]
 * 		chrom_regions.append([chrom, start, end])
 */
    __pyx_v_start = 1;

    /* "SomVarIUS_calling.pyx":128
 * 		chrom = chroms[i]
 * 		start = 1
 * 		end = lengths[i]             # <<<<<<<<<<<<<<
 * 		chrom_regions.append([chrom, start, end])
 * 	return chrom_regions
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_lengths, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_end = __pyx_t_4;

    /* "SomVarIUS_calling.pyx":129
 * 		start = 1
 * 		end = lengths[i]
 * 		chrom_regions.append([chrom, start, end])             # <<<<<<<<<<<<<<
 * 	return chrom_regions
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_end); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_chrom);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_chrom);
    __Pyx_GIVEREF(__pyx_v_chrom);
    PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_chrom_regions, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "SomVarIUS_calling.pyx":130
 * 		end = lengths[i]
 * 		chrom_regions.append([chrom, start, end])
 * 	return chrom_regions             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_chrom_regions);
  __pyx_r = __pyx_v_chrom_regions;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":120
 * 
 * 
 * cdef list generate_chrom_dist(chroms, lengths):             # <<<<<<<<<<<<<<
 * 
 * 	cdef list chrom_regions = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("SomVarIUS_calling.generate_chrom_dist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom_regions);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":133
 * 
 * 
 * cdef tuple track_copy_pos(str chrom, int pos, list copy_list, set seen_chroms, int copy_list_pos):             # <<<<<<<<<<<<<<
 * 
 * 	cdef bint in_copy = False
 */

static PyObject *__pyx_f_17SomVarIUS_calling_track_copy_pos(PyObject *__pyx_v_chrom, int __pyx_v_pos, PyObject *__pyx_v_copy_list, PyObject *__pyx_v_seen_chroms, int __pyx_v_copy_list_pos) {
  int __pyx_v_in_copy;
  PyObject *__pyx_v_copy_chrom = 0;
  int __pyx_v_copy_start;
  int __pyx_v_copy_end;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("track_copy_pos", 0);

  /* "SomVarIUS_calling.pyx":135
 * cdef tuple track_copy_pos(str chrom, int pos, list copy_list, set seen_chroms, int copy_list_pos):
 * 
 * 	cdef bint in_copy = False             # <<<<<<<<<<<<<<
 * 	cdef str copy_chrom
 * 	cdef int copy_start, copy_end
 */
  __pyx_v_in_copy = 0;

  /* "SomVarIUS_calling.pyx":139
 * 	cdef int copy_start, copy_end
 * 
 * 	for i in xrange(copy_list_pos, len(copy_list)):             # <<<<<<<<<<<<<<
 * 		copy_chrom = copy_list[i][0]
 * 		copy_start = int(copy_list[i][1])
 */
  if (unlikely(__pyx_v_copy_list == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_copy_list); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (__pyx_t_2 = __pyx_v_copy_list_pos; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "SomVarIUS_calling.pyx":140
 * 
 * 	for i in xrange(copy_list_pos, len(copy_list)):
 * 		copy_chrom = copy_list[i][0]             # <<<<<<<<<<<<<<
 * 		copy_start = int(copy_list[i][1])
 * 		copy_end = int(copy_list[i][2])
 */
    if (unlikely(__pyx_v_copy_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_copy_list, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_copy_chrom, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "SomVarIUS_calling.pyx":141
 * 	for i in xrange(copy_list_pos, len(copy_list)):
 * 		copy_chrom = copy_list[i][0]
 * 		copy_start = int(copy_list[i][1])             # <<<<<<<<<<<<<<
 * 		copy_end = int(copy_list[i][2])
 * 		if copy_chrom == chrom:
 */
    if (unlikely(__pyx_v_copy_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_copy_list, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_copy_start = __pyx_t_5;

    /* "SomVarIUS_calling.pyx":142
 * 		copy_chrom = copy_list[i][0]
 * 		copy_start = int(copy_list[i][1])
 * 		copy_end = int(copy_list[i][2])             # <<<<<<<<<<<<<<
 * 		if copy_chrom == chrom:
 * 			seen_chroms.add(chrom)
 */
    if (unlikely(__pyx_v_copy_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_copy_list, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_copy_end = __pyx_t_5;

    /* "SomVarIUS_calling.pyx":143
 * 		copy_start = int(copy_list[i][1])
 * 		copy_end = int(copy_list[i][2])
 * 		if copy_chrom == chrom:             # <<<<<<<<<<<<<<
 * 			seen_chroms.add(chrom)
 * 			if pos >= copy_start and pos <= copy_end:
 */
    __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_copy_chrom, __pyx_v_chrom, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (__pyx_t_7) {

      /* "SomVarIUS_calling.pyx":144
 * 		copy_end = int(copy_list[i][2])
 * 		if copy_chrom == chrom:
 * 			seen_chroms.add(chrom)             # <<<<<<<<<<<<<<
 * 			if pos >= copy_start and pos <= copy_end:
 * 				in_copy = True
 */
      if (unlikely(__pyx_v_seen_chroms == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_8 = PySet_Add(__pyx_v_seen_chroms, __pyx_v_chrom); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "SomVarIUS_calling.pyx":145
 * 		if copy_chrom == chrom:
 * 			seen_chroms.add(chrom)
 * 			if pos >= copy_start and pos <= copy_end:             # <<<<<<<<<<<<<<
 * 				in_copy = True
 * 				return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy
 */
      __pyx_t_6 = ((__pyx_v_pos >= __pyx_v_copy_start) != 0);
      if (__pyx_t_6) {
      } else {
        __pyx_t_7 = __pyx_t_6;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_6 = ((__pyx_v_pos <= __pyx_v_copy_end) != 0);
      __pyx_t_7 = __pyx_t_6;
      __pyx_L7_bool_binop_done:;
      if (__pyx_t_7) {

        /* "SomVarIUS_calling.pyx":146
 * 			seen_chroms.add(chrom)
 * 			if pos >= copy_start and pos <= copy_end:
 * 				in_copy = True             # <<<<<<<<<<<<<<
 * 				return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy
 * 			elif pos < copy_start:
 */
        __pyx_v_in_copy = 1;

        /* "SomVarIUS_calling.pyx":147
 * 			if pos >= copy_start and pos <= copy_end:
 * 				in_copy = True
 * 				return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy             # <<<<<<<<<<<<<<
 * 			elif pos < copy_start:
 * 				return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_copy_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_copy_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_in_copy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = PyTuple_New(6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_v_copy_chrom);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_copy_chrom);
        __Pyx_GIVEREF(__pyx_v_copy_chrom);
        PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_seen_chroms);
        PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_v_seen_chroms);
        __Pyx_GIVEREF(__pyx_v_seen_chroms);
        PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_4 = 0;
        __pyx_t_3 = 0;
        __pyx_t_9 = 0;
        __pyx_t_10 = 0;
        __pyx_r = ((PyObject*)__pyx_t_11);
        __pyx_t_11 = 0;
        goto __pyx_L0;
      }

      /* "SomVarIUS_calling.pyx":148
 * 				in_copy = True
 * 				return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy
 * 			elif pos < copy_start:             # <<<<<<<<<<<<<<
 * 				return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy
 * 			else:
 */
      __pyx_t_7 = ((__pyx_v_pos < __pyx_v_copy_start) != 0);
      if (__pyx_t_7) {

        /* "SomVarIUS_calling.pyx":149
 * 				return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy
 * 			elif pos < copy_start:
 * 				return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy             # <<<<<<<<<<<<<<
 * 			else:
 * 				pass
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_copy_start); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_copy_end); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_in_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_copy_chrom);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_copy_chrom);
        __Pyx_GIVEREF(__pyx_v_copy_chrom);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_seen_chroms);
        PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_seen_chroms);
        __Pyx_GIVEREF(__pyx_v_seen_chroms);
        PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_11 = 0;
        __pyx_t_10 = 0;
        __pyx_t_9 = 0;
        __pyx_t_3 = 0;
        __pyx_r = ((PyObject*)__pyx_t_4);
        __pyx_t_4 = 0;
        goto __pyx_L0;
      }
      /*else*/ {
      }
      goto __pyx_L5;
    }

    /* "SomVarIUS_calling.pyx":152
 * 			else:
 * 				pass
 * 		elif chrom in seen_chroms:             # <<<<<<<<<<<<<<
 * 			return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy
 * 		else:
 */
    __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_chrom, __pyx_v_seen_chroms, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "SomVarIUS_calling.pyx":153
 * 				pass
 * 		elif chrom in seen_chroms:
 * 			return copy_chrom, copy_start, copy_end, i, seen_chroms, in_copy             # <<<<<<<<<<<<<<
 * 		else:
 * 			pass
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_copy_start); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_copy_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_v_in_copy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyTuple_New(6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_copy_chrom);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_copy_chrom);
      __Pyx_GIVEREF(__pyx_v_copy_chrom);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_seen_chroms);
      PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_v_seen_chroms);
      __Pyx_GIVEREF(__pyx_v_seen_chroms);
      PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_4 = 0;
      __pyx_t_3 = 0;
      __pyx_t_9 = 0;
      __pyx_t_10 = 0;
      __pyx_r = ((PyObject*)__pyx_t_11);
      __pyx_t_11 = 0;
      goto __pyx_L0;
    }
    /*else*/ {
    }
    __pyx_L5:;
  }

  /* "SomVarIUS_calling.pyx":157
 * 			pass
 * 
 * 	copy_chrom = copy_list[copy_list_pos][0]             # <<<<<<<<<<<<<<
 * 	copy_start = int(copy_list[copy_list_pos][1])
 * 	copy_end = int(copy_list[copy_list_pos][2])
 */
  if (unlikely(__pyx_v_copy_list == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_copy_list, __pyx_v_copy_list_pos, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (!(likely(PyString_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_10)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF_SET(__pyx_v_copy_chrom, ((PyObject*)__pyx_t_10));
  __pyx_t_10 = 0;

  /* "SomVarIUS_calling.pyx":158
 * 
 * 	copy_chrom = copy_list[copy_list_pos][0]
 * 	copy_start = int(copy_list[copy_list_pos][1])             # <<<<<<<<<<<<<<
 * 	copy_end = int(copy_list[copy_list_pos][2])
 * 	in_copy = False
 */
  if (unlikely(__pyx_v_copy_list == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_copy_list, __pyx_v_copy_list_pos, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_copy_start = __pyx_t_5;

  /* "SomVarIUS_calling.pyx":159
 * 	copy_chrom = copy_list[copy_list_pos][0]
 * 	copy_start = int(copy_list[copy_list_pos][1])
 * 	copy_end = int(copy_list[copy_list_pos][2])             # <<<<<<<<<<<<<<
 * 	in_copy = False
 * 	return copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy
 */
  if (unlikely(__pyx_v_copy_list == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_copy_list, __pyx_v_copy_list_pos, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_copy_end = __pyx_t_5;

  /* "SomVarIUS_calling.pyx":160
 * 	copy_start = int(copy_list[copy_list_pos][1])
 * 	copy_end = int(copy_list[copy_list_pos][2])
 * 	in_copy = False             # <<<<<<<<<<<<<<
 * 	return copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy
 * 
 */
  __pyx_v_in_copy = 0;

  /* "SomVarIUS_calling.pyx":161
 * 	copy_end = int(copy_list[copy_list_pos][2])
 * 	in_copy = False
 * 	return copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_copy_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_copy_end); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_in_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_copy_chrom);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_copy_chrom);
  __Pyx_GIVEREF(__pyx_v_copy_chrom);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_9);
  __Pyx_INCREF(__pyx_v_seen_chroms);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_seen_chroms);
  __Pyx_GIVEREF(__pyx_v_seen_chroms);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_9 = 0;
  __pyx_t_3 = 0;
  __pyx_r = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":133
 * 
 * 
 * cdef tuple track_copy_pos(str chrom, int pos, list copy_list, set seen_chroms, int copy_list_pos):             # <<<<<<<<<<<<<<
 * 
 * 	cdef bint in_copy = False
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SomVarIUS_calling.track_copy_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_copy_chrom);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":164
 * 
 * 
 * def get_dist(copy_record, Samfile samfile, dict ba_to_bed,             # <<<<<<<<<<<<<<
 *  			int min_reads, int min_support, int min_mapq,
 * 			int min_baseq, dict genome, bint copy_bed=False):
 */

/* Python wrapper */
static PyObject *__pyx_pw_17SomVarIUS_calling_1get_dist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_17SomVarIUS_calling_get_dist[] = "get_dist(copy_record, Samfile samfile, dict ba_to_bed, int min_reads, int min_support, int min_mapq, int min_baseq, dict genome, bool copy_bed=False)";
static PyMethodDef __pyx_mdef_17SomVarIUS_calling_1get_dist = {"get_dist", (PyCFunction)__pyx_pw_17SomVarIUS_calling_1get_dist, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17SomVarIUS_calling_get_dist};
static PyObject *__pyx_pw_17SomVarIUS_calling_1get_dist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_copy_record = 0;
  struct __pyx_obj_5pysam_8csamfile_Samfile *__pyx_v_samfile = 0;
  PyObject *__pyx_v_ba_to_bed = 0;
  int __pyx_v_min_reads;
  int __pyx_v_min_support;
  int __pyx_v_min_mapq;
  int __pyx_v_min_baseq;
  CYTHON_UNUSED PyObject *__pyx_v_genome = 0;
  CYTHON_UNUSED int __pyx_v_copy_bed;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_dist (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_copy_record,&__pyx_n_s_samfile,&__pyx_n_s_ba_to_bed,&__pyx_n_s_min_reads,&__pyx_n_s_min_support,&__pyx_n_s_min_mapq,&__pyx_n_s_min_baseq,&__pyx_n_s_genome,&__pyx_n_s_copy_bed,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_copy_record)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_dist", 0, 8, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ba_to_bed)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_dist", 0, 8, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_reads)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_dist", 0, 8, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_support)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_dist", 0, 8, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_mapq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_dist", 0, 8, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_baseq)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_dist", 0, 8, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  7:
        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_genome)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_dist", 0, 8, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_copy_bed);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_dist") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_copy_record = values[0];
    __pyx_v_samfile = ((struct __pyx_obj_5pysam_8csamfile_Samfile *)values[1]);
    __pyx_v_ba_to_bed = ((PyObject*)values[2]);
    __pyx_v_min_reads = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_min_reads == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_min_support = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_min_support == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_min_mapq = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_min_mapq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_min_baseq = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_min_baseq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_genome = ((PyObject*)values[7]);
    if (values[8]) {
      __pyx_v_copy_bed = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_copy_bed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "SomVarIUS_calling.pyx":166
 * def get_dist(copy_record, Samfile samfile, dict ba_to_bed,
 *  			int min_reads, int min_support, int min_mapq,
 * 			int min_baseq, dict genome, bint copy_bed=False):             # <<<<<<<<<<<<<<
 * 
 * 	cdef _CountAllele A, T, G, C
 */
      __pyx_v_copy_bed = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_dist", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("SomVarIUS_calling.get_dist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile), __pyx_ptype_5pysam_8csamfile_Samfile, 1, "samfile", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ba_to_bed), (&PyDict_Type), 1, "ba_to_bed", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_genome), (&PyDict_Type), 1, "genome", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_17SomVarIUS_calling_get_dist(__pyx_self, __pyx_v_copy_record, __pyx_v_samfile, __pyx_v_ba_to_bed, __pyx_v_min_reads, __pyx_v_min_support, __pyx_v_min_mapq, __pyx_v_min_baseq, __pyx_v_genome, __pyx_v_copy_bed);

  /* "SomVarIUS_calling.pyx":164
 * 
 * 
 * def get_dist(copy_record, Samfile samfile, dict ba_to_bed,             # <<<<<<<<<<<<<<
 *  			int min_reads, int min_support, int min_mapq,
 * 			int min_baseq, dict genome, bint copy_bed=False):
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_17SomVarIUS_calling_get_dist(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_copy_record, struct __pyx_obj_5pysam_8csamfile_Samfile *__pyx_v_samfile, PyObject *__pyx_v_ba_to_bed, int __pyx_v_min_reads, int __pyx_v_min_support, int __pyx_v_min_mapq, int __pyx_v_min_baseq, CYTHON_UNUSED PyObject *__pyx_v_genome, CYTHON_UNUSED int __pyx_v_copy_bed) {
  struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_A;
  struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_T;
  struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_G;
  struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_C;
  PyObject *__pyx_v_chrom = 0;
  PyObject *__pyx_v_alnbase = 0;
  PyObject *__pyx_v_base = 0;
  int __pyx_v_pos;
  int __pyx_v_i;
  struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_col = 0;
  bam_pileup1_t **__pyx_v_plp;
  bam_pileup1_t *__pyx_v_read;
  bam1_t *__pyx_v_aln;
  PyObject *__pyx_v_alleles = 0;
  int __pyx_v_is_reverse;
  int __pyx_v_is_proper_pair;
  int __pyx_v_mapq;
  double __pyx_v_baseq;
  PyObject *__pyx_v_counts = 0;
  PyObject *__pyx_v_labels = 0;
  PyObject *__pyx_v_copy_region = 0;
  PyObject *__pyx_v_copy_list = 0;
  int __pyx_v_n;
  long double __pyx_v_alpha;
  long double __pyx_v_beta;
  long double __pyx_v_mean;
  long double __pyx_v_total_counts;
  PyObject *__pyx_v_dbsnp_maj_allele = 0;
  PyObject *__pyx_v_dbsnp_alt_alleles = 0;
  PyObject *__pyx_v_previous_copy_region = 0;
  PyObject *__pyx_v_record = NULL;
  PyObject *__pyx_v_it = NULL;
  uint16_t __pyx_v_flag;
  PyObject *__pyx_v_obs_alleles = NULL;
  PyObject *__pyx_v_dbsnp_obs_overlap = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  bam_pileup1_t **__pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  bam1_t *__pyx_t_16;
  uint16_t __pyx_t_17;
  uint8_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  long double __pyx_t_28;
  long double __pyx_t_29;
  int __pyx_t_30;
  PyObject *(*__pyx_t_31)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dist", 0);

  /* "SomVarIUS_calling.pyx":176
 * 	cdef bam1_t * aln
 * 	cdef tuple alleles
 * 	cdef bint is_reverse = False             # <<<<<<<<<<<<<<
 * 	cdef bint is_proper_pair
 * 	cdef int mapq
 */
  __pyx_v_is_reverse = 0;

  /* "SomVarIUS_calling.pyx":179
 * 	cdef bint is_proper_pair
 * 	cdef int mapq
 * 	cdef double baseq = 0             # <<<<<<<<<<<<<<
 * 	cdef tuple counts, labels, copy_region
 * 	cdef list copy_list = []
 */
  __pyx_v_baseq = 0.0;

  /* "SomVarIUS_calling.pyx":181
 * 	cdef double baseq = 0
 * 	cdef tuple counts, labels, copy_region
 * 	cdef list copy_list = []             # <<<<<<<<<<<<<<
 * 	cdef list binned_data
 * 	cdef int n
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_copy_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":187
 * 	cdef str dbsnp_maj_allele
 * 	cdef frozenset dbsnp_alt_alleles
 * 	cdef tuple previous_copy_region = tuple(['None', 'None', 'None'])             # <<<<<<<<<<<<<<
 * 
 * 	#record = defaultdict(lambda : defaultdict(double))
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_None);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_None);
  __Pyx_GIVEREF(__pyx_n_s_None);
  __Pyx_INCREF(__pyx_n_s_None);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_None);
  __Pyx_GIVEREF(__pyx_n_s_None);
  __Pyx_INCREF(__pyx_n_s_None);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_None);
  __Pyx_GIVEREF(__pyx_n_s_None);
  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_previous_copy_region = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":190
 * 
 * 	#record = defaultdict(lambda : defaultdict(double))
 * 	record = OrderedDict()             # <<<<<<<<<<<<<<
 * 	it = samfile.pileup(reference=None, start=None, end=None,
 * 	truncate=False, max_depth=8000)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_record = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":191
 * 	#record = defaultdict(lambda : defaultdict(double))
 * 	record = OrderedDict()
 * 	it = samfile.pileup(reference=None, start=None, end=None,             # <<<<<<<<<<<<<<
 * 	truncate=False, max_depth=8000)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_samfile), __pyx_n_s_pileup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reference, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_start, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_end, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":192
 * 	record = OrderedDict()
 * 	it = samfile.pileup(reference=None, start=None, end=None,
 * 	truncate=False, max_depth=8000)             # <<<<<<<<<<<<<<
 * 
 * 	for col in it:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_truncate, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_max_depth, __pyx_int_8000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":191
 * 	#record = defaultdict(lambda : defaultdict(double))
 * 	record = OrderedDict()
 * 	it = samfile.pileup(reference=None, start=None, end=None,             # <<<<<<<<<<<<<<
 * 	truncate=False, max_depth=8000)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_it = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "SomVarIUS_calling.pyx":194
 * 	truncate=False, max_depth=8000)
 * 
 * 	for col in it:             # <<<<<<<<<<<<<<
 * 		chrom = samfile.getrname(col.tid)
 * 		pos = col.pos + 1
 */
  if (likely(PyList_CheckExact(__pyx_v_it)) || PyTuple_CheckExact(__pyx_v_it)) {
    __pyx_t_3 = __pyx_v_it; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5pysam_14calignmentfile_PileupColumn))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_col, ((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":195
 * 
 * 	for col in it:
 * 		chrom = samfile.getrname(col.tid)             # <<<<<<<<<<<<<<
 * 		pos = col.pos + 1
 * 		_init_count(&A)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_samfile), __pyx_n_s_getrname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_col->tid); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __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 = NULL;
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":196
 * 	for col in it:
 * 		chrom = samfile.getrname(col.tid)
 * 		pos = col.pos + 1             # <<<<<<<<<<<<<<
 * 		_init_count(&A)
 * 		_init_count(&T)
 */
    __pyx_v_pos = (__pyx_v_col->pos + 1);

    /* "SomVarIUS_calling.pyx":197
 * 		chrom = samfile.getrname(col.tid)
 * 		pos = col.pos + 1
 * 		_init_count(&A)             # <<<<<<<<<<<<<<
 * 		_init_count(&T)
 * 		_init_count(&G)
 */
    __pyx_t_1 = __pyx_f_17SomVarIUS_calling__init_count((&__pyx_v_A)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":198
 * 		pos = col.pos + 1
 * 		_init_count(&A)
 * 		_init_count(&T)             # <<<<<<<<<<<<<<
 * 		_init_count(&G)
 * 		_init_count(&C)
 */
    __pyx_t_1 = __pyx_f_17SomVarIUS_calling__init_count((&__pyx_v_T)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":199
 * 		_init_count(&A)
 * 		_init_count(&T)
 * 		_init_count(&G)             # <<<<<<<<<<<<<<
 * 		_init_count(&C)
 * 
 */
    __pyx_t_1 = __pyx_f_17SomVarIUS_calling__init_count((&__pyx_v_G)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":200
 * 		_init_count(&T)
 * 		_init_count(&G)
 * 		_init_count(&C)             # <<<<<<<<<<<<<<
 * 
 * 		try:
 */
    __pyx_t_1 = __pyx_f_17SomVarIUS_calling__init_count((&__pyx_v_C)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":202
 * 		_init_count(&C)
 * 
 * 		try:             # <<<<<<<<<<<<<<
 * 			alleles = copy_record[(ba_to_bed[chrom],pos)][3]
 * 			dbsnp_maj_allele = alleles[0]
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "SomVarIUS_calling.pyx":203
 * 
 * 		try:
 * 			alleles = copy_record[(ba_to_bed[chrom],pos)][3]             # <<<<<<<<<<<<<<
 * 			dbsnp_maj_allele = alleles[0]
 * 			dbsnp_alt_alleles = alleles[1]
 */
        if (unlikely(__pyx_v_ba_to_bed == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_ba_to_bed, __pyx_v_chrom); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_1 = 0;
        __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_GetItem(__pyx_v_copy_record, __pyx_t_8); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!(likely(PyTuple_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_XDECREF_SET(__pyx_v_alleles, ((PyObject*)__pyx_t_8));
        __pyx_t_8 = 0;

        /* "SomVarIUS_calling.pyx":204
 * 		try:
 * 			alleles = copy_record[(ba_to_bed[chrom],pos)][3]
 * 			dbsnp_maj_allele = alleles[0]             # <<<<<<<<<<<<<<
 * 			dbsnp_alt_alleles = alleles[1]
 * 			n = col.n
 */
        if (unlikely(__pyx_v_alleles == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        }
        __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v_alleles, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
        __Pyx_GOTREF(__pyx_t_8);
        if (!(likely(PyString_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_XDECREF_SET(__pyx_v_dbsnp_maj_allele, ((PyObject*)__pyx_t_8));
        __pyx_t_8 = 0;

        /* "SomVarIUS_calling.pyx":205
 * 			alleles = copy_record[(ba_to_bed[chrom],pos)][3]
 * 			dbsnp_maj_allele = alleles[0]
 * 			dbsnp_alt_alleles = alleles[1]             # <<<<<<<<<<<<<<
 * 			n = col.n
 * 			plp = col.plp
 */
        if (unlikely(__pyx_v_alleles == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        }
        __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v_alleles, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
        __Pyx_GOTREF(__pyx_t_8);
        if (!(likely(PyFrozenSet_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "frozenset", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_XDECREF_SET(__pyx_v_dbsnp_alt_alleles, ((PyObject*)__pyx_t_8));
        __pyx_t_8 = 0;

        /* "SomVarIUS_calling.pyx":206
 * 			dbsnp_maj_allele = alleles[0]
 * 			dbsnp_alt_alleles = alleles[1]
 * 			n = col.n             # <<<<<<<<<<<<<<
 * 			plp = col.plp
 * 			for i from 0<=i < n:
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_col), __pyx_n_s_n); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_n = __pyx_t_12;

        /* "SomVarIUS_calling.pyx":207
 * 			dbsnp_alt_alleles = alleles[1]
 * 			n = col.n
 * 			plp = col.plp             # <<<<<<<<<<<<<<
 * 			for i from 0<=i < n:
 * 				read = &(plp[0][i])
 */
        __pyx_t_13 = __pyx_v_col->plp;
        __pyx_v_plp = __pyx_t_13;

        /* "SomVarIUS_calling.pyx":208
 * 			n = col.n
 * 			plp = col.plp
 * 			for i from 0<=i < n:             # <<<<<<<<<<<<<<
 * 				read = &(plp[0][i])
 * 				if read.indel == 0 and read.is_del == False:
 */
        __pyx_t_12 = __pyx_v_n;
        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) {

          /* "SomVarIUS_calling.pyx":209
 * 			plp = col.plp
 * 			for i from 0<=i < n:
 * 				read = &(plp[0][i])             # <<<<<<<<<<<<<<
 * 				if read.indel == 0 and read.is_del == False:
 * 					aln = read.b
 */
          __pyx_v_read = (&((__pyx_v_plp[0])[__pyx_v_i]));

          /* "SomVarIUS_calling.pyx":210
 * 			for i from 0<=i < n:
 * 				read = &(plp[0][i])
 * 				if read.indel == 0 and read.is_del == False:             # <<<<<<<<<<<<<<
 * 					aln = read.b
 * 					alnbase = _get_seq_base(aln, read.qpos)
 */
          __pyx_t_15 = ((__pyx_v_read->indel == 0) != 0);
          if (__pyx_t_15) {
          } else {
            __pyx_t_14 = __pyx_t_15;
            goto __pyx_L16_bool_binop_done;
          }
          __pyx_t_15 = ((__pyx_v_read->is_del == 0) != 0);
          __pyx_t_14 = __pyx_t_15;
          __pyx_L16_bool_binop_done:;
          if (__pyx_t_14) {

            /* "SomVarIUS_calling.pyx":211
 * 				read = &(plp[0][i])
 * 				if read.indel == 0 and read.is_del == False:
 * 					aln = read.b             # <<<<<<<<<<<<<<
 * 					alnbase = _get_seq_base(aln, read.qpos)
 * 					flag = aln.core.flag
 */
            __pyx_t_16 = __pyx_v_read->b;
            __pyx_v_aln = __pyx_t_16;

            /* "SomVarIUS_calling.pyx":212
 * 				if read.indel == 0 and read.is_del == False:
 * 					aln = read.b
 * 					alnbase = _get_seq_base(aln, read.qpos)             # <<<<<<<<<<<<<<
 * 					flag = aln.core.flag
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)
 */
            __pyx_t_8 = __pyx_f_17SomVarIUS_calling__get_seq_base(__pyx_v_aln, __pyx_v_read->qpos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_GOTREF(__pyx_t_8);
            if (!(likely(PyString_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_XDECREF_SET(__pyx_v_alnbase, ((PyObject*)__pyx_t_8));
            __pyx_t_8 = 0;

            /* "SomVarIUS_calling.pyx":213
 * 					aln = read.b
 * 					alnbase = _get_seq_base(aln, read.qpos)
 * 					flag = aln.core.flag             # <<<<<<<<<<<<<<
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)
 * 					mapq = aln.core.qual
 */
            __pyx_t_17 = __pyx_v_aln->core.flag;
            __pyx_v_flag = __pyx_t_17;

            /* "SomVarIUS_calling.pyx":214
 * 					alnbase = _get_seq_base(aln, read.qpos)
 * 					flag = aln.core.flag
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)             # <<<<<<<<<<<<<<
 * 					mapq = aln.core.qual
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]
 */
            __pyx_v_is_proper_pair = ((__pyx_v_flag & 2) != 0);

            /* "SomVarIUS_calling.pyx":215
 * 					flag = aln.core.flag
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)
 * 					mapq = aln.core.qual             # <<<<<<<<<<<<<<
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:
 */
            __pyx_t_18 = __pyx_v_aln->core.qual;
            __pyx_v_mapq = __pyx_t_18;

            /* "SomVarIUS_calling.pyx":216
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)
 * 					mapq = aln.core.qual
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]             # <<<<<<<<<<<<<<
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:
 * 						if alnbase == b'A':
 */
            __pyx_v_baseq = (pysam_bam_get_qual(__pyx_v_aln)[__pyx_v_read->qpos]);

            /* "SomVarIUS_calling.pyx":217
 * 					mapq = aln.core.qual
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:             # <<<<<<<<<<<<<<
 * 						if alnbase == b'A':
 * 							_incr_count(&A, is_reverse, baseq, mapq)
 */
            __pyx_t_15 = ((__pyx_v_mapq >= __pyx_v_min_mapq) != 0);
            if (__pyx_t_15) {
            } else {
              __pyx_t_14 = __pyx_t_15;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_15 = ((__pyx_v_baseq >= __pyx_v_min_baseq) != 0);
            if (__pyx_t_15) {
            } else {
              __pyx_t_14 = __pyx_t_15;
              goto __pyx_L19_bool_binop_done;
            }
            __pyx_t_15 = (__pyx_v_is_proper_pair != 0);
            __pyx_t_14 = __pyx_t_15;
            __pyx_L19_bool_binop_done:;
            if (__pyx_t_14) {

              /* "SomVarIUS_calling.pyx":218
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:
 * 						if alnbase == b'A':             # <<<<<<<<<<<<<<
 * 							_incr_count(&A, is_reverse, baseq, mapq)
 * 						elif alnbase == b'T':
 */
              __pyx_t_14 = (__Pyx_PyBytes_Equals(__pyx_v_alnbase, __pyx_n_b_A, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
              __pyx_t_15 = (__pyx_t_14 != 0);
              if (__pyx_t_15) {

                /* "SomVarIUS_calling.pyx":219
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:
 * 						if alnbase == b'A':
 * 							_incr_count(&A, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 						elif alnbase == b'T':
 * 							_incr_count(&T, is_reverse, baseq, mapq)
 */
                __pyx_t_8 = __pyx_f_17SomVarIUS_calling__incr_count((&__pyx_v_A), __pyx_v_is_reverse, __pyx_v_baseq, __pyx_v_mapq); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                goto __pyx_L22;
              }

              /* "SomVarIUS_calling.pyx":220
 * 						if alnbase == b'A':
 * 							_incr_count(&A, is_reverse, baseq, mapq)
 * 						elif alnbase == b'T':             # <<<<<<<<<<<<<<
 * 							_incr_count(&T, is_reverse, baseq, mapq)
 * 						elif alnbase == b'G':
 */
              __pyx_t_15 = (__Pyx_PyBytes_Equals(__pyx_v_alnbase, __pyx_n_b_T, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
              __pyx_t_14 = (__pyx_t_15 != 0);
              if (__pyx_t_14) {

                /* "SomVarIUS_calling.pyx":221
 * 							_incr_count(&A, is_reverse, baseq, mapq)
 * 						elif alnbase == b'T':
 * 							_incr_count(&T, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 						elif alnbase == b'G':
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 */
                __pyx_t_8 = __pyx_f_17SomVarIUS_calling__incr_count((&__pyx_v_T), __pyx_v_is_reverse, __pyx_v_baseq, __pyx_v_mapq); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                goto __pyx_L22;
              }

              /* "SomVarIUS_calling.pyx":222
 * 						elif alnbase == b'T':
 * 							_incr_count(&T, is_reverse, baseq, mapq)
 * 						elif alnbase == b'G':             # <<<<<<<<<<<<<<
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 * 						elif alnbase == b'C':
 */
              __pyx_t_14 = (__Pyx_PyBytes_Equals(__pyx_v_alnbase, __pyx_n_b_G, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
              __pyx_t_15 = (__pyx_t_14 != 0);
              if (__pyx_t_15) {

                /* "SomVarIUS_calling.pyx":223
 * 							_incr_count(&T, is_reverse, baseq, mapq)
 * 						elif alnbase == b'G':
 * 							_incr_count(&G, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 						elif alnbase == b'C':
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 */
                __pyx_t_8 = __pyx_f_17SomVarIUS_calling__incr_count((&__pyx_v_G), __pyx_v_is_reverse, __pyx_v_baseq, __pyx_v_mapq); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                goto __pyx_L22;
              }

              /* "SomVarIUS_calling.pyx":224
 * 						elif alnbase == b'G':
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 * 						elif alnbase == b'C':             # <<<<<<<<<<<<<<
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 * 			if A.pres+T.pres+G.pres+C.pres > 1:
 */
              __pyx_t_15 = (__Pyx_PyBytes_Equals(__pyx_v_alnbase, __pyx_n_b_C, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
              __pyx_t_14 = (__pyx_t_15 != 0);
              if (__pyx_t_14) {

                /* "SomVarIUS_calling.pyx":225
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 * 						elif alnbase == b'C':
 * 							_incr_count(&C, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 			if A.pres+T.pres+G.pres+C.pres > 1:
 * 				counts, labels = get_highest(A.count,T.count,G.count,C.count)
 */
                __pyx_t_8 = __pyx_f_17SomVarIUS_calling__incr_count((&__pyx_v_C), __pyx_v_is_reverse, __pyx_v_baseq, __pyx_v_mapq); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                goto __pyx_L22;
              }
              __pyx_L22:;
              goto __pyx_L18;
            }
            __pyx_L18:;
            goto __pyx_L15;
          }
          __pyx_L15:;
        }

        /* "SomVarIUS_calling.pyx":226
 * 						elif alnbase == b'C':
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 * 			if A.pres+T.pres+G.pres+C.pres > 1:             # <<<<<<<<<<<<<<
 * 				counts, labels = get_highest(A.count,T.count,G.count,C.count)
 * 				obs_alleles = set([labels[i] for i in xrange(len(labels)) if counts[i]>0])
 */
        __pyx_t_14 = (((((__pyx_v_A.pres + __pyx_v_T.pres) + __pyx_v_G.pres) + __pyx_v_C.pres) > 1) != 0);
        if (__pyx_t_14) {

          /* "SomVarIUS_calling.pyx":227
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 * 			if A.pres+T.pres+G.pres+C.pres > 1:
 * 				counts, labels = get_highest(A.count,T.count,G.count,C.count)             # <<<<<<<<<<<<<<
 * 				obs_alleles = set([labels[i] for i in xrange(len(labels)) if counts[i]>0])
 * 				#print
 */
          __pyx_t_8 = __pyx_f_17SomVarIUS_calling_get_highest(__pyx_v_A.count, __pyx_v_T.count, __pyx_v_G.count, __pyx_v_C.count); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_8);
          if (likely(__pyx_t_8 != Py_None)) {
            PyObject* sequence = __pyx_t_8;
            #if CYTHON_COMPILING_IN_CPYTHON
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            }
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_1);
            #else
            __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_GOTREF(__pyx_t_1);
            #endif
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          } else {
            __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          }
          if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_XDECREF_SET(__pyx_v_counts, ((PyObject*)__pyx_t_2));
          __pyx_t_2 = 0;
          __Pyx_XDECREF_SET(__pyx_v_labels, ((PyObject*)__pyx_t_1));
          __pyx_t_1 = 0;

          /* "SomVarIUS_calling.pyx":228
 * 			if A.pres+T.pres+G.pres+C.pres > 1:
 * 				counts, labels = get_highest(A.count,T.count,G.count,C.count)
 * 				obs_alleles = set([labels[i] for i in xrange(len(labels)) if counts[i]>0])             # <<<<<<<<<<<<<<
 * 				#print
 * 				#print "obs", obs_alleles
 */
          __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_8);
          if (unlikely(__pyx_v_labels == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          }
          __pyx_t_19 = PyTuple_GET_SIZE(__pyx_v_labels); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_19; __pyx_t_12+=1) {
            __pyx_v_i = __pyx_t_12;
            if (unlikely(__pyx_v_counts == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            }
            __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_counts, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (__pyx_t_14) {
              if (unlikely(__pyx_v_labels == Py_None)) {
                PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
              }
              __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_labels, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
              __Pyx_GOTREF(__pyx_t_2);
              if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L26;
            }
            __pyx_L26:;
          }
          __pyx_t_2 = PySet_New(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF_SET(__pyx_v_obs_alleles, ((PyObject*)__pyx_t_2));
          __pyx_t_2 = 0;

          /* "SomVarIUS_calling.pyx":231
 * 				#print
 * 				#print "obs", obs_alleles
 * 				dbsnp_obs_overlap = obs_alleles & dbsnp_alt_alleles             # <<<<<<<<<<<<<<
 * 				#print "dbsnp", dbsnp_obs_overlap
 * 				#print "dbsnp", dbsnp_maj_allele
 */
          __pyx_t_2 = PyNumber_And(__pyx_v_obs_alleles, __pyx_v_dbsnp_alt_alleles); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_v_dbsnp_obs_overlap, __pyx_t_2);
          __pyx_t_2 = 0;

          /* "SomVarIUS_calling.pyx":234
 * 				#print "dbsnp", dbsnp_obs_overlap
 * 				#print "dbsnp", dbsnp_maj_allele
 * 				if len(dbsnp_obs_overlap) > 0 and dbsnp_maj_allele in obs_alleles:             # <<<<<<<<<<<<<<
 * 					copy_region = copy_record[(ba_to_bed[chrom],pos)][0:3]
 * 					try:
 */
          __pyx_t_19 = PyObject_Length(__pyx_v_dbsnp_obs_overlap); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __pyx_t_15 = ((__pyx_t_19 > 0) != 0);
          if (__pyx_t_15) {
          } else {
            __pyx_t_14 = __pyx_t_15;
            goto __pyx_L28_bool_binop_done;
          }
          __pyx_t_15 = (__Pyx_PySequence_Contains(__pyx_v_dbsnp_maj_allele, __pyx_v_obs_alleles, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __pyx_t_20 = (__pyx_t_15 != 0);
          __pyx_t_14 = __pyx_t_20;
          __pyx_L28_bool_binop_done:;
          if (__pyx_t_14) {

            /* "SomVarIUS_calling.pyx":235
 * 				#print "dbsnp", dbsnp_maj_allele
 * 				if len(dbsnp_obs_overlap) > 0 and dbsnp_maj_allele in obs_alleles:
 * 					copy_region = copy_record[(ba_to_bed[chrom],pos)][0:3]             # <<<<<<<<<<<<<<
 * 					try:
 * 						record[copy_region]
 */
            if (unlikely(__pyx_v_ba_to_bed == Py_None)) {
              PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            }
            __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_ba_to_bed, __pyx_v_chrom); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_2);
            PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8);
            __Pyx_GIVEREF(__pyx_t_8);
            __pyx_t_2 = 0;
            __pyx_t_8 = 0;
            __pyx_t_8 = PyObject_GetItem(__pyx_v_copy_record, __pyx_t_1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 3, NULL, NULL, &__pyx_slice_, 1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_XDECREF_SET(__pyx_v_copy_region, ((PyObject*)__pyx_t_1));
            __pyx_t_1 = 0;

            /* "SomVarIUS_calling.pyx":236
 * 				if len(dbsnp_obs_overlap) > 0 and dbsnp_maj_allele in obs_alleles:
 * 					copy_region = copy_record[(ba_to_bed[chrom],pos)][0:3]
 * 					try:             # <<<<<<<<<<<<<<
 * 						record[copy_region]
 * 					except KeyError:
 */
            {
              __Pyx_ExceptionSave(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              /*try:*/ {

                /* "SomVarIUS_calling.pyx":237
 * 					copy_region = copy_record[(ba_to_bed[chrom],pos)][0:3]
 * 					try:
 * 						record[copy_region]             # <<<<<<<<<<<<<<
 * 					except KeyError:
 * 						record[copy_region]={'total_alleles':[], 'alt_alleles':[], 'pos':[]}
 */
                __pyx_t_1 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L30_error;};
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
              __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
              __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
              goto __pyx_L37_try_end;
              __pyx_L30_error:;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

              /* "SomVarIUS_calling.pyx":238
 * 					try:
 * 						record[copy_region]
 * 					except KeyError:             # <<<<<<<<<<<<<<
 * 						record[copy_region]={'total_alleles':[], 'alt_alleles':[], 'pos':[]}
 * 						if previous_copy_region[1] != 'None':
 */
              __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
              if (__pyx_t_12) {
                __Pyx_AddTraceback("SomVarIUS_calling.get_dist", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_GOTREF(__pyx_t_2);

                /* "SomVarIUS_calling.pyx":239
 * 						record[copy_region]
 * 					except KeyError:
 * 						record[copy_region]={'total_alleles':[], 'alt_alleles':[], 'pos':[]}             # <<<<<<<<<<<<<<
 * 						if previous_copy_region[1] != 'None':
 * 							if len(record[previous_copy_region]['alt_alleles']) >= 4:
 */
                __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_GOTREF(__pyx_t_7);
                if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_total_alleles, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_GOTREF(__pyx_t_7);
                if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_alt_alleles, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_GOTREF(__pyx_t_7);
                if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pos, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                if (unlikely(PyObject_SetItem(__pyx_v_record, __pyx_v_copy_region, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

                /* "SomVarIUS_calling.pyx":240
 * 					except KeyError:
 * 						record[copy_region]={'total_alleles':[], 'alt_alleles':[], 'pos':[]}
 * 						if previous_copy_region[1] != 'None':             # <<<<<<<<<<<<<<
 * 							if len(record[previous_copy_region]['alt_alleles']) >= 4:
 * 								chrom, start, end = previous_copy_region
 */
                if (unlikely(__pyx_v_previous_copy_region == Py_None)) {
                  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                }
                __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_previous_copy_region, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;};
                __Pyx_GOTREF(__pyx_t_6);
                __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_None, Py_NE)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (__pyx_t_14) {

                  /* "SomVarIUS_calling.pyx":241
 * 						record[copy_region]={'total_alleles':[], 'alt_alleles':[], 'pos':[]}
 * 						if previous_copy_region[1] != 'None':
 * 							if len(record[previous_copy_region]['alt_alleles']) >= 4:             # <<<<<<<<<<<<<<
 * 								chrom, start, end = previous_copy_region
 * 								alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),
 */
                  __pyx_t_6 = PyObject_GetItem(__pyx_v_record, __pyx_v_previous_copy_region); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;};
                  __Pyx_GOTREF(__pyx_t_6);
                  __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_n_s_alt_alleles); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;};
                  __Pyx_GOTREF(__pyx_t_7);
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                  __pyx_t_19 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                  __pyx_t_14 = ((__pyx_t_19 >= 4) != 0);
                  if (__pyx_t_14) {

                    /* "SomVarIUS_calling.pyx":242
 * 						if previous_copy_region[1] != 'None':
 * 							if len(record[previous_copy_region]['alt_alleles']) >= 4:
 * 								chrom, start, end = previous_copy_region             # <<<<<<<<<<<<<<
 * 								alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),
 * 																								np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 */
                    if (likely(__pyx_v_previous_copy_region != Py_None)) {
                      PyObject* sequence = __pyx_v_previous_copy_region;
                      #if CYTHON_COMPILING_IN_CPYTHON
                      Py_ssize_t size = Py_SIZE(sequence);
                      #else
                      Py_ssize_t size = PySequence_Size(sequence);
                      #endif
                      if (unlikely(size != 3)) {
                        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
                        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                      }
                      #if CYTHON_COMPILING_IN_CPYTHON
                      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
                      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
                      __pyx_t_24 = PyTuple_GET_ITEM(sequence, 2); 
                      __Pyx_INCREF(__pyx_t_7);
                      __Pyx_INCREF(__pyx_t_6);
                      __Pyx_INCREF(__pyx_t_24);
                      #else
                      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                      __Pyx_GOTREF(__pyx_t_7);
                      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                      __Pyx_GOTREF(__pyx_t_6);
                      __pyx_t_24 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                      __Pyx_GOTREF(__pyx_t_24);
                      #endif
                    } else {
                      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    }
                    if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_DECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_7));
                    __pyx_t_7 = 0;
                    __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_6);
                    __pyx_t_6 = 0;
                    __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_24);
                    __pyx_t_24 = 0;

                    /* "SomVarIUS_calling.pyx":243
 * 							if len(record[previous_copy_region]['alt_alleles']) >= 4:
 * 								chrom, start, end = previous_copy_region
 * 								alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),             # <<<<<<<<<<<<<<
 * 																								np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 * 								mean = alpha / (alpha+beta)
 */
                    __pyx_t_24 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_24);
                    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_6);
                    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                    __pyx_t_24 = PyObject_GetItem(__pyx_v_record, __pyx_v_previous_copy_region); if (unlikely(__pyx_t_24 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;};
                    __Pyx_GOTREF(__pyx_t_24);
                    __pyx_t_7 = PyObject_GetItem(__pyx_t_24, __pyx_n_s_alt_alleles); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;};
                    __Pyx_GOTREF(__pyx_t_7);
                    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                    __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_24);
                    PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_7);
                    __Pyx_GIVEREF(__pyx_t_7);
                    __pyx_t_7 = 0;
                    __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_7);
                    __pyx_t_25 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_25);
                    __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_25, __pyx_n_s_float64); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_26);
                    __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                    if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_26) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
                    __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_24, __pyx_t_7); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_26);
                    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                    if (!(likely(((__pyx_t_26) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_26, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}

                    /* "SomVarIUS_calling.pyx":244
 * 								chrom, start, end = previous_copy_region
 * 								alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),
 * 																								np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))             # <<<<<<<<<<<<<<
 * 								mean = alpha / (alpha+beta)
 * 								copy_list.append((chrom, start, end, alpha, beta, mean))
 */
                    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_7);
                    __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_24);
                    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                    __pyx_t_7 = PyObject_GetItem(__pyx_v_record, __pyx_v_previous_copy_region); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;};
                    __Pyx_GOTREF(__pyx_t_7);
                    __pyx_t_6 = PyObject_GetItem(__pyx_t_7, __pyx_n_s_total_alleles); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;};
                    __Pyx_GOTREF(__pyx_t_6);
                    __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 = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_7);
                    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
                    __Pyx_GIVEREF(__pyx_t_6);
                    __pyx_t_6 = 0;
                    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_6);
                    __pyx_t_25 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_25);
                    __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_t_25, __pyx_n_s_float64); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_27);
                    __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_27) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
                    __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_27);
                    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                    if (!(likely(((__pyx_t_27) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_27, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}

                    /* "SomVarIUS_calling.pyx":243
 * 							if len(record[previous_copy_region]['alt_alleles']) >= 4:
 * 								chrom, start, end = previous_copy_region
 * 								alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),             # <<<<<<<<<<<<<<
 * 																								np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 * 								mean = alpha / (alpha+beta)
 */
                    __pyx_t_6 = __pyx_f_17SomVarIUS_calling_fit_beta_binomial(((PyArrayObject *)__pyx_t_26), ((PyArrayObject *)__pyx_t_27)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_6);
                    __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
                    __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
                    if (likely(__pyx_t_6 != Py_None)) {
                      PyObject* sequence = __pyx_t_6;
                      #if CYTHON_COMPILING_IN_CPYTHON
                      Py_ssize_t size = Py_SIZE(sequence);
                      #else
                      Py_ssize_t size = PySequence_Size(sequence);
                      #endif
                      if (unlikely(size != 2)) {
                        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                      }
                      #if CYTHON_COMPILING_IN_CPYTHON
                      __pyx_t_27 = PyTuple_GET_ITEM(sequence, 0); 
                      __pyx_t_26 = PyTuple_GET_ITEM(sequence, 1); 
                      __Pyx_INCREF(__pyx_t_27);
                      __Pyx_INCREF(__pyx_t_26);
                      #else
                      __pyx_t_27 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                      __Pyx_GOTREF(__pyx_t_27);
                      __pyx_t_26 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                      __Pyx_GOTREF(__pyx_t_26);
                      #endif
                      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                    } else {
                      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    }
                    __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_27); if (unlikely((__pyx_t_28 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
                    __pyx_t_29 = __pyx_PyFloat_AsDouble(__pyx_t_26); if (unlikely((__pyx_t_29 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
                    __pyx_v_alpha = __pyx_t_28;
                    __pyx_v_beta = __pyx_t_29;

                    /* "SomVarIUS_calling.pyx":245
 * 								alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),
 * 																								np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 * 								mean = alpha / (alpha+beta)             # <<<<<<<<<<<<<<
 * 								copy_list.append((chrom, start, end, alpha, beta, mean))
 * 
 */
                    __pyx_t_29 = (__pyx_v_alpha + __pyx_v_beta);
                    if (unlikely(__pyx_t_29 == 0)) {
                      #ifdef WITH_THREAD
                      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                      #endif
                      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                      #ifdef WITH_THREAD
                      PyGILState_Release(__pyx_gilstate_save);
                      #endif
                      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    }
                    __pyx_v_mean = (__pyx_v_alpha / __pyx_t_29);

                    /* "SomVarIUS_calling.pyx":246
 * 																								np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 * 								mean = alpha / (alpha+beta)
 * 								copy_list.append((chrom, start, end, alpha, beta, mean))             # <<<<<<<<<<<<<<
 * 
 * 							del record[previous_copy_region]
 */
                    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_6);
                    __pyx_t_26 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_26);
                    __pyx_t_27 = PyFloat_FromDouble(__pyx_v_mean); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_27);
                    __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_GOTREF(__pyx_t_7);
                    __Pyx_INCREF(__pyx_v_chrom);
                    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_chrom);
                    __Pyx_GIVEREF(__pyx_v_chrom);
                    __Pyx_INCREF(__pyx_v_start);
                    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_start);
                    __Pyx_GIVEREF(__pyx_v_start);
                    __Pyx_INCREF(__pyx_v_end);
                    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_end);
                    __Pyx_GIVEREF(__pyx_v_end);
                    PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6);
                    __Pyx_GIVEREF(__pyx_t_6);
                    PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_26);
                    __Pyx_GIVEREF(__pyx_t_26);
                    PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_27);
                    __Pyx_GIVEREF(__pyx_t_27);
                    __pyx_t_6 = 0;
                    __pyx_t_26 = 0;
                    __pyx_t_27 = 0;
                    __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_copy_list, __pyx_t_7); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
                    goto __pyx_L41;
                  }
                  __pyx_L41:;

                  /* "SomVarIUS_calling.pyx":248
 * 								copy_list.append((chrom, start, end, alpha, beta, mean))
 * 
 * 							del record[previous_copy_region]             # <<<<<<<<<<<<<<
 * 						previous_copy_region = copy_region
 * 					#print chrom, pos
 */
                  if (PyObject_DelItem(__pyx_v_record, __pyx_v_previous_copy_region) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L32_except_error;}
                  goto __pyx_L40;
                }
                __pyx_L40:;

                /* "SomVarIUS_calling.pyx":249
 * 
 * 							del record[previous_copy_region]
 * 						previous_copy_region = copy_region             # <<<<<<<<<<<<<<
 * 					#print chrom, pos
 * 					#print copy_region
 */
                __Pyx_INCREF(__pyx_v_copy_region);
                __Pyx_DECREF_SET(__pyx_v_previous_copy_region, __pyx_v_copy_region);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                goto __pyx_L31_exception_handled;
              }
              goto __pyx_L32_except_error;
              __pyx_L32_except_error:;
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
              goto __pyx_L5_error;
              __pyx_L31_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
              __pyx_L37_try_end:;
            }

            /* "SomVarIUS_calling.pyx":252
 * 					#print chrom, pos
 * 					#print copy_region
 * 					total_counts = float(A.count+T.count+C.count+G.count)             # <<<<<<<<<<<<<<
 * 					if total_counts >= min_reads:
 * 						for base in dbsnp_obs_overlap:
 */
            __pyx_v_total_counts = ((double)(((__pyx_v_A.count + __pyx_v_T.count) + __pyx_v_C.count) + __pyx_v_G.count));

            /* "SomVarIUS_calling.pyx":253
 * 					#print copy_region
 * 					total_counts = float(A.count+T.count+C.count+G.count)
 * 					if total_counts >= min_reads:             # <<<<<<<<<<<<<<
 * 						for base in dbsnp_obs_overlap:
 * 							if base == 'A' and A.count >= min_support and total_counts-A.count >= min_support:
 */
            __pyx_t_14 = ((__pyx_v_total_counts >= __pyx_v_min_reads) != 0);
            if (__pyx_t_14) {

              /* "SomVarIUS_calling.pyx":254
 * 					total_counts = float(A.count+T.count+C.count+G.count)
 * 					if total_counts >= min_reads:
 * 						for base in dbsnp_obs_overlap:             # <<<<<<<<<<<<<<
 * 							if base == 'A' and A.count >= min_support and total_counts-A.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(A.count)
 */
              if (likely(PyList_CheckExact(__pyx_v_dbsnp_obs_overlap)) || PyTuple_CheckExact(__pyx_v_dbsnp_obs_overlap)) {
                __pyx_t_2 = __pyx_v_dbsnp_obs_overlap; __Pyx_INCREF(__pyx_t_2); __pyx_t_19 = 0;
                __pyx_t_31 = NULL;
              } else {
                __pyx_t_19 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_dbsnp_obs_overlap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_31 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
              }
              for (;;) {
                if (likely(!__pyx_t_31)) {
                  if (likely(PyList_CheckExact(__pyx_t_2))) {
                    if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_2)) break;
                    #if CYTHON_COMPILING_IN_CPYTHON
                    __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_19); __Pyx_INCREF(__pyx_t_8); __pyx_t_19++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                    #else
                    __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                    #endif
                  } else {
                    if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
                    #if CYTHON_COMPILING_IN_CPYTHON
                    __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_19); __Pyx_INCREF(__pyx_t_8); __pyx_t_19++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                    #else
                    __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                    #endif
                  }
                } else {
                  __pyx_t_8 = __pyx_t_31(__pyx_t_2);
                  if (unlikely(!__pyx_t_8)) {
                    PyObject* exc_type = PyErr_Occurred();
                    if (exc_type) {
                      if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
                      else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                    }
                    break;
                  }
                  __Pyx_GOTREF(__pyx_t_8);
                }
                if (!(likely(PyString_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __Pyx_XDECREF_SET(__pyx_v_base, ((PyObject*)__pyx_t_8));
                __pyx_t_8 = 0;

                /* "SomVarIUS_calling.pyx":255
 * 					if total_counts >= min_reads:
 * 						for base in dbsnp_obs_overlap:
 * 							if base == 'A' and A.count >= min_support and total_counts-A.count >= min_support:             # <<<<<<<<<<<<<<
 * 								record[copy_region]['alt_alleles'].append(A.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)
 */
                __pyx_t_20 = (__Pyx_PyString_Equals(__pyx_v_base, __pyx_n_s_A, Py_EQ)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __pyx_t_15 = (__pyx_t_20 != 0);
                if (__pyx_t_15) {
                } else {
                  __pyx_t_14 = __pyx_t_15;
                  goto __pyx_L46_bool_binop_done;
                }
                __pyx_t_15 = ((__pyx_v_A.count >= __pyx_v_min_support) != 0);
                if (__pyx_t_15) {
                } else {
                  __pyx_t_14 = __pyx_t_15;
                  goto __pyx_L46_bool_binop_done;
                }
                __pyx_t_15 = (((__pyx_v_total_counts - __pyx_v_A.count) >= __pyx_v_min_support) != 0);
                __pyx_t_14 = __pyx_t_15;
                __pyx_L46_bool_binop_done:;
                if (__pyx_t_14) {

                  /* "SomVarIUS_calling.pyx":256
 * 						for base in dbsnp_obs_overlap:
 * 							if base == 'A' and A.count >= min_support and total_counts-A.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(A.count)             # <<<<<<<<<<<<<<
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_alt_alleles); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_A.count); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":257
 * 							if base == 'A' and A.count >= min_support and total_counts-A.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(A.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)             # <<<<<<<<<<<<<<
 * 								record[copy_region]['pos'].append(pos)
 * 								break
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_total_alleles); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_total_counts); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":258
 * 								record[copy_region]['alt_alleles'].append(A.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)             # <<<<<<<<<<<<<<
 * 								break
 * 							elif base == 'T' and T.count >= min_support and total_counts-T.count >= min_support:
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_pos); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":259
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)
 * 								break             # <<<<<<<<<<<<<<
 * 							elif base == 'T' and T.count >= min_support and total_counts-T.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(T.count)
 */
                  goto __pyx_L44_break;
                }

                /* "SomVarIUS_calling.pyx":260
 * 								record[copy_region]['pos'].append(pos)
 * 								break
 * 							elif base == 'T' and T.count >= min_support and total_counts-T.count >= min_support:             # <<<<<<<<<<<<<<
 * 								record[copy_region]['alt_alleles'].append(T.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)
 */
                __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_base, __pyx_n_s_T, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __pyx_t_20 = (__pyx_t_15 != 0);
                if (__pyx_t_20) {
                } else {
                  __pyx_t_14 = __pyx_t_20;
                  goto __pyx_L49_bool_binop_done;
                }
                __pyx_t_20 = ((__pyx_v_T.count >= __pyx_v_min_support) != 0);
                if (__pyx_t_20) {
                } else {
                  __pyx_t_14 = __pyx_t_20;
                  goto __pyx_L49_bool_binop_done;
                }
                __pyx_t_20 = (((__pyx_v_total_counts - __pyx_v_T.count) >= __pyx_v_min_support) != 0);
                __pyx_t_14 = __pyx_t_20;
                __pyx_L49_bool_binop_done:;
                if (__pyx_t_14) {

                  /* "SomVarIUS_calling.pyx":261
 * 								break
 * 							elif base == 'T' and T.count >= min_support and total_counts-T.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(T.count)             # <<<<<<<<<<<<<<
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_alt_alleles); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_T.count); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":262
 * 							elif base == 'T' and T.count >= min_support and total_counts-T.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(T.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)             # <<<<<<<<<<<<<<
 * 								record[copy_region]['pos'].append(pos)
 * 								break
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_total_alleles); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_total_counts); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":263
 * 								record[copy_region]['alt_alleles'].append(T.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)             # <<<<<<<<<<<<<<
 * 								break
 * 							elif base == 'G' and G.count >= min_support and total_counts-G.count >= min_support:
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_pos); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":264
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)
 * 								break             # <<<<<<<<<<<<<<
 * 							elif base == 'G' and G.count >= min_support and total_counts-G.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(G.count)
 */
                  goto __pyx_L44_break;
                }

                /* "SomVarIUS_calling.pyx":265
 * 								record[copy_region]['pos'].append(pos)
 * 								break
 * 							elif base == 'G' and G.count >= min_support and total_counts-G.count >= min_support:             # <<<<<<<<<<<<<<
 * 								record[copy_region]['alt_alleles'].append(G.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)
 */
                __pyx_t_20 = (__Pyx_PyString_Equals(__pyx_v_base, __pyx_n_s_G, Py_EQ)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __pyx_t_15 = (__pyx_t_20 != 0);
                if (__pyx_t_15) {
                } else {
                  __pyx_t_14 = __pyx_t_15;
                  goto __pyx_L52_bool_binop_done;
                }
                __pyx_t_15 = ((__pyx_v_G.count >= __pyx_v_min_support) != 0);
                if (__pyx_t_15) {
                } else {
                  __pyx_t_14 = __pyx_t_15;
                  goto __pyx_L52_bool_binop_done;
                }
                __pyx_t_15 = (((__pyx_v_total_counts - __pyx_v_G.count) >= __pyx_v_min_support) != 0);
                __pyx_t_14 = __pyx_t_15;
                __pyx_L52_bool_binop_done:;
                if (__pyx_t_14) {

                  /* "SomVarIUS_calling.pyx":266
 * 								break
 * 							elif base == 'G' and G.count >= min_support and total_counts-G.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(G.count)             # <<<<<<<<<<<<<<
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_alt_alleles); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_G.count); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":267
 * 							elif base == 'G' and G.count >= min_support and total_counts-G.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(G.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)             # <<<<<<<<<<<<<<
 * 								record[copy_region]['pos'].append(pos)
 * 								break
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_total_alleles); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_total_counts); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":268
 * 								record[copy_region]['alt_alleles'].append(G.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)             # <<<<<<<<<<<<<<
 * 								break
 * 							elif base == 'C' and C.count >= min_support and total_counts-C.count >= min_support:
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_pos); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":269
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)
 * 								break             # <<<<<<<<<<<<<<
 * 							elif base == 'C' and C.count >= min_support and total_counts-C.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(C.count)
 */
                  goto __pyx_L44_break;
                }

                /* "SomVarIUS_calling.pyx":270
 * 								record[copy_region]['pos'].append(pos)
 * 								break
 * 							elif base == 'C' and C.count >= min_support and total_counts-C.count >= min_support:             # <<<<<<<<<<<<<<
 * 								record[copy_region]['alt_alleles'].append(C.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)
 */
                __pyx_t_15 = (__Pyx_PyString_Equals(__pyx_v_base, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                __pyx_t_20 = (__pyx_t_15 != 0);
                if (__pyx_t_20) {
                } else {
                  __pyx_t_14 = __pyx_t_20;
                  goto __pyx_L55_bool_binop_done;
                }
                __pyx_t_20 = ((__pyx_v_C.count >= __pyx_v_min_support) != 0);
                if (__pyx_t_20) {
                } else {
                  __pyx_t_14 = __pyx_t_20;
                  goto __pyx_L55_bool_binop_done;
                }
                __pyx_t_20 = (((__pyx_v_total_counts - __pyx_v_C.count) >= __pyx_v_min_support) != 0);
                __pyx_t_14 = __pyx_t_20;
                __pyx_L55_bool_binop_done:;
                if (__pyx_t_14) {

                  /* "SomVarIUS_calling.pyx":271
 * 								break
 * 							elif base == 'C' and C.count >= min_support and total_counts-C.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(C.count)             # <<<<<<<<<<<<<<
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_alt_alleles); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_C.count); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":272
 * 							elif base == 'C' and C.count >= min_support and total_counts-C.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(C.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)             # <<<<<<<<<<<<<<
 * 								record[copy_region]['pos'].append(pos)
 * 								break
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_total_alleles); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_total_counts); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":273
 * 								record[copy_region]['alt_alleles'].append(C.count)
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)             # <<<<<<<<<<<<<<
 * 								break
 * 
 */
                  __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_1 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_pos); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
                  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_GOTREF(__pyx_t_8);
                  __pyx_t_30 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

                  /* "SomVarIUS_calling.pyx":274
 * 								record[copy_region]['total_alleles'].append(total_counts)
 * 								record[copy_region]['pos'].append(pos)
 * 								break             # <<<<<<<<<<<<<<
 * 
 * 		except KeyError:
 */
                  goto __pyx_L44_break;
                }

                /* "SomVarIUS_calling.pyx":254
 * 					total_counts = float(A.count+T.count+C.count+G.count)
 * 					if total_counts >= min_reads:
 * 						for base in dbsnp_obs_overlap:             # <<<<<<<<<<<<<<
 * 							if base == 'A' and A.count >= min_support and total_counts-A.count >= min_support:
 * 								record[copy_region]['alt_alleles'].append(A.count)
 */
              }
              __pyx_L44_break:;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L42;
            }
            __pyx_L42:;
            goto __pyx_L27;
          }
          __pyx_L27:;
          goto __pyx_L23;
        }
        __pyx_L23:;
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
      __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
      __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "SomVarIUS_calling.pyx":276
 * 								break
 * 
 * 		except KeyError:             # <<<<<<<<<<<<<<
 * 			pass
 * 
 */
      __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_12) {
        PyErr_Restore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_L12_try_end:;
    }

    /* "SomVarIUS_calling.pyx":194
 * 	truncate=False, max_depth=8000)
 * 
 * 	for col in it:             # <<<<<<<<<<<<<<
 * 		chrom = samfile.getrname(col.tid)
 * 		pos = col.pos + 1
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "SomVarIUS_calling.pyx":279
 * 			pass
 * 
 * 	try:             # <<<<<<<<<<<<<<
 * 		if len(record[previous_copy_region]['alt_alleles']) >= 4:
 * 			chrom, start, end = previous_copy_region
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    /*try:*/ {

      /* "SomVarIUS_calling.pyx":280
 * 
 * 	try:
 * 		if len(record[previous_copy_region]['alt_alleles']) >= 4:             # <<<<<<<<<<<<<<
 * 			chrom, start, end = previous_copy_region
 * 			alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),
 */
      __pyx_t_3 = PyObject_GetItem(__pyx_v_record, __pyx_v_previous_copy_region); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L58_error;};
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_alt_alleles); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L58_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_14 = ((__pyx_t_4 >= 4) != 0);
      if (__pyx_t_14) {

        /* "SomVarIUS_calling.pyx":281
 * 	try:
 * 		if len(record[previous_copy_region]['alt_alleles']) >= 4:
 * 			chrom, start, end = previous_copy_region             # <<<<<<<<<<<<<<
 * 			alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),
 * 																			np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 */
        if (likely(__pyx_v_previous_copy_region != Py_None)) {
          PyObject* sequence = __pyx_v_previous_copy_region;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_8);
          #else
          __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        }
        if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_2));
        __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_3);
        __pyx_t_3 = 0;
        __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "SomVarIUS_calling.pyx":282
 * 		if len(record[previous_copy_region]['alt_alleles']) >= 4:
 * 			chrom, start, end = previous_copy_region
 * 			alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),             # <<<<<<<<<<<<<<
 * 																			np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 * 			mean = alpha / (alpha+beta)
 */
        __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyObject_GetItem(__pyx_v_record, __pyx_v_previous_copy_region); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;};
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = PyObject_GetItem(__pyx_t_8, __pyx_n_s_alt_alleles); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __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 = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_8);
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}

        /* "SomVarIUS_calling.pyx":283
 * 			chrom, start, end = previous_copy_region
 * 			alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),
 * 																			np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))             # <<<<<<<<<<<<<<
 * 			mean = alpha / (alpha+beta)
 * 			copy_list.append((chrom, start, end, alpha, beta, mean))
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyObject_GetItem(__pyx_v_record, __pyx_v_previous_copy_region); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_total_alleles); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;};
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_27);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_27) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __pyx_t_27 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_27);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (!(likely(((__pyx_t_27) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_27, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L58_error;}

        /* "SomVarIUS_calling.pyx":282
 * 		if len(record[previous_copy_region]['alt_alleles']) >= 4:
 * 			chrom, start, end = previous_copy_region
 * 			alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),             # <<<<<<<<<<<<<<
 * 																			np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 * 			mean = alpha / (alpha+beta)
 */
        __pyx_t_3 = __pyx_f_17SomVarIUS_calling_fit_beta_binomial(((PyArrayObject *)__pyx_t_7), ((PyArrayObject *)__pyx_t_27)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        if (likely(__pyx_t_3 != Py_None)) {
          PyObject* sequence = __pyx_t_3;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_27 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
          __Pyx_INCREF(__pyx_t_27);
          __Pyx_INCREF(__pyx_t_7);
          #else
          __pyx_t_27 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
          __Pyx_GOTREF(__pyx_t_27);
          __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
          __Pyx_GOTREF(__pyx_t_7);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        }
        __pyx_t_29 = __pyx_PyFloat_AsDouble(__pyx_t_27); if (unlikely((__pyx_t_29 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
        __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_28 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_alpha = __pyx_t_29;
        __pyx_v_beta = __pyx_t_28;

        /* "SomVarIUS_calling.pyx":284
 * 			alpha, beta = fit_beta_binomial(np.array(record[previous_copy_region]['alt_alleles'],dtype=np.float64),
 * 																			np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 * 			mean = alpha / (alpha+beta)             # <<<<<<<<<<<<<<
 * 			copy_list.append((chrom, start, end, alpha, beta, mean))
 * 
 */
        __pyx_t_28 = (__pyx_v_alpha + __pyx_v_beta);
        if (unlikely(__pyx_t_28 == 0)) {
          #ifdef WITH_THREAD
          PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
          #endif
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          #ifdef WITH_THREAD
          PyGILState_Release(__pyx_gilstate_save);
          #endif
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        }
        __pyx_v_mean = (__pyx_v_alpha / __pyx_t_28);

        /* "SomVarIUS_calling.pyx":285
 * 																			np.array(record[previous_copy_region]['total_alleles'],dtype=np.float64))
 * 			mean = alpha / (alpha+beta)
 * 			copy_list.append((chrom, start, end, alpha, beta, mean))             # <<<<<<<<<<<<<<
 * 
 * 		del record[previous_copy_region]
 */
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_beta); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_27 = PyFloat_FromDouble(__pyx_v_mean); if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_27);
        __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_chrom);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_chrom);
        __Pyx_GIVEREF(__pyx_v_chrom);
        __Pyx_INCREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        __Pyx_INCREF(__pyx_v_end);
        PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_end);
        __Pyx_GIVEREF(__pyx_v_end);
        PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_27);
        __Pyx_GIVEREF(__pyx_t_27);
        __pyx_t_3 = 0;
        __pyx_t_7 = 0;
        __pyx_t_27 = 0;
        __pyx_t_30 = __Pyx_PyList_Append(__pyx_v_copy_list, __pyx_t_2); if (unlikely(__pyx_t_30 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L66;
      }
      __pyx_L66:;

      /* "SomVarIUS_calling.pyx":287
 * 			copy_list.append((chrom, start, end, alpha, beta, mean))
 * 
 * 		del record[previous_copy_region]             # <<<<<<<<<<<<<<
 * 	except KeyError:
 * 		pass
 */
      if (PyObject_DelItem(__pyx_v_record, __pyx_v_previous_copy_region) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L58_error;}
    }
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    goto __pyx_L65_try_end;
    __pyx_L58_error:;
    __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
    __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_26); __pyx_t_26 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_27); __pyx_t_27 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":288
 * 
 * 		del record[previous_copy_region]
 * 	except KeyError:             # <<<<<<<<<<<<<<
 * 		pass
 * 
 */
    __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_12) {
      PyErr_Restore(0,0,0);
      goto __pyx_L59_exception_handled;
    }
    goto __pyx_L60_except_error;
    __pyx_L60_except_error:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    goto __pyx_L1_error;
    __pyx_L59_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
    __pyx_L65_try_end:;
  }

  /* "SomVarIUS_calling.pyx":291
 * 		pass
 * 
 * 	return copy_list             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_copy_list);
  __pyx_r = __pyx_v_copy_list;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":164
 * 
 * 
 * def get_dist(copy_record, Samfile samfile, dict ba_to_bed,             # <<<<<<<<<<<<<<
 *  			int min_reads, int min_support, int min_mapq,
 * 			int min_baseq, dict genome, bint copy_bed=False):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_XDECREF(__pyx_t_25);
  __Pyx_XDECREF(__pyx_t_26);
  __Pyx_XDECREF(__pyx_t_27);
  __Pyx_AddTraceback("SomVarIUS_calling.get_dist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_alnbase);
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_XDECREF((PyObject *)__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_alleles);
  __Pyx_XDECREF(__pyx_v_counts);
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_copy_region);
  __Pyx_XDECREF(__pyx_v_copy_list);
  __Pyx_XDECREF(__pyx_v_dbsnp_maj_allele);
  __Pyx_XDECREF(__pyx_v_dbsnp_alt_alleles);
  __Pyx_XDECREF(__pyx_v_previous_copy_region);
  __Pyx_XDECREF(__pyx_v_record);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_obs_alleles);
  __Pyx_XDECREF(__pyx_v_dbsnp_obs_overlap);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":294
 * 
 * 
 * cdef tuple filter_regions(str dbsnp_bed_name, list regions):             # <<<<<<<<<<<<<<
 * 
 * 	cdef set seen_chroms = set()
 */

static PyObject *__pyx_f_17SomVarIUS_calling_filter_regions(PyObject *__pyx_v_dbsnp_bed_name, PyObject *__pyx_v_regions) {
  PyObject *__pyx_v_seen_chroms = 0;
  PyObject *__pyx_v_alleles = 0;
  int __pyx_v_copy_list_pos;
  PyObject *__pyx_v_dbsnp = 0;
  PyObject *__pyx_v_chrom = 0;
  int __pyx_v_pos;
  PyObject *__pyx_v_copy_record = NULL;
  PyObject *__pyx_v_fields = NULL;
  PyObject *__pyx_v_copy_chrom = NULL;
  PyObject *__pyx_v_copy_start = NULL;
  PyObject *__pyx_v_copy_end = NULL;
  PyObject *__pyx_v_in_copy = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("filter_regions", 0);

  /* "SomVarIUS_calling.pyx":296
 * cdef tuple filter_regions(str dbsnp_bed_name, list regions):
 * 
 * 	cdef set seen_chroms = set()             # <<<<<<<<<<<<<<
 * 	cdef tuple alleles
 * 	cdef int copy_list_pos = 0
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_seen_chroms = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":298
 * 	cdef set seen_chroms = set()
 * 	cdef tuple alleles
 * 	cdef int copy_list_pos = 0             # <<<<<<<<<<<<<<
 * 	cdef str line, dbsnp, chrom
 * 	cdef int pos
 */
  __pyx_v_copy_list_pos = 0;

  /* "SomVarIUS_calling.pyx":302
 * 	cdef int pos
 * 
 * 	copy_record = {}             # <<<<<<<<<<<<<<
 * 
 * 	for dbsnp in open(dbsnp_bed_name,'r'):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_copy_record = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":304
 * 	copy_record = {}
 * 
 * 	for dbsnp in open(dbsnp_bed_name,'r'):             # <<<<<<<<<<<<<<
 * 		fields = dbsnp.strip().split('\t')
 * 		chrom = fields[0]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_dbsnp_bed_name);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_dbsnp_bed_name);
  __Pyx_GIVEREF(__pyx_v_dbsnp_bed_name);
  __Pyx_INCREF(__pyx_n_s_r);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_r);
  __Pyx_GIVEREF(__pyx_n_s_r);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_dbsnp, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":305
 * 
 * 	for dbsnp in open(dbsnp_bed_name,'r'):
 * 		fields = dbsnp.strip().split('\t')             # <<<<<<<<<<<<<<
 * 		chrom = fields[0]
 * 		pos = int(fields[1])
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dbsnp, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_fields, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":306
 * 	for dbsnp in open(dbsnp_bed_name,'r'):
 * 		fields = dbsnp.strip().split('\t')
 * 		chrom = fields[0]             # <<<<<<<<<<<<<<
 * 		pos = int(fields[1])
 * 		copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy = track_copy_pos(chrom, pos,
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_chrom, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":307
 * 		fields = dbsnp.strip().split('\t')
 * 		chrom = fields[0]
 * 		pos = int(fields[1])             # <<<<<<<<<<<<<<
 * 		copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy = track_copy_pos(chrom, pos,
 * 																				regions, seen_chroms, copy_list_pos)
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_pos = __pyx_t_7;

    /* "SomVarIUS_calling.pyx":308
 * 		chrom = fields[0]
 * 		pos = int(fields[1])
 * 		copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy = track_copy_pos(chrom, pos,             # <<<<<<<<<<<<<<
 * 																				regions, seen_chroms, copy_list_pos)
 * 		if in_copy:
 */
    __pyx_t_5 = __pyx_f_17SomVarIUS_calling_track_copy_pos(__pyx_v_chrom, __pyx_v_pos, __pyx_v_regions, __pyx_v_seen_chroms, __pyx_v_copy_list_pos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(__pyx_t_5 != Py_None)) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 6)) {
        if (size > 6) __Pyx_RaiseTooManyValuesError(6);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 5); 
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
        for (i=0; i < 6; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (!(likely(PySet_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_10)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_copy_chrom, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_copy_start, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_copy_end, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_copy_list_pos = __pyx_t_7;
    __Pyx_DECREF_SET(__pyx_v_seen_chroms, ((PyObject*)__pyx_t_10));
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_in_copy, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "SomVarIUS_calling.pyx":310
 * 		copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy = track_copy_pos(chrom, pos,
 * 																				regions, seen_chroms, copy_list_pos)
 * 		if in_copy:             # <<<<<<<<<<<<<<
 * 			alleles = (fields[3], frozenset(fields[4].split(',')))
 * 			copy_record[(chrom,pos)] = (copy_chrom,copy_start,copy_end,alleles)
 */
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_in_copy); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_12) {

      /* "SomVarIUS_calling.pyx":311
 * 																				regions, seen_chroms, copy_list_pos)
 * 		if in_copy:
 * 			alleles = (fields[3], frozenset(fields[4].split(',')))             # <<<<<<<<<<<<<<
 * 			copy_record[(chrom,pos)] = (copy_chrom,copy_start,copy_end,alleles)
 * 		else:
 */
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_fields, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_fields, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_split); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyFrozenSet_New(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_5 = 0;
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_alleles, ((PyObject*)__pyx_t_11));
      __pyx_t_11 = 0;

      /* "SomVarIUS_calling.pyx":312
 * 		if in_copy:
 * 			alleles = (fields[3], frozenset(fields[4].split(',')))
 * 			copy_record[(chrom,pos)] = (copy_chrom,copy_start,copy_end,alleles)             # <<<<<<<<<<<<<<
 * 		else:
 * 			continue
 */
      __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_copy_chrom);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_copy_chrom);
      __Pyx_GIVEREF(__pyx_v_copy_chrom);
      __Pyx_INCREF(__pyx_v_copy_start);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_copy_start);
      __Pyx_GIVEREF(__pyx_v_copy_start);
      __Pyx_INCREF(__pyx_v_copy_end);
      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_copy_end);
      __Pyx_GIVEREF(__pyx_v_copy_end);
      __Pyx_INCREF(__pyx_v_alleles);
      PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_v_alleles);
      __Pyx_GIVEREF(__pyx_v_alleles);
      __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_chrom);
      __Pyx_GIVEREF(__pyx_v_chrom);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_t_10 = 0;
      if (unlikely(PyDict_SetItem(__pyx_v_copy_record, __pyx_t_5, __pyx_t_11) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "SomVarIUS_calling.pyx":314
 * 			copy_record[(chrom,pos)] = (copy_chrom,copy_start,copy_end,alleles)
 * 		else:
 * 			continue             # <<<<<<<<<<<<<<
 * 
 * 	return copy_record, seen_chroms
 */
      goto __pyx_L3_continue;
    }
    __pyx_L5:;

    /* "SomVarIUS_calling.pyx":304
 * 	copy_record = {}
 * 
 * 	for dbsnp in open(dbsnp_bed_name,'r'):             # <<<<<<<<<<<<<<
 * 		fields = dbsnp.strip().split('\t')
 * 		chrom = fields[0]
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":316
 * 			continue
 * 
 * 	return copy_record, seen_chroms             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_copy_record);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_copy_record);
  __Pyx_GIVEREF(__pyx_v_copy_record);
  __Pyx_INCREF(__pyx_v_seen_chroms);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_seen_chroms);
  __Pyx_GIVEREF(__pyx_v_seen_chroms);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":294
 * 
 * 
 * cdef tuple filter_regions(str dbsnp_bed_name, list regions):             # <<<<<<<<<<<<<<
 * 
 * 	cdef set seen_chroms = set()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("SomVarIUS_calling.filter_regions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seen_chroms);
  __Pyx_XDECREF(__pyx_v_alleles);
  __Pyx_XDECREF(__pyx_v_dbsnp);
  __Pyx_XDECREF(__pyx_v_chrom);
  __Pyx_XDECREF(__pyx_v_copy_record);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_copy_chrom);
  __Pyx_XDECREF(__pyx_v_copy_start);
  __Pyx_XDECREF(__pyx_v_copy_end);
  __Pyx_XDECREF(__pyx_v_in_copy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":319
 * 
 * 
 * cdef long double calc_se_pval(list copy_list, int pos, str chrom, int alt_count, int total_alleles,             # <<<<<<<<<<<<<<
 *  							dict ba_to_bed, int copy_list_pos, bint in_copy, dict chrom_dist,
 *  							bint binom):
 */

static long double __pyx_f_17SomVarIUS_calling_calc_se_pval(PyObject *__pyx_v_copy_list, CYTHON_UNUSED int __pyx_v_pos, PyObject *__pyx_v_chrom, int __pyx_v_alt_count, int __pyx_v_total_alleles, CYTHON_UNUSED PyObject *__pyx_v_ba_to_bed, int __pyx_v_copy_list_pos, int __pyx_v_in_copy, PyObject *__pyx_v_chrom_dist, int __pyx_v_binom) {
  long double __pyx_v_alpha;
  long double __pyx_v_beta;
  long double __pyx_v_mean;
  PyObject *__pyx_v_pvalue = NULL;
  PyObject *__pyx_v_fields = NULL;
  long double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  long double __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("calc_se_pval", 0);

  /* "SomVarIUS_calling.pyx":326
 * 	cdef long double alpha, beta, mean
 * 
 * 	if binom:             # <<<<<<<<<<<<<<
 * 		pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, 0.5)
 * 
 */
  __pyx_t_1 = (__pyx_v_binom != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":327
 * 
 * 	if binom:
 * 		pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, 0.5)             # <<<<<<<<<<<<<<
 * 
 * 	elif in_copy:
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_scipy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stats); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_binom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cdf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_alt_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_float_0_5);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_float_0_5);
    __Pyx_GIVEREF(__pyx_float_0_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_pvalue = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }

  /* "SomVarIUS_calling.pyx":329
 * 		pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, 0.5)
 * 
 * 	elif in_copy:             # <<<<<<<<<<<<<<
 * 		fields = copy_list[copy_list_pos]
 * 		alpha = fields[3]
 */
  __pyx_t_1 = (__pyx_v_in_copy != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":330
 * 
 * 	elif in_copy:
 * 		fields = copy_list[copy_list_pos]             # <<<<<<<<<<<<<<
 * 		alpha = fields[3]
 * 		beta = fields[4]
 */
    if (unlikely(__pyx_v_copy_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_copy_list, __pyx_v_copy_list_pos, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_fields = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":331
 * 	elif in_copy:
 * 		fields = copy_list[copy_list_pos]
 * 		alpha = fields[3]             # <<<<<<<<<<<<<<
 * 		beta = fields[4]
 * 		if alpha < 1e15 and beta < 1e15:
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_alpha = __pyx_t_9;

    /* "SomVarIUS_calling.pyx":332
 * 		fields = copy_list[copy_list_pos]
 * 		alpha = fields[3]
 * 		beta = fields[4]             # <<<<<<<<<<<<<<
 * 		if alpha < 1e15 and beta < 1e15:
 * 			pvalue = betabin_cdf(alt_count, total_alleles, alpha, beta)
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_beta = __pyx_t_9;

    /* "SomVarIUS_calling.pyx":333
 * 		alpha = fields[3]
 * 		beta = fields[4]
 * 		if alpha < 1e15 and beta < 1e15:             # <<<<<<<<<<<<<<
 * 			pvalue = betabin_cdf(alt_count, total_alleles, alpha, beta)
 * 		else:
 */
    __pyx_t_10 = ((__pyx_v_alpha < 1e15) != 0);
    if (__pyx_t_10) {
    } else {
      __pyx_t_1 = __pyx_t_10;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_10 = ((__pyx_v_beta < 1e15) != 0);
    __pyx_t_1 = __pyx_t_10;
    __pyx_L5_bool_binop_done:;
    if (__pyx_t_1) {

      /* "SomVarIUS_calling.pyx":334
 * 		beta = fields[4]
 * 		if alpha < 1e15 and beta < 1e15:
 * 			pvalue = betabin_cdf(alt_count, total_alleles, alpha, beta)             # <<<<<<<<<<<<<<
 * 		else:
 * 			mean = fields[5]
 */
      __pyx_t_2 = PyFloat_FromDouble(__pyx_f_17SomVarIUS_calling_betabin_cdf(__pyx_v_alt_count, __pyx_v_total_alleles, __pyx_v_alpha, __pyx_v_beta)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_pvalue = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "SomVarIUS_calling.pyx":336
 * 			pvalue = betabin_cdf(alt_count, total_alleles, alpha, beta)
 * 		else:
 * 			mean = fields[5]             # <<<<<<<<<<<<<<
 * 			pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, mean)
 * 	else:
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fields, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_mean = __pyx_t_9;

      /* "SomVarIUS_calling.pyx":337
 * 		else:
 * 			mean = fields[5]
 * 			pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, mean)             # <<<<<<<<<<<<<<
 * 	else:
 * 		try:
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_scipy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_stats); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_binom); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cdf); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_alt_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_mean); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_7 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_6) {
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      }
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_7, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_7, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_pvalue = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "SomVarIUS_calling.pyx":339
 * 			pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, mean)
 * 	else:
 * 		try:             # <<<<<<<<<<<<<<
 * 			alpha = chrom_dist[chrom][0]
 * 			beta = chrom_dist[chrom][1]
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      /*try:*/ {

        /* "SomVarIUS_calling.pyx":340
 * 	else:
 * 		try:
 * 			alpha = chrom_dist[chrom][0]             # <<<<<<<<<<<<<<
 * 			beta = chrom_dist[chrom][1]
 * 			if alpha < 1e15 and beta < 1e15:
 */
        if (unlikely(__pyx_v_chrom_dist == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_chrom_dist, __pyx_v_chrom); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L7_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L7_error;};
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_v_alpha = __pyx_t_9;

        /* "SomVarIUS_calling.pyx":341
 * 		try:
 * 			alpha = chrom_dist[chrom][0]
 * 			beta = chrom_dist[chrom][1]             # <<<<<<<<<<<<<<
 * 			if alpha < 1e15 and beta < 1e15:
 * 				pvalue = betabin_cdf(alt_count, total_alleles, alpha, beta)
 */
        if (unlikely(__pyx_v_chrom_dist == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_chrom_dist, __pyx_v_chrom); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L7_error;};
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L7_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_beta = __pyx_t_9;

        /* "SomVarIUS_calling.pyx":342
 * 			alpha = chrom_dist[chrom][0]
 * 			beta = chrom_dist[chrom][1]
 * 			if alpha < 1e15 and beta < 1e15:             # <<<<<<<<<<<<<<
 * 				pvalue = betabin_cdf(alt_count, total_alleles, alpha, beta)
 * 			else:
 */
        __pyx_t_10 = ((__pyx_v_alpha < 1e15) != 0);
        if (__pyx_t_10) {
        } else {
          __pyx_t_1 = __pyx_t_10;
          goto __pyx_L16_bool_binop_done;
        }
        __pyx_t_10 = ((__pyx_v_beta < 1e15) != 0);
        __pyx_t_1 = __pyx_t_10;
        __pyx_L16_bool_binop_done:;
        if (__pyx_t_1) {

          /* "SomVarIUS_calling.pyx":343
 * 			beta = chrom_dist[chrom][1]
 * 			if alpha < 1e15 and beta < 1e15:
 * 				pvalue = betabin_cdf(alt_count, total_alleles, alpha, beta)             # <<<<<<<<<<<<<<
 * 			else:
 * 				mean = chrom_dist[chrom][2]
 */
          __pyx_t_2 = PyFloat_FromDouble(__pyx_f_17SomVarIUS_calling_betabin_cdf(__pyx_v_alt_count, __pyx_v_total_alleles, __pyx_v_alpha, __pyx_v_beta)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_v_pvalue = __pyx_t_2;
          __pyx_t_2 = 0;
          goto __pyx_L15;
        }
        /*else*/ {

          /* "SomVarIUS_calling.pyx":345
 * 				pvalue = betabin_cdf(alt_count, total_alleles, alpha, beta)
 * 			else:
 * 				mean = chrom_dist[chrom][2]             # <<<<<<<<<<<<<<
 * 				pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, mean)
 * 		except:
 */
          if (unlikely(__pyx_v_chrom_dist == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          }
          __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_chrom_dist, __pyx_v_chrom); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L7_error;};
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L7_error;};
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_v_mean = __pyx_t_9;

          /* "SomVarIUS_calling.pyx":346
 * 			else:
 * 				mean = chrom_dist[chrom][2]
 * 				pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, mean)             # <<<<<<<<<<<<<<
 * 		except:
 * 			pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, 0.5)
 */
          __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_scipy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stats); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_binom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cdf); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_alt_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = PyFloat_FromDouble(__pyx_v_mean); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_4 = NULL;
          __pyx_t_7 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_11, function);
              __pyx_t_7 = 1;
            }
          }
          __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_6);
          if (__pyx_t_4) {
            PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
          }
          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_2);
          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_5);
          __pyx_t_2 = 0;
          __pyx_t_3 = 0;
          __pyx_t_5 = 0;
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_pvalue = __pyx_t_8;
          __pyx_t_8 = 0;
        }
        __pyx_L15:;
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "SomVarIUS_calling.pyx":347
 * 				mean = chrom_dist[chrom][2]
 * 				pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, mean)
 * 		except:             # <<<<<<<<<<<<<<
 * 			pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, 0.5)
 * 
 */
      /*except:*/ {
        __Pyx_AddTraceback("SomVarIUS_calling.calc_se_pval", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_11, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_GOTREF(__pyx_t_6);

        /* "SomVarIUS_calling.pyx":348
 * 				pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, mean)
 * 		except:
 * 			pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, 0.5)             # <<<<<<<<<<<<<<
 * 
 * 	return 1-pvalue
 */
        __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_scipy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stats); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_binom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cdf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_alt_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_total_alleles); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_15 = NULL;
        __pyx_t_7 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_7 = 1;
          }
        }
        __pyx_t_16 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_16);
        if (__pyx_t_15) {
          PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
        }
        PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_7, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_7, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_float_0_5);
        PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_7, __pyx_float_0_5);
        __Pyx_GIVEREF(__pyx_float_0_5);
        __pyx_t_3 = 0;
        __pyx_t_4 = 0;
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_16, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF_SET(__pyx_v_pvalue, __pyx_t_5);
        __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L8_exception_handled;
      }
      __pyx_L9_except_error:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      goto __pyx_L1_error;
      __pyx_L8_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_L14_try_end:;
    }
  }
  __pyx_L3:;

  /* "SomVarIUS_calling.pyx":350
 * 			pvalue = scipy.stats.binom.cdf(alt_count, total_alleles, 0.5)
 * 
 * 	return 1-pvalue             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6 = PyNumber_Subtract(__pyx_int_1, __pyx_v_pvalue); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_9;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":319
 * 
 * 
 * cdef long double calc_se_pval(list copy_list, int pos, str chrom, int alt_count, int total_alleles,             # <<<<<<<<<<<<<<
 *  							dict ba_to_bed, int copy_list_pos, bint in_copy, dict chrom_dist,
 *  							bint binom):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_WriteUnraisable("SomVarIUS_calling.calc_se_pval", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pvalue);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":353
 * 
 * 
 * cdef inline tuple chernoff(double m, double d, int alt_count, int total_alleles,             # <<<<<<<<<<<<<<
 *  					double min_se, double min_hetero, int pos, str chrom,
 *  					bint copy_filter, list copy_list, dict ba_to_bed,
 */

static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling_chernoff(double __pyx_v_m, double __pyx_v_d, int __pyx_v_alt_count, int __pyx_v_total_alleles, double __pyx_v_min_se, double __pyx_v_min_hetero, int __pyx_v_pos, PyObject *__pyx_v_chrom, CYTHON_UNUSED int __pyx_v_copy_filter, PyObject *__pyx_v_copy_list, PyObject *__pyx_v_ba_to_bed, int __pyx_v_in_copy, int __pyx_v_copy_list_pos, PyObject *__pyx_v_chrom_dist, int __pyx_v_binom) {
  long double __pyx_v_prob_se;
  long double __pyx_v_prob_not_se;
  long double __pyx_v_prob_not_hetero;
  long double __pyx_v_pvalue;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long double __pyx_t_1;
  long double __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("chernoff", 0);

  /* "SomVarIUS_calling.pyx":361
 * 	cdef long double prob_se, prob_not_se, prob_not_hetero, pvalue
 * 
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)             # <<<<<<<<<<<<<<
 * 	prob_se=fmax(1e-15, prob_se)
 * 	prob_not_hetero = calc_se_pval(copy_list, pos, chrom, alt_count, total_alleles,
 */
  __pyx_t_1 = exp(__pyx_v_d);
  __pyx_t_2 = pow((1.0 + __pyx_v_d), (1.0 + __pyx_v_d));
  if (unlikely(__pyx_t_2 == 0)) {
    #ifdef WITH_THREAD
    PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
    #endif
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    #ifdef WITH_THREAD
    PyGILState_Release(__pyx_gilstate_save);
    #endif
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_prob_se = pow((__pyx_t_1 / __pyx_t_2), __pyx_v_m);

  /* "SomVarIUS_calling.pyx":362
 * 
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)
 * 	prob_se=fmax(1e-15, prob_se)             # <<<<<<<<<<<<<<
 * 	prob_not_hetero = calc_se_pval(copy_list, pos, chrom, alt_count, total_alleles,
 * 										ba_to_bed, copy_list_pos, in_copy, chrom_dist,
 */
  __pyx_v_prob_se = fmax(1e-15, __pyx_v_prob_se);

  /* "SomVarIUS_calling.pyx":363
 * 	prob_se = pow((exp(d) / pow((1+d), (1+d))), m)
 * 	prob_se=fmax(1e-15, prob_se)
 * 	prob_not_hetero = calc_se_pval(copy_list, pos, chrom, alt_count, total_alleles,             # <<<<<<<<<<<<<<
 * 										ba_to_bed, copy_list_pos, in_copy, chrom_dist,
 * 										binom)
 */
  __pyx_v_prob_not_hetero = __pyx_f_17SomVarIUS_calling_calc_se_pval(__pyx_v_copy_list, __pyx_v_pos, __pyx_v_chrom, __pyx_v_alt_count, __pyx_v_total_alleles, __pyx_v_ba_to_bed, __pyx_v_copy_list_pos, __pyx_v_in_copy, __pyx_v_chrom_dist, __pyx_v_binom);

  /* "SomVarIUS_calling.pyx":366
 * 										ba_to_bed, copy_list_pos, in_copy, chrom_dist,
 * 										binom)
 * 	prob_not_se = 1.0 - prob_se             # <<<<<<<<<<<<<<
 * 	pvalue = 1.0-(prob_not_se * prob_not_hetero)
 * 	if prob_not_se <= min_se or prob_not_hetero <= min_hetero:
 */
  __pyx_v_prob_not_se = (1.0 - __pyx_v_prob_se);

  /* "SomVarIUS_calling.pyx":367
 * 										binom)
 * 	prob_not_se = 1.0 - prob_se
 * 	pvalue = 1.0-(prob_not_se * prob_not_hetero)             # <<<<<<<<<<<<<<
 * 	if prob_not_se <= min_se or prob_not_hetero <= min_hetero:
 * 		pvalue = 1.0
 */
  __pyx_v_pvalue = (1.0 - (__pyx_v_prob_not_se * __pyx_v_prob_not_hetero));

  /* "SomVarIUS_calling.pyx":368
 * 	prob_not_se = 1.0 - prob_se
 * 	pvalue = 1.0-(prob_not_se * prob_not_hetero)
 * 	if prob_not_se <= min_se or prob_not_hetero <= min_hetero:             # <<<<<<<<<<<<<<
 * 		pvalue = 1.0
 * 	return pvalue, prob_not_se, prob_not_hetero
 */
  __pyx_t_4 = ((__pyx_v_prob_not_se <= __pyx_v_min_se) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = ((__pyx_v_prob_not_hetero <= __pyx_v_min_hetero) != 0);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "SomVarIUS_calling.pyx":369
 * 	pvalue = 1.0-(prob_not_se * prob_not_hetero)
 * 	if prob_not_se <= min_se or prob_not_hetero <= min_hetero:
 * 		pvalue = 1.0             # <<<<<<<<<<<<<<
 * 	return pvalue, prob_not_se, prob_not_hetero
 * 
 */
    __pyx_v_pvalue = 1.0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "SomVarIUS_calling.pyx":370
 * 	if prob_not_se <= min_se or prob_not_hetero <= min_hetero:
 * 		pvalue = 1.0
 * 	return pvalue, prob_not_se, prob_not_hetero             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_pvalue); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_prob_not_se); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_prob_not_hetero); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_7);
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_r = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":353
 * 
 * 
 * cdef inline tuple chernoff(double m, double d, int alt_count, int total_alleles,             # <<<<<<<<<<<<<<
 *  					double min_se, double min_hetero, int pos, str chrom,
 *  					bint copy_filter, list copy_list, dict ba_to_bed,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SomVarIUS_calling.chernoff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":373
 * 
 * 
 * cdef inline tuple multi_alleles(str alt_allele, str third_allele, str fourth_allele,             # <<<<<<<<<<<<<<
 *  						_CountAllele A, _CountAllele T,
 *  						_CountAllele G, _CountAllele C,
 */

static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling_multi_alleles(PyObject *__pyx_v_alt_allele, PyObject *__pyx_v_third_allele, PyObject *__pyx_v_fourth_allele, struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_A, struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_T, struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_G, struct __pyx_t_17SomVarIUS_calling__CountAllele __pyx_v_C, int __pyx_v_alt_count, int __pyx_v_third_count, int __pyx_v_fourth_count) {
  double __pyx_v_alt_quality;
  double __pyx_v_third_quality;
  double __pyx_v_fourth_quality;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("multi_alleles", 0);

  /* "SomVarIUS_calling.pyx":381
 * 	cdef double alt_quality, third_quality, fourth_quality
 * 
 * 	if alt_allele == 'A':             # <<<<<<<<<<<<<<
 * 		alt_quality = A.qual / A.count
 * 	elif alt_allele == 'T':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_alt_allele, __pyx_n_s_A, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "SomVarIUS_calling.pyx":382
 * 
 * 	if alt_allele == 'A':
 * 		alt_quality = A.qual / A.count             # <<<<<<<<<<<<<<
 * 	elif alt_allele == 'T':
 * 		alt_quality = T.qual / T.count
 */
    if (unlikely(__pyx_v_A.count == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_alt_quality = (__pyx_v_A.qual / __pyx_v_A.count);
    goto __pyx_L3;
  }

  /* "SomVarIUS_calling.pyx":383
 * 	if alt_allele == 'A':
 * 		alt_quality = A.qual / A.count
 * 	elif alt_allele == 'T':             # <<<<<<<<<<<<<<
 * 		alt_quality = T.qual / T.count
 * 	elif alt_allele == 'G':
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alt_allele, __pyx_n_s_T, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":384
 * 		alt_quality = A.qual / A.count
 * 	elif alt_allele == 'T':
 * 		alt_quality = T.qual / T.count             # <<<<<<<<<<<<<<
 * 	elif alt_allele == 'G':
 * 		alt_quality = G.qual / G.count
 */
    if (unlikely(__pyx_v_T.count == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_alt_quality = (__pyx_v_T.qual / __pyx_v_T.count);
    goto __pyx_L3;
  }

  /* "SomVarIUS_calling.pyx":385
 * 	elif alt_allele == 'T':
 * 		alt_quality = T.qual / T.count
 * 	elif alt_allele == 'G':             # <<<<<<<<<<<<<<
 * 		alt_quality = G.qual / G.count
 * 	elif alt_allele == 'C':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_alt_allele, __pyx_n_s_G, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "SomVarIUS_calling.pyx":386
 * 		alt_quality = T.qual / T.count
 * 	elif alt_allele == 'G':
 * 		alt_quality = G.qual / G.count             # <<<<<<<<<<<<<<
 * 	elif alt_allele == 'C':
 * 		alt_quality = C.qual / C.count
 */
    if (unlikely(__pyx_v_G.count == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_alt_quality = (__pyx_v_G.qual / __pyx_v_G.count);
    goto __pyx_L3;
  }

  /* "SomVarIUS_calling.pyx":387
 * 	elif alt_allele == 'G':
 * 		alt_quality = G.qual / G.count
 * 	elif alt_allele == 'C':             # <<<<<<<<<<<<<<
 * 		alt_quality = C.qual / C.count
 * 
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_alt_allele, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":388
 * 		alt_quality = G.qual / G.count
 * 	elif alt_allele == 'C':
 * 		alt_quality = C.qual / C.count             # <<<<<<<<<<<<<<
 * 
 * 	if third_allele == 'A':
 */
    if (unlikely(__pyx_v_C.count == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_alt_quality = (__pyx_v_C.qual / __pyx_v_C.count);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "SomVarIUS_calling.pyx":390
 * 		alt_quality = C.qual / C.count
 * 
 * 	if third_allele == 'A':             # <<<<<<<<<<<<<<
 * 		third_quality = A.qual / A.count
 * 	elif third_allele == 'T':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_third_allele, __pyx_n_s_A, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "SomVarIUS_calling.pyx":391
 * 
 * 	if third_allele == 'A':
 * 		third_quality = A.qual / A.count             # <<<<<<<<<<<<<<
 * 	elif third_allele == 'T':
 * 		third_quality = T.qual / T.count
 */
    if (unlikely(__pyx_v_A.count == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_third_quality = (__pyx_v_A.qual / __pyx_v_A.count);
    goto __pyx_L4;
  }

  /* "SomVarIUS_calling.pyx":392
 * 	if third_allele == 'A':
 * 		third_quality = A.qual / A.count
 * 	elif third_allele == 'T':             # <<<<<<<<<<<<<<
 * 		third_quality = T.qual / T.count
 * 	elif third_allele == 'G':
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_third_allele, __pyx_n_s_T, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":393
 * 		third_quality = A.qual / A.count
 * 	elif third_allele == 'T':
 * 		third_quality = T.qual / T.count             # <<<<<<<<<<<<<<
 * 	elif third_allele == 'G':
 * 		third_quality = G.qual / G.count
 */
    if (unlikely(__pyx_v_T.count == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_third_quality = (__pyx_v_T.qual / __pyx_v_T.count);
    goto __pyx_L4;
  }

  /* "SomVarIUS_calling.pyx":394
 * 	elif third_allele == 'T':
 * 		third_quality = T.qual / T.count
 * 	elif third_allele == 'G':             # <<<<<<<<<<<<<<
 * 		third_quality = G.qual / G.count
 * 	elif third_allele == 'C':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_third_allele, __pyx_n_s_G, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "SomVarIUS_calling.pyx":395
 * 		third_quality = T.qual / T.count
 * 	elif third_allele == 'G':
 * 		third_quality = G.qual / G.count             # <<<<<<<<<<<<<<
 * 	elif third_allele == 'C':
 * 		third_quality = C.qual / C.count
 */
    if (unlikely(__pyx_v_G.count == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_third_quality = (__pyx_v_G.qual / __pyx_v_G.count);
    goto __pyx_L4;
  }

  /* "SomVarIUS_calling.pyx":396
 * 	elif third_allele == 'G':
 * 		third_quality = G.qual / G.count
 * 	elif third_allele == 'C':             # <<<<<<<<<<<<<<
 * 		third_quality = C.qual / C.count
 * 
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_third_allele, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":397
 * 		third_quality = G.qual / G.count
 * 	elif third_allele == 'C':
 * 		third_quality = C.qual / C.count             # <<<<<<<<<<<<<<
 * 
 * 	if third_count == fourth_count:
 */
    if (unlikely(__pyx_v_C.count == 0)) {
      #ifdef WITH_THREAD
      PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
      #endif
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      #ifdef WITH_THREAD
      PyGILState_Release(__pyx_gilstate_save);
      #endif
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_third_quality = (__pyx_v_C.qual / __pyx_v_C.count);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "SomVarIUS_calling.pyx":399
 * 		third_quality = C.qual / C.count
 * 
 * 	if third_count == fourth_count:             # <<<<<<<<<<<<<<
 * 		if fourth_allele == 'A':
 * 			fourth_quality = A.qual / A.count
 */
  __pyx_t_1 = ((__pyx_v_third_count == __pyx_v_fourth_count) != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":400
 * 
 * 	if third_count == fourth_count:
 * 		if fourth_allele == 'A':             # <<<<<<<<<<<<<<
 * 			fourth_quality = A.qual / A.count
 * 		elif fourth_allele == 'T':
 */
    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_fourth_allele, __pyx_n_s_A, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "SomVarIUS_calling.pyx":401
 * 	if third_count == fourth_count:
 * 		if fourth_allele == 'A':
 * 			fourth_quality = A.qual / A.count             # <<<<<<<<<<<<<<
 * 		elif fourth_allele == 'T':
 * 			fourth_quality = T.qual / T.count
 */
      if (unlikely(__pyx_v_A.count == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_fourth_quality = (__pyx_v_A.qual / __pyx_v_A.count);
      goto __pyx_L6;
    }

    /* "SomVarIUS_calling.pyx":402
 * 		if fourth_allele == 'A':
 * 			fourth_quality = A.qual / A.count
 * 		elif fourth_allele == 'T':             # <<<<<<<<<<<<<<
 * 			fourth_quality = T.qual / T.count
 * 		elif fourth_allele == 'G':
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_fourth_allele, __pyx_n_s_T, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "SomVarIUS_calling.pyx":403
 * 			fourth_quality = A.qual / A.count
 * 		elif fourth_allele == 'T':
 * 			fourth_quality = T.qual / T.count             # <<<<<<<<<<<<<<
 * 		elif fourth_allele == 'G':
 * 			fourth_quality = G.qual / G.count
 */
      if (unlikely(__pyx_v_T.count == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_fourth_quality = (__pyx_v_T.qual / __pyx_v_T.count);
      goto __pyx_L6;
    }

    /* "SomVarIUS_calling.pyx":404
 * 		elif fourth_allele == 'T':
 * 			fourth_quality = T.qual / T.count
 * 		elif fourth_allele == 'G':             # <<<<<<<<<<<<<<
 * 			fourth_quality = G.qual / G.count
 * 		elif fourth_allele == 'C':
 */
    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_fourth_allele, __pyx_n_s_G, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "SomVarIUS_calling.pyx":405
 * 			fourth_quality = T.qual / T.count
 * 		elif fourth_allele == 'G':
 * 			fourth_quality = G.qual / G.count             # <<<<<<<<<<<<<<
 * 		elif fourth_allele == 'C':
 * 			fourth_quality = C.qual / C.count
 */
      if (unlikely(__pyx_v_G.count == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_fourth_quality = (__pyx_v_G.qual / __pyx_v_G.count);
      goto __pyx_L6;
    }

    /* "SomVarIUS_calling.pyx":406
 * 		elif fourth_allele == 'G':
 * 			fourth_quality = G.qual / G.count
 * 		elif fourth_allele == 'C':             # <<<<<<<<<<<<<<
 * 			fourth_quality = C.qual / C.count
 * 
 */
    __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_fourth_allele, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "SomVarIUS_calling.pyx":407
 * 			fourth_quality = G.qual / G.count
 * 		elif fourth_allele == 'C':
 * 			fourth_quality = C.qual / C.count             # <<<<<<<<<<<<<<
 * 
 * 		if alt_quality >= fourth_quality and alt_quality >= third_quality:
 */
      if (unlikely(__pyx_v_C.count == 0)) {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
        #endif
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        #ifdef WITH_THREAD
        PyGILState_Release(__pyx_gilstate_save);
        #endif
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_v_fourth_quality = (__pyx_v_C.qual / __pyx_v_C.count);
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "SomVarIUS_calling.pyx":409
 * 			fourth_quality = C.qual / C.count
 * 
 * 		if alt_quality >= fourth_quality and alt_quality >= third_quality:             # <<<<<<<<<<<<<<
 * 			return alt_allele, alt_count
 * 		elif third_quality >= alt_quality and third_quality >= fourth_quality:
 */
    __pyx_t_2 = ((__pyx_v_alt_quality >= __pyx_v_fourth_quality) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_alt_quality >= __pyx_v_third_quality) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_1) {

      /* "SomVarIUS_calling.pyx":410
 * 
 * 		if alt_quality >= fourth_quality and alt_quality >= third_quality:
 * 			return alt_allele, alt_count             # <<<<<<<<<<<<<<
 * 		elif third_quality >= alt_quality and third_quality >= fourth_quality:
 * 			return third_allele, third_count
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_alt_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_alt_allele);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_alt_allele);
      __Pyx_GIVEREF(__pyx_v_alt_allele);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_r = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "SomVarIUS_calling.pyx":411
 * 		if alt_quality >= fourth_quality and alt_quality >= third_quality:
 * 			return alt_allele, alt_count
 * 		elif third_quality >= alt_quality and third_quality >= fourth_quality:             # <<<<<<<<<<<<<<
 * 			return third_allele, third_count
 * 		elif fourth_quality >= third_quality and fourth_quality >= alt_quality:
 */
    __pyx_t_2 = ((__pyx_v_third_quality >= __pyx_v_alt_quality) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_third_quality >= __pyx_v_fourth_quality) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_1) {

      /* "SomVarIUS_calling.pyx":412
 * 			return alt_allele, alt_count
 * 		elif third_quality >= alt_quality and third_quality >= fourth_quality:
 * 			return third_allele, third_count             # <<<<<<<<<<<<<<
 * 		elif fourth_quality >= third_quality and fourth_quality >= alt_quality:
 * 			return fourth_allele, fourth_count
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_third_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_third_allele);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_third_allele);
      __Pyx_GIVEREF(__pyx_v_third_allele);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "SomVarIUS_calling.pyx":413
 * 		elif third_quality >= alt_quality and third_quality >= fourth_quality:
 * 			return third_allele, third_count
 * 		elif fourth_quality >= third_quality and fourth_quality >= alt_quality:             # <<<<<<<<<<<<<<
 * 			return fourth_allele, fourth_count
 * 
 */
    __pyx_t_2 = ((__pyx_v_fourth_quality >= __pyx_v_third_quality) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_fourth_quality >= __pyx_v_alt_quality) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_1) {

      /* "SomVarIUS_calling.pyx":414
 * 			return third_allele, third_count
 * 		elif fourth_quality >= third_quality and fourth_quality >= alt_quality:
 * 			return fourth_allele, fourth_count             # <<<<<<<<<<<<<<
 * 
 * 	else:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_fourth_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_fourth_allele);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fourth_allele);
      __Pyx_GIVEREF(__pyx_v_fourth_allele);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_r = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
    goto __pyx_L5;
  }
  /*else*/ {

    /* "SomVarIUS_calling.pyx":417
 * 
 * 	else:
 * 		if third_quality > alt_quality:             # <<<<<<<<<<<<<<
 * 			return third_allele, third_count
 * 		else:
 */
    __pyx_t_1 = ((__pyx_v_third_quality > __pyx_v_alt_quality) != 0);
    if (__pyx_t_1) {

      /* "SomVarIUS_calling.pyx":418
 * 	else:
 * 		if third_quality > alt_quality:
 * 			return third_allele, third_count             # <<<<<<<<<<<<<<
 * 		else:
 * 			return alt_allele, alt_count
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_third_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_third_allele);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_third_allele);
      __Pyx_GIVEREF(__pyx_v_third_allele);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_r = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }
    /*else*/ {

      /* "SomVarIUS_calling.pyx":420
 * 			return third_allele, third_count
 * 		else:
 * 			return alt_allele, alt_count             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_alt_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_alt_allele);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_alt_allele);
      __Pyx_GIVEREF(__pyx_v_alt_allele);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_r = ((PyObject*)__pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L0;
    }
  }
  __pyx_L5:;

  /* "SomVarIUS_calling.pyx":373
 * 
 * 
 * cdef inline tuple multi_alleles(str alt_allele, str third_allele, str fourth_allele,             # <<<<<<<<<<<<<<
 *  						_CountAllele A, _CountAllele T,
 *  						_CountAllele G, _CountAllele C,
 */

  /* function exit code */
  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SomVarIUS_calling.multi_alleles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":423
 * 
 * 
 * cdef inline double rna_seq_filter(str chrom, int pos, str alt_allele, Samfile rna_seq_file):             # <<<<<<<<<<<<<<
 * 	cdef double rna_seq_support = float("NaN")
 * 	cdef bam_pileup1_t ** rna_plp
 */

static CYTHON_INLINE double __pyx_f_17SomVarIUS_calling_rna_seq_filter(PyObject *__pyx_v_chrom, int __pyx_v_pos, PyObject *__pyx_v_alt_allele, struct __pyx_obj_5pysam_8csamfile_Samfile *__pyx_v_rna_seq_file) {
  double __pyx_v_rna_seq_support;
  bam_pileup1_t **__pyx_v_rna_plp;
  bam_pileup1_t *__pyx_v_rna_read;
  bam1_t *__pyx_v_rna_aln;
  struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *__pyx_v_col = 0;
  int __pyx_v_rna_pos;
  PyObject *__pyx_v_rna_alnbase = 0;
  int __pyx_v_i;
  int __pyx_v_n;
  PyObject *__pyx_v_it = NULL;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  bam_pileup1_t **__pyx_t_8;
  int __pyx_t_9;
  bam1_t *__pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rna_seq_filter", 0);

  /* "SomVarIUS_calling.pyx":424
 * 
 * cdef inline double rna_seq_filter(str chrom, int pos, str alt_allele, Samfile rna_seq_file):
 * 	cdef double rna_seq_support = float("NaN")             # <<<<<<<<<<<<<<
 * 	cdef bam_pileup1_t ** rna_plp
 * 	cdef bam_pileup1_t * rna_read
 */
  __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_n_s_NaN); if (unlikely(__pyx_t_1 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_rna_seq_support = __pyx_t_1;

  /* "SomVarIUS_calling.pyx":434
 * 	cdef int n
 * 
 * 	it = rna_seq_file.pileup(reference=chrom, start=pos, end=pos+1,             # <<<<<<<<<<<<<<
 * 						truncate=False, max_depth=8000)
 * 	for col in it:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rna_seq_file), __pyx_n_s_pileup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_reference, __pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_pos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_start, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_pos + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_end, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "SomVarIUS_calling.pyx":435
 * 
 * 	it = rna_seq_file.pileup(reference=chrom, start=pos, end=pos+1,
 * 						truncate=False, max_depth=8000)             # <<<<<<<<<<<<<<
 * 	for col in it:
 * 		# initialise variables
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_truncate, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_max_depth, __pyx_int_8000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":434
 * 	cdef int n
 * 
 * 	it = rna_seq_file.pileup(reference=chrom, start=pos, end=pos+1,             # <<<<<<<<<<<<<<
 * 						truncate=False, max_depth=8000)
 * 	for col in it:
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_it = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "SomVarIUS_calling.pyx":436
 * 	it = rna_seq_file.pileup(reference=chrom, start=pos, end=pos+1,
 * 						truncate=False, max_depth=8000)
 * 	for col in it:             # <<<<<<<<<<<<<<
 * 		# initialise variables
 * 		n = col.n
 */
  if (likely(PyList_CheckExact(__pyx_v_it)) || PyTuple_CheckExact(__pyx_v_it)) {
    __pyx_t_4 = __pyx_v_it; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5pysam_14calignmentfile_PileupColumn))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_col, ((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "SomVarIUS_calling.pyx":438
 * 	for col in it:
 * 		# initialise variables
 * 		n = col.n             # <<<<<<<<<<<<<<
 * 		rna_pos = col.pos
 * 		rna_plp = col.plp
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_col), __pyx_n_s_n); 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_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_n = __pyx_t_7;

    /* "SomVarIUS_calling.pyx":439
 * 		# initialise variables
 * 		n = col.n
 * 		rna_pos = col.pos             # <<<<<<<<<<<<<<
 * 		rna_plp = col.plp
 * 		if rna_pos == pos:
 */
    __pyx_t_7 = __pyx_v_col->pos;
    __pyx_v_rna_pos = __pyx_t_7;

    /* "SomVarIUS_calling.pyx":440
 * 		n = col.n
 * 		rna_pos = col.pos
 * 		rna_plp = col.plp             # <<<<<<<<<<<<<<
 * 		if rna_pos == pos:
 * 			for i from 0<=i < n:
 */
    __pyx_t_8 = __pyx_v_col->plp;
    __pyx_v_rna_plp = __pyx_t_8;

    /* "SomVarIUS_calling.pyx":441
 * 		rna_pos = col.pos
 * 		rna_plp = col.plp
 * 		if rna_pos == pos:             # <<<<<<<<<<<<<<
 * 			for i from 0<=i < n:
 * 				rna_read = &(rna_plp[0][i])
 */
    __pyx_t_9 = ((__pyx_v_rna_pos == __pyx_v_pos) != 0);
    if (__pyx_t_9) {

      /* "SomVarIUS_calling.pyx":442
 * 		rna_plp = col.plp
 * 		if rna_pos == pos:
 * 			for i from 0<=i < n:             # <<<<<<<<<<<<<<
 * 				rna_read = &(rna_plp[0][i])
 * 				rna_aln = rna_read.b
 */
      __pyx_t_7 = __pyx_v_n;
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {

        /* "SomVarIUS_calling.pyx":443
 * 		if rna_pos == pos:
 * 			for i from 0<=i < n:
 * 				rna_read = &(rna_plp[0][i])             # <<<<<<<<<<<<<<
 * 				rna_aln = rna_read.b
 * 				rna_alnbase = _get_seq_base(rna_aln, rna_read.qpos)
 */
        __pyx_v_rna_read = (&((__pyx_v_rna_plp[0])[__pyx_v_i]));

        /* "SomVarIUS_calling.pyx":444
 * 			for i from 0<=i < n:
 * 				rna_read = &(rna_plp[0][i])
 * 				rna_aln = rna_read.b             # <<<<<<<<<<<<<<
 * 				rna_alnbase = _get_seq_base(rna_aln, rna_read.qpos)
 * 				if rna_alnbase == alt_allele:
 */
        __pyx_t_10 = __pyx_v_rna_read->b;
        __pyx_v_rna_aln = __pyx_t_10;

        /* "SomVarIUS_calling.pyx":445
 * 				rna_read = &(rna_plp[0][i])
 * 				rna_aln = rna_read.b
 * 				rna_alnbase = _get_seq_base(rna_aln, rna_read.qpos)             # <<<<<<<<<<<<<<
 * 				if rna_alnbase == alt_allele:
 * 					rna_seq_support =  1
 */
        __pyx_t_3 = __pyx_f_17SomVarIUS_calling__get_seq_base(__pyx_v_rna_aln, __pyx_v_rna_read->qpos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XDECREF_SET(__pyx_v_rna_alnbase, ((PyObject*)__pyx_t_3));
        __pyx_t_3 = 0;

        /* "SomVarIUS_calling.pyx":446
 * 				rna_aln = rna_read.b
 * 				rna_alnbase = _get_seq_base(rna_aln, rna_read.qpos)
 * 				if rna_alnbase == alt_allele:             # <<<<<<<<<<<<<<
 * 					rna_seq_support =  1
 * 				else:
 */
        __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_rna_alnbase, __pyx_v_alt_allele, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_11 = (__pyx_t_9 != 0);
        if (__pyx_t_11) {

          /* "SomVarIUS_calling.pyx":447
 * 				rna_alnbase = _get_seq_base(rna_aln, rna_read.qpos)
 * 				if rna_alnbase == alt_allele:
 * 					rna_seq_support =  1             # <<<<<<<<<<<<<<
 * 				else:
 * 					rna_seq_support =  0
 */
          __pyx_v_rna_seq_support = 1.0;
          goto __pyx_L8;
        }
        /*else*/ {

          /* "SomVarIUS_calling.pyx":449
 * 					rna_seq_support =  1
 * 				else:
 * 					rna_seq_support =  0             # <<<<<<<<<<<<<<
 * 			return rna_seq_support
 * 	return rna_seq_support
 */
          __pyx_v_rna_seq_support = 0.0;
        }
        __pyx_L8:;
      }

      /* "SomVarIUS_calling.pyx":450
 * 				else:
 * 					rna_seq_support =  0
 * 			return rna_seq_support             # <<<<<<<<<<<<<<
 * 	return rna_seq_support
 * 
 */
      __pyx_r = __pyx_v_rna_seq_support;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L0;
    }

    /* "SomVarIUS_calling.pyx":436
 * 	it = rna_seq_file.pileup(reference=chrom, start=pos, end=pos+1,
 * 						truncate=False, max_depth=8000)
 * 	for col in it:             # <<<<<<<<<<<<<<
 * 		# initialise variables
 * 		n = col.n
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "SomVarIUS_calling.pyx":451
 * 					rna_seq_support =  0
 * 			return rna_seq_support
 * 	return rna_seq_support             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_rna_seq_support;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":423
 * 
 * 
 * cdef inline double rna_seq_filter(str chrom, int pos, str alt_allele, Samfile rna_seq_file):             # <<<<<<<<<<<<<<
 * 	cdef double rna_seq_support = float("NaN")
 * 	cdef bam_pileup1_t ** rna_plp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("SomVarIUS_calling.rna_seq_filter", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_rna_alnbase);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":454
 * 
 * 
 * cdef int hapmap_filter(str chrom, int pos, hapmap_record):             # <<<<<<<<<<<<<<
 * 	cdef int hapmap_present = 0
 * 	hapmap_present = 0
 */

static int __pyx_f_17SomVarIUS_calling_hapmap_filter(PyObject *__pyx_v_chrom, int __pyx_v_pos, PyObject *__pyx_v_hapmap_record) {
  int __pyx_v_hapmap_present;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hapmap_filter", 0);

  /* "SomVarIUS_calling.pyx":455
 * 
 * cdef int hapmap_filter(str chrom, int pos, hapmap_record):
 * 	cdef int hapmap_present = 0             # <<<<<<<<<<<<<<
 * 	hapmap_present = 0
 * 	try:
 */
  __pyx_v_hapmap_present = 0;

  /* "SomVarIUS_calling.pyx":456
 * cdef int hapmap_filter(str chrom, int pos, hapmap_record):
 * 	cdef int hapmap_present = 0
 * 	hapmap_present = 0             # <<<<<<<<<<<<<<
 * 	try:
 * 		hapmap_present = hapmap_record[chrom][pos]
 */
  __pyx_v_hapmap_present = 0;

  /* "SomVarIUS_calling.pyx":457
 * 	cdef int hapmap_present = 0
 * 	hapmap_present = 0
 * 	try:             # <<<<<<<<<<<<<<
 * 		hapmap_present = hapmap_record[chrom][pos]
 * 	except:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "SomVarIUS_calling.pyx":458
 * 	hapmap_present = 0
 * 	try:
 * 		hapmap_present = hapmap_record[chrom][pos]             # <<<<<<<<<<<<<<
 * 	except:
 * 		pass
 */
      __pyx_t_4 = PyObject_GetItem(__pyx_v_hapmap_record, __pyx_v_chrom); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;};
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_pos, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;};
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_hapmap_present = __pyx_t_6;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "SomVarIUS_calling.pyx":459
 * 	try:
 * 		hapmap_present = hapmap_record[chrom][pos]
 * 	except:             # <<<<<<<<<<<<<<
 * 		pass
 * 	return hapmap_present
 */
    /*except:*/ {
      PyErr_Restore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

  /* "SomVarIUS_calling.pyx":461
 * 	except:
 * 		pass
 * 	return hapmap_present             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_hapmap_present;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":454
 * 
 * 
 * cdef int hapmap_filter(str chrom, int pos, hapmap_record):             # <<<<<<<<<<<<<<
 * 	cdef int hapmap_present = 0
 * 	hapmap_present = 0
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":464
 * 
 * 
 * cdef inline tuple get_highest(int A,int T,int G,int C):             # <<<<<<<<<<<<<<
 * 
 * 	cdef str lA, lT, lG, lC
 */

static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling_get_highest(int __pyx_v_A, int __pyx_v_T, int __pyx_v_G, int __pyx_v_C) {
  PyObject *__pyx_v_lA = 0;
  PyObject *__pyx_v_lT = 0;
  PyObject *__pyx_v_lG = 0;
  PyObject *__pyx_v_lC = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_highest", 0);

  /* "SomVarIUS_calling.pyx":468
 * 	cdef str lA, lT, lG, lC
 * 
 * 	lA, lT, lG, lC = "A", "T", "G", "C"             # <<<<<<<<<<<<<<
 * 	if A < T:
 * 		A,T,lA,lT = T,A,lT,lA
 */
  __pyx_t_1 = __pyx_n_s_A;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_n_s_T;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_n_s_G;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = __pyx_n_s_C;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_lA = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_lT = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_v_lG = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_v_lC = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "SomVarIUS_calling.pyx":469
 * 
 * 	lA, lT, lG, lC = "A", "T", "G", "C"
 * 	if A < T:             # <<<<<<<<<<<<<<
 * 		A,T,lA,lT = T,A,lT,lA
 * 	if G < C:
 */
  __pyx_t_5 = ((__pyx_v_A < __pyx_v_T) != 0);
  if (__pyx_t_5) {

    /* "SomVarIUS_calling.pyx":470
 * 	lA, lT, lG, lC = "A", "T", "G", "C"
 * 	if A < T:
 * 		A,T,lA,lT = T,A,lT,lA             # <<<<<<<<<<<<<<
 * 	if G < C:
 * 		G,C,lG,lC = C,G,lC,lG
 */
    __pyx_t_6 = __pyx_v_T;
    __pyx_t_7 = __pyx_v_A;
    __pyx_t_4 = __pyx_v_lT;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_v_lA;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_A = __pyx_t_6;
    __pyx_v_T = __pyx_t_7;
    __Pyx_DECREF_SET(__pyx_v_lA, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_lT, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "SomVarIUS_calling.pyx":471
 * 	if A < T:
 * 		A,T,lA,lT = T,A,lT,lA
 * 	if G < C:             # <<<<<<<<<<<<<<
 * 		G,C,lG,lC = C,G,lC,lG
 * 	if A < G:
 */
  __pyx_t_5 = ((__pyx_v_G < __pyx_v_C) != 0);
  if (__pyx_t_5) {

    /* "SomVarIUS_calling.pyx":472
 * 		A,T,lA,lT = T,A,lT,lA
 * 	if G < C:
 * 		G,C,lG,lC = C,G,lC,lG             # <<<<<<<<<<<<<<
 * 	if A < G:
 * 		A,G,lA,lG = G,A,lG,lA
 */
    __pyx_t_7 = __pyx_v_C;
    __pyx_t_6 = __pyx_v_G;
    __pyx_t_3 = __pyx_v_lC;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_v_lG;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_G = __pyx_t_7;
    __pyx_v_C = __pyx_t_6;
    __Pyx_DECREF_SET(__pyx_v_lG, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_lC, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "SomVarIUS_calling.pyx":473
 * 	if G < C:
 * 		G,C,lG,lC = C,G,lC,lG
 * 	if A < G:             # <<<<<<<<<<<<<<
 * 		A,G,lA,lG = G,A,lG,lA
 * 	if T < C:
 */
  __pyx_t_5 = ((__pyx_v_A < __pyx_v_G) != 0);
  if (__pyx_t_5) {

    /* "SomVarIUS_calling.pyx":474
 * 		G,C,lG,lC = C,G,lC,lG
 * 	if A < G:
 * 		A,G,lA,lG = G,A,lG,lA             # <<<<<<<<<<<<<<
 * 	if T < C:
 * 		T,C,lT,lC = C,T,lC,lT
 */
    __pyx_t_6 = __pyx_v_G;
    __pyx_t_7 = __pyx_v_A;
    __pyx_t_4 = __pyx_v_lG;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_v_lA;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_A = __pyx_t_6;
    __pyx_v_G = __pyx_t_7;
    __Pyx_DECREF_SET(__pyx_v_lA, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_lG, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "SomVarIUS_calling.pyx":475
 * 	if A < G:
 * 		A,G,lA,lG = G,A,lG,lA
 * 	if T < C:             # <<<<<<<<<<<<<<
 * 		T,C,lT,lC = C,T,lC,lT
 * 	if T < G:
 */
  __pyx_t_5 = ((__pyx_v_T < __pyx_v_C) != 0);
  if (__pyx_t_5) {

    /* "SomVarIUS_calling.pyx":476
 * 		A,G,lA,lG = G,A,lG,lA
 * 	if T < C:
 * 		T,C,lT,lC = C,T,lC,lT             # <<<<<<<<<<<<<<
 * 	if T < G:
 * 		T,G,lT,lG = G,T,lG,lT
 */
    __pyx_t_7 = __pyx_v_C;
    __pyx_t_6 = __pyx_v_T;
    __pyx_t_3 = __pyx_v_lC;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_v_lT;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_T = __pyx_t_7;
    __pyx_v_C = __pyx_t_6;
    __Pyx_DECREF_SET(__pyx_v_lT, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_lC, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "SomVarIUS_calling.pyx":477
 * 	if T < C:
 * 		T,C,lT,lC = C,T,lC,lT
 * 	if T < G:             # <<<<<<<<<<<<<<
 * 		T,G,lT,lG = G,T,lG,lT
 * 	return (A,T,G,C), (lA,lT,lG,lC)
 */
  __pyx_t_5 = ((__pyx_v_T < __pyx_v_G) != 0);
  if (__pyx_t_5) {

    /* "SomVarIUS_calling.pyx":478
 * 		T,C,lT,lC = C,T,lC,lT
 * 	if T < G:
 * 		T,G,lT,lG = G,T,lG,lT             # <<<<<<<<<<<<<<
 * 	return (A,T,G,C), (lA,lT,lG,lC)
 * 
 */
    __pyx_t_6 = __pyx_v_G;
    __pyx_t_7 = __pyx_v_T;
    __pyx_t_4 = __pyx_v_lG;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_3 = __pyx_v_lT;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_T = __pyx_t_6;
    __pyx_v_G = __pyx_t_7;
    __Pyx_DECREF_SET(__pyx_v_lT, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_lG, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "SomVarIUS_calling.pyx":479
 * 	if T < G:
 * 		T,G,lT,lG = G,T,lG,lT
 * 	return (A,T,G,C), (lA,lT,lG,lC)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_A); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_T); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_G); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_C); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_lA);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_lA);
  __Pyx_GIVEREF(__pyx_v_lA);
  __Pyx_INCREF(__pyx_v_lT);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_lT);
  __Pyx_GIVEREF(__pyx_v_lT);
  __Pyx_INCREF(__pyx_v_lG);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_lG);
  __Pyx_GIVEREF(__pyx_v_lG);
  __Pyx_INCREF(__pyx_v_lC);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_lC);
  __Pyx_GIVEREF(__pyx_v_lC);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_8 = 0;
  __pyx_t_1 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":464
 * 
 * 
 * cdef inline tuple get_highest(int A,int T,int G,int C):             # <<<<<<<<<<<<<<
 * 
 * 	cdef str lA, lT, lG, lC
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("SomVarIUS_calling.get_highest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lA);
  __Pyx_XDECREF(__pyx_v_lT);
  __Pyx_XDECREF(__pyx_v_lG);
  __Pyx_XDECREF(__pyx_v_lC);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":482
 * 
 * 
 * cdef dict samfile_ref_dicts(samfile_refs, other_refs):             # <<<<<<<<<<<<<<
 * 	cdef str ref
 * 	cdef dict samfile_to_other_ref={}
 */

static PyObject *__pyx_f_17SomVarIUS_calling_samfile_ref_dicts(PyObject *__pyx_v_samfile_refs, PyObject *__pyx_v_other_refs) {
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_samfile_to_other_ref = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("samfile_ref_dicts", 0);

  /* "SomVarIUS_calling.pyx":484
 * cdef dict samfile_ref_dicts(samfile_refs, other_refs):
 * 	cdef str ref
 * 	cdef dict samfile_to_other_ref={}             # <<<<<<<<<<<<<<
 * 	for ref in samfile_refs:
 * 		if "chr"+ref in other_refs:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_samfile_to_other_ref = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":485
 * 	cdef str ref
 * 	cdef dict samfile_to_other_ref={}
 * 	for ref in samfile_refs:             # <<<<<<<<<<<<<<
 * 		if "chr"+ref in other_refs:
 * 			samfile_to_other_ref[ref]="chr"+ref
 */
  if (likely(PyList_CheckExact(__pyx_v_samfile_refs)) || PyTuple_CheckExact(__pyx_v_samfile_refs)) {
    __pyx_t_1 = __pyx_v_samfile_refs; __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_samfile_refs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(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 = 485; __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 = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        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 = 485; __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 = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_ref, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "SomVarIUS_calling.pyx":486
 * 	cdef dict samfile_to_other_ref={}
 * 	for ref in samfile_refs:
 * 		if "chr"+ref in other_refs:             # <<<<<<<<<<<<<<
 * 			samfile_to_other_ref[ref]="chr"+ref
 * 		elif ref[3:] in other_refs:
 */
    __pyx_t_4 = PyNumber_Add(__pyx_n_s_chr, __pyx_v_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_t_4, __pyx_v_other_refs, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "SomVarIUS_calling.pyx":487
 * 	for ref in samfile_refs:
 * 		if "chr"+ref in other_refs:
 * 			samfile_to_other_ref[ref]="chr"+ref             # <<<<<<<<<<<<<<
 * 		elif ref[3:] in other_refs:
 * 			samfile_to_other_ref[ref]=ref[3:]
 */
      __pyx_t_4 = PyNumber_Add(__pyx_n_s_chr, __pyx_v_ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(PyDict_SetItem(__pyx_v_samfile_to_other_ref, __pyx_v_ref, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L5;
    }

    /* "SomVarIUS_calling.pyx":488
 * 		if "chr"+ref in other_refs:
 * 			samfile_to_other_ref[ref]="chr"+ref
 * 		elif ref[3:] in other_refs:             # <<<<<<<<<<<<<<
 * 			samfile_to_other_ref[ref]=ref[3:]
 * 		else:
 */
    if (unlikely(__pyx_v_ref == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = PySequence_GetSlice(__pyx_v_ref, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_t_4, __pyx_v_other_refs, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (__pyx_t_5) {

      /* "SomVarIUS_calling.pyx":489
 * 			samfile_to_other_ref[ref]="chr"+ref
 * 		elif ref[3:] in other_refs:
 * 			samfile_to_other_ref[ref]=ref[3:]             # <<<<<<<<<<<<<<
 * 		else:
 * 			samfile_to_other_ref[ref]=ref
 */
      if (unlikely(__pyx_v_ref == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = PySequence_GetSlice(__pyx_v_ref, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(PyDict_SetItem(__pyx_v_samfile_to_other_ref, __pyx_v_ref, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "SomVarIUS_calling.pyx":491
 * 			samfile_to_other_ref[ref]=ref[3:]
 * 		else:
 * 			samfile_to_other_ref[ref]=ref             # <<<<<<<<<<<<<<
 * 	return samfile_to_other_ref
 * 
 */
      if (unlikely(PyDict_SetItem(__pyx_v_samfile_to_other_ref, __pyx_v_ref, __pyx_v_ref) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L5:;

    /* "SomVarIUS_calling.pyx":485
 * 	cdef str ref
 * 	cdef dict samfile_to_other_ref={}
 * 	for ref in samfile_refs:             # <<<<<<<<<<<<<<
 * 		if "chr"+ref in other_refs:
 * 			samfile_to_other_ref[ref]="chr"+ref
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":492
 * 		else:
 * 			samfile_to_other_ref[ref]=ref
 * 	return samfile_to_other_ref             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_samfile_to_other_ref);
  __pyx_r = __pyx_v_samfile_to_other_ref;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":482
 * 
 * 
 * cdef dict samfile_ref_dicts(samfile_refs, other_refs):             # <<<<<<<<<<<<<<
 * 	cdef str ref
 * 	cdef dict samfile_to_other_ref={}
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("SomVarIUS_calling.samfile_ref_dicts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ref);
  __Pyx_XDECREF(__pyx_v_samfile_to_other_ref);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_17SomVarIUS_calling_4generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "SomVarIUS_calling.pyx":495
 * 
 * 
 * def write_mutations(str out_file, str samfile_name, str fafile_name,             # <<<<<<<<<<<<<<
 * 						  str rna_seq_file_name='', str hapmap_file='',
 *                           int min_reads=10, int min_support=4, double min_af=0.05,
 */

/* Python wrapper */
static PyObject *__pyx_pw_17SomVarIUS_calling_3write_mutations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_17SomVarIUS_calling_2write_mutations[] = "write_mutations(str out_file, str samfile_name, str fafile_name, str rna_seq_file_name='', str hapmap_file='', int min_reads=10, int min_support=4, double min_af=0.05, double min_pvalue=0.0001, double min_f_r=0.05, bool rna_filter=False, bool hap_filter=False, int min_qual=25, double min_se=0.999, double min_hetero=0.95, bool ref_filter=False, uint64_t min_mapq=55, str dbsnp_bed_name='', str copy_bed_name='', bool binom=False, region_chrom=None, region_start=None, region_end=None, int min_baseq=13, str dist='')";
static PyMethodDef __pyx_mdef_17SomVarIUS_calling_3write_mutations = {"write_mutations", (PyCFunction)__pyx_pw_17SomVarIUS_calling_3write_mutations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17SomVarIUS_calling_2write_mutations};
static PyObject *__pyx_pw_17SomVarIUS_calling_3write_mutations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_out_file = 0;
  PyObject *__pyx_v_samfile_name = 0;
  PyObject *__pyx_v_fafile_name = 0;
  PyObject *__pyx_v_rna_seq_file_name = 0;
  PyObject *__pyx_v_hapmap_file = 0;
  int __pyx_v_min_reads;
  int __pyx_v_min_support;
  double __pyx_v_min_af;
  double __pyx_v_min_pvalue;
  double __pyx_v_min_f_r;
  int __pyx_v_rna_filter;
  int __pyx_v_hap_filter;
  int __pyx_v_min_qual;
  double __pyx_v_min_se;
  double __pyx_v_min_hetero;
  int __pyx_v_ref_filter;
  uint64_t __pyx_v_min_mapq;
  PyObject *__pyx_v_dbsnp_bed_name = 0;
  PyObject *__pyx_v_copy_bed_name = 0;
  int __pyx_v_binom;
  PyObject *__pyx_v_region_chrom = 0;
  PyObject *__pyx_v_region_start = 0;
  PyObject *__pyx_v_region_end = 0;
  int __pyx_v_min_baseq;
  PyObject *__pyx_v_dist = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_mutations (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_out_file,&__pyx_n_s_samfile_name,&__pyx_n_s_fafile_name,&__pyx_n_s_rna_seq_file_name,&__pyx_n_s_hapmap_file,&__pyx_n_s_min_reads,&__pyx_n_s_min_support,&__pyx_n_s_min_af,&__pyx_n_s_min_pvalue,&__pyx_n_s_min_f_r,&__pyx_n_s_rna_filter,&__pyx_n_s_hap_filter,&__pyx_n_s_min_qual,&__pyx_n_s_min_se,&__pyx_n_s_min_hetero,&__pyx_n_s_ref_filter,&__pyx_n_s_min_mapq,&__pyx_n_s_dbsnp_bed_name,&__pyx_n_s_copy_bed_name,&__pyx_n_s_binom,&__pyx_n_s_region_chrom,&__pyx_n_s_region_start,&__pyx_n_s_region_end,&__pyx_n_s_min_baseq,&__pyx_n_s_dist,0};
    PyObject* values[25] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
    values[3] = ((PyObject*)__pyx_kp_s__6);
    values[4] = ((PyObject*)__pyx_kp_s__6);
    values[17] = ((PyObject*)__pyx_kp_s__6);
    values[18] = ((PyObject*)__pyx_kp_s__6);

    /* "SomVarIUS_calling.pyx":504
 * 						  uint64_t min_mapq=55, str dbsnp_bed_name='',
 * 						  str copy_bed_name='', bint binom=False,
 * 						  region_chrom=None, region_start=None, region_end=None,             # <<<<<<<<<<<<<<
 * 						  int min_baseq=13, str dist=''):
 * 
 */
    values[20] = ((PyObject *)Py_None);
    values[21] = ((PyObject *)Py_None);
    values[22] = ((PyObject *)Py_None);
    values[24] = ((PyObject*)__pyx_kp_s__6);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
        case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
        case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
        case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
        case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_out_file)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_samfile_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_mutations", 0, 3, 25, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fafile_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("write_mutations", 0, 3, 25, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rna_seq_file_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hapmap_file);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_reads);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_support);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_af);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_pvalue);
          if (value) { values[8] = value; kw_args--; }
        }
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_f_r);
          if (value) { values[9] = value; kw_args--; }
        }
        case 10:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rna_filter);
          if (value) { values[10] = value; kw_args--; }
        }
        case 11:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hap_filter);
          if (value) { values[11] = value; kw_args--; }
        }
        case 12:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_qual);
          if (value) { values[12] = value; kw_args--; }
        }
        case 13:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_se);
          if (value) { values[13] = value; kw_args--; }
        }
        case 14:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_hetero);
          if (value) { values[14] = value; kw_args--; }
        }
        case 15:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref_filter);
          if (value) { values[15] = value; kw_args--; }
        }
        case 16:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_mapq);
          if (value) { values[16] = value; kw_args--; }
        }
        case 17:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dbsnp_bed_name);
          if (value) { values[17] = value; kw_args--; }
        }
        case 18:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_copy_bed_name);
          if (value) { values[18] = value; kw_args--; }
        }
        case 19:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_binom);
          if (value) { values[19] = value; kw_args--; }
        }
        case 20:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region_chrom);
          if (value) { values[20] = value; kw_args--; }
        }
        case 21:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region_start);
          if (value) { values[21] = value; kw_args--; }
        }
        case 22:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_region_end);
          if (value) { values[22] = value; kw_args--; }
        }
        case 23:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_baseq);
          if (value) { values[23] = value; kw_args--; }
        }
        case 24:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dist);
          if (value) { values[24] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_mutations") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
        case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
        case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
        case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
        case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
        case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
        case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
        case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
        case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
        case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
        case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
        case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
        case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_out_file = ((PyObject*)values[0]);
    __pyx_v_samfile_name = ((PyObject*)values[1]);
    __pyx_v_fafile_name = ((PyObject*)values[2]);
    __pyx_v_rna_seq_file_name = ((PyObject*)values[3]);
    __pyx_v_hapmap_file = ((PyObject*)values[4]);
    if (values[5]) {
      __pyx_v_min_reads = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_min_reads == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_reads = ((int)10);
    }
    if (values[6]) {
      __pyx_v_min_support = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_min_support == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_support = ((int)4);
    }
    if (values[7]) {
      __pyx_v_min_af = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_min_af == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_af = ((double)0.05);
    }
    if (values[8]) {
      __pyx_v_min_pvalue = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_min_pvalue == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_pvalue = ((double)0.0001);
    }
    if (values[9]) {
      __pyx_v_min_f_r = __pyx_PyFloat_AsDouble(values[9]); if (unlikely((__pyx_v_min_f_r == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_f_r = ((double)0.05);
    }
    if (values[10]) {
      __pyx_v_rna_filter = __Pyx_PyObject_IsTrue(values[10]); if (unlikely((__pyx_v_rna_filter == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "SomVarIUS_calling.pyx":499
 *                           int min_reads=10, int min_support=4, double min_af=0.05,
 * 						  double min_pvalue=0.0001, double min_f_r=0.05,
 * 						  bint rna_filter=False, bint hap_filter=False,             # <<<<<<<<<<<<<<
 * 						  int min_qual=25, double min_se=0.999,
 * 						  double min_hetero=0.95, bint ref_filter=False,
 */
      __pyx_v_rna_filter = ((int)0);
    }
    if (values[11]) {
      __pyx_v_hap_filter = __Pyx_PyObject_IsTrue(values[11]); if (unlikely((__pyx_v_hap_filter == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_hap_filter = ((int)0);
    }
    if (values[12]) {
      __pyx_v_min_qual = __Pyx_PyInt_As_int(values[12]); if (unlikely((__pyx_v_min_qual == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_qual = ((int)25);
    }
    if (values[13]) {
      __pyx_v_min_se = __pyx_PyFloat_AsDouble(values[13]); if (unlikely((__pyx_v_min_se == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_se = ((double)0.999);
    }
    if (values[14]) {
      __pyx_v_min_hetero = __pyx_PyFloat_AsDouble(values[14]); if (unlikely((__pyx_v_min_hetero == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_hetero = ((double)0.95);
    }
    if (values[15]) {
      __pyx_v_ref_filter = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_ref_filter == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "SomVarIUS_calling.pyx":501
 * 						  bint rna_filter=False, bint hap_filter=False,
 * 						  int min_qual=25, double min_se=0.999,
 * 						  double min_hetero=0.95, bint ref_filter=False,             # <<<<<<<<<<<<<<
 * 						  uint64_t min_mapq=55, str dbsnp_bed_name='',
 * 						  str copy_bed_name='', bint binom=False,
 */
      __pyx_v_ref_filter = ((int)0);
    }
    if (values[16]) {
      __pyx_v_min_mapq = __Pyx_PyInt_As_uint64_t(values[16]); if (unlikely((__pyx_v_min_mapq == (uint64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_mapq = ((uint64_t)55);
    }
    __pyx_v_dbsnp_bed_name = ((PyObject*)values[17]);
    __pyx_v_copy_bed_name = ((PyObject*)values[18]);
    if (values[19]) {
      __pyx_v_binom = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_binom == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {

      /* "SomVarIUS_calling.pyx":503
 * 						  double min_hetero=0.95, bint ref_filter=False,
 * 						  uint64_t min_mapq=55, str dbsnp_bed_name='',
 * 						  str copy_bed_name='', bint binom=False,             # <<<<<<<<<<<<<<
 * 						  region_chrom=None, region_start=None, region_end=None,
 * 						  int min_baseq=13, str dist=''):
 */
      __pyx_v_binom = ((int)0);
    }
    __pyx_v_region_chrom = values[20];
    __pyx_v_region_start = values[21];
    __pyx_v_region_end = values[22];
    if (values[23]) {
      __pyx_v_min_baseq = __Pyx_PyInt_As_int(values[23]); if (unlikely((__pyx_v_min_baseq == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_min_baseq = ((int)13);
    }
    __pyx_v_dist = ((PyObject*)values[24]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_mutations", 0, 3, 25, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("SomVarIUS_calling.write_mutations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_file), (&PyString_Type), 1, "out_file", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_samfile_name), (&PyString_Type), 1, "samfile_name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fafile_name), (&PyString_Type), 1, "fafile_name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rna_seq_file_name), (&PyString_Type), 1, "rna_seq_file_name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_hapmap_file), (&PyString_Type), 1, "hapmap_file", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dbsnp_bed_name), (&PyString_Type), 1, "dbsnp_bed_name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_copy_bed_name), (&PyString_Type), 1, "copy_bed_name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dist), (&PyString_Type), 1, "dist", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_17SomVarIUS_calling_2write_mutations(__pyx_self, __pyx_v_out_file, __pyx_v_samfile_name, __pyx_v_fafile_name, __pyx_v_rna_seq_file_name, __pyx_v_hapmap_file, __pyx_v_min_reads, __pyx_v_min_support, __pyx_v_min_af, __pyx_v_min_pvalue, __pyx_v_min_f_r, __pyx_v_rna_filter, __pyx_v_hap_filter, __pyx_v_min_qual, __pyx_v_min_se, __pyx_v_min_hetero, __pyx_v_ref_filter, __pyx_v_min_mapq, __pyx_v_dbsnp_bed_name, __pyx_v_copy_bed_name, __pyx_v_binom, __pyx_v_region_chrom, __pyx_v_region_start, __pyx_v_region_end, __pyx_v_min_baseq, __pyx_v_dist);

  /* "SomVarIUS_calling.pyx":495
 * 
 * 
 * def write_mutations(str out_file, str samfile_name, str fafile_name,             # <<<<<<<<<<<<<<
 * 						  str rna_seq_file_name='', str hapmap_file='',
 *                           int min_reads=10, int min_support=4, double min_af=0.05,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_17SomVarIUS_calling_2write_mutations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_out_file, PyObject *__pyx_v_samfile_name, PyObject *__pyx_v_fafile_name, PyObject *__pyx_v_rna_seq_file_name, PyObject *__pyx_v_hapmap_file, int __pyx_v_min_reads, int __pyx_v_min_support, double __pyx_v_min_af, double __pyx_v_min_pvalue, double __pyx_v_min_f_r, int __pyx_v_rna_filter, int __pyx_v_hap_filter, int __pyx_v_min_qual, double __pyx_v_min_se, double __pyx_v_min_hetero, int __pyx_v_ref_filter, uint64_t __pyx_v_min_mapq, PyObject *__pyx_v_dbsnp_bed_name, PyObject *__pyx_v_copy_bed_name, int __pyx_v_binom, PyObject *__pyx_v_region_chrom, PyObject *__pyx_v_region_start, PyObject *__pyx_v_region_end, int __pyx_v_min_baseq, PyObject *__pyx_v_dist) {
  struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_mutations", 0);
  __pyx_cur_scope = (struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *)__pyx_tp_new_17SomVarIUS_calling___pyx_scope_struct__write_mutations(__pyx_ptype_17SomVarIUS_calling___pyx_scope_struct__write_mutations, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_out_file = __pyx_v_out_file;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_out_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_out_file);
  __pyx_cur_scope->__pyx_v_samfile_name = __pyx_v_samfile_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_samfile_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_samfile_name);
  __pyx_cur_scope->__pyx_v_fafile_name = __pyx_v_fafile_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fafile_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fafile_name);
  __pyx_cur_scope->__pyx_v_rna_seq_file_name = __pyx_v_rna_seq_file_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_rna_seq_file_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_rna_seq_file_name);
  __pyx_cur_scope->__pyx_v_hapmap_file = __pyx_v_hapmap_file;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hapmap_file);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hapmap_file);
  __pyx_cur_scope->__pyx_v_min_reads = __pyx_v_min_reads;
  __pyx_cur_scope->__pyx_v_min_support = __pyx_v_min_support;
  __pyx_cur_scope->__pyx_v_min_af = __pyx_v_min_af;
  __pyx_cur_scope->__pyx_v_min_pvalue = __pyx_v_min_pvalue;
  __pyx_cur_scope->__pyx_v_min_f_r = __pyx_v_min_f_r;
  __pyx_cur_scope->__pyx_v_rna_filter = __pyx_v_rna_filter;
  __pyx_cur_scope->__pyx_v_hap_filter = __pyx_v_hap_filter;
  __pyx_cur_scope->__pyx_v_min_qual = __pyx_v_min_qual;
  __pyx_cur_scope->__pyx_v_min_se = __pyx_v_min_se;
  __pyx_cur_scope->__pyx_v_min_hetero = __pyx_v_min_hetero;
  __pyx_cur_scope->__pyx_v_ref_filter = __pyx_v_ref_filter;
  __pyx_cur_scope->__pyx_v_min_mapq = __pyx_v_min_mapq;
  __pyx_cur_scope->__pyx_v_dbsnp_bed_name = __pyx_v_dbsnp_bed_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dbsnp_bed_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dbsnp_bed_name);
  __pyx_cur_scope->__pyx_v_copy_bed_name = __pyx_v_copy_bed_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_copy_bed_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_copy_bed_name);
  __pyx_cur_scope->__pyx_v_binom = __pyx_v_binom;
  __pyx_cur_scope->__pyx_v_region_chrom = __pyx_v_region_chrom;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_region_chrom);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_region_chrom);
  __pyx_cur_scope->__pyx_v_region_start = __pyx_v_region_start;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_region_start);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_region_start);
  __pyx_cur_scope->__pyx_v_region_end = __pyx_v_region_end;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_region_end);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_region_end);
  __pyx_cur_scope->__pyx_v_min_baseq = __pyx_v_min_baseq;
  __pyx_cur_scope->__pyx_v_dist = __pyx_v_dist;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dist);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dist);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_17SomVarIUS_calling_4generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_write_mutations, __pyx_n_s_write_mutations); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("SomVarIUS_calling.write_mutations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_17SomVarIUS_calling_4generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *__pyx_cur_scope = ((struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  bam_pileup1_t **__pyx_t_15;
  bam1_t *__pyx_t_16;
  uint16_t __pyx_t_17;
  uint8_t __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *(*__pyx_t_22)(PyObject *);
  int __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_t_25;
  int __pyx_t_26;
  long double __pyx_t_27;
  long double __pyx_t_28;
  long double __pyx_t_29;
  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_L84_resume_from_yield;
    case 2: goto __pyx_L85_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 = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":508
 * 
 * 	#out = open(out_file, mode='w')
 * 	fmt = '{chrom}\t{pos}\t.\t{refbase}\t{alt_allele}\t.\tPASS\t'             # <<<<<<<<<<<<<<
 * 	fmt+='NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_not_se};'
 * 	fmt+='GP={prob_not_hetero};DP={total_alleles};MQ={mean_mapq};BQ={mean_qual}\t'
 */
  __Pyx_INCREF(__pyx_kp_s_chrom_pos_refbase_alt_allele_PA);
  __Pyx_GIVEREF(__pyx_kp_s_chrom_pos_refbase_alt_allele_PA);
  __pyx_cur_scope->__pyx_v_fmt = __pyx_kp_s_chrom_pos_refbase_alt_allele_PA;

  /* "SomVarIUS_calling.pyx":509
 * 	#out = open(out_file, mode='w')
 * 	fmt = '{chrom}\t{pos}\t.\t{refbase}\t{alt_allele}\t.\tPASS\t'
 * 	fmt+='NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_not_se};'             # <<<<<<<<<<<<<<
 * 	fmt+='GP={prob_not_hetero};DP={total_alleles};MQ={mean_mapq};BQ={mean_qual}\t'
 * 	fmt+='GT:GQ:DP\t1|0:60:{total_alleles}\n'
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_fmt, __pyx_kp_s_NS_1_AF_alt_allele_freq_P_pvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_fmt);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fmt, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":510
 * 	fmt = '{chrom}\t{pos}\t.\t{refbase}\t{alt_allele}\t.\tPASS\t'
 * 	fmt+='NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_not_se};'
 * 	fmt+='GP={prob_not_hetero};DP={total_alleles};MQ={mean_mapq};BQ={mean_qual}\t'             # <<<<<<<<<<<<<<
 * 	fmt+='GT:GQ:DP\t1|0:60:{total_alleles}\n'
 * 
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_fmt, __pyx_kp_s_GP_prob_not_hetero_DP_total_alle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_fmt);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fmt, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":511
 * 	fmt+='NS=1;AF={alt_allele_freq};P={pvalue};SP={prob_not_se};'
 * 	fmt+='GP={prob_not_hetero};DP={total_alleles};MQ={mean_mapq};BQ={mean_qual}\t'
 * 	fmt+='GT:GQ:DP\t1|0:60:{total_alleles}\n'             # <<<<<<<<<<<<<<
 * 
 * 	#fmt='{chrom}\t{pos}\t{refbase}\t{maj_allele}\t{alt_allele}'
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_fmt, __pyx_kp_s_GT_GQ_DP_1_0_60_total_alleles); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_fmt);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fmt, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":519
 * 	cdef Samfile samfile
 * 	cdef Fastafile fafile
 * 	cdef dict ba_to_fa, ba_to_rna, ba_to_hapmap, ba_to_bed = {}             # <<<<<<<<<<<<<<
 * 	cdef set bed_chroms, seen_chroms = set()
 * 	cdef list copy_list
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ba_to_bed = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":520
 * 	cdef Fastafile fafile
 * 	cdef dict ba_to_fa, ba_to_rna, ba_to_hapmap, ba_to_bed = {}
 * 	cdef set bed_chroms, seen_chroms = set()             # <<<<<<<<<<<<<<
 * 	cdef list copy_list
 * 	cdef int copy_list_pos = 0
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_seen_chroms = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":522
 * 	cdef set bed_chroms, seen_chroms = set()
 * 	cdef list copy_list
 * 	cdef int copy_list_pos = 0             # <<<<<<<<<<<<<<
 * 	cdef bint in_copy = False
 * 	cdef str copy_chrom
 */
  __pyx_cur_scope->__pyx_v_copy_list_pos = 0;

  /* "SomVarIUS_calling.pyx":523
 * 	cdef list copy_list
 * 	cdef int copy_list_pos = 0
 * 	cdef bint in_copy = False             # <<<<<<<<<<<<<<
 * 	cdef str copy_chrom
 * 	cdef int copy_start, copy_end
 */
  __pyx_cur_scope->__pyx_v_in_copy = 0;

  /* "SomVarIUS_calling.pyx":527
 * 	cdef int copy_start, copy_end
 * 
 * 	samfile = Samfile(samfile_name)             # <<<<<<<<<<<<<<
 * 	fafile = Fastafile(fafile_name)
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_samfile_name);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_samfile_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_samfile_name);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_8csamfile_Samfile)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_samfile = ((struct __pyx_obj_5pysam_8csamfile_Samfile *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":528
 * 
 * 	samfile = Samfile(samfile_name)
 * 	fafile = Fastafile(fafile_name)             # <<<<<<<<<<<<<<
 * 
 * 	ba_to_fa = samfile_ref_dicts(samfile.references, fafile.references)
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fafile_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_fafile_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fafile_name);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_6cfaidx_Fastafile)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_fafile = ((struct __pyx_obj_5pysam_6cfaidx_Fastafile *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":530
 * 	fafile = Fastafile(fafile_name)
 * 
 * 	ba_to_fa = samfile_ref_dicts(samfile.references, fafile.references)             # <<<<<<<<<<<<<<
 * 
 * 	references = samfile.references
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_references); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_fafile), __pyx_n_s_references); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_17SomVarIUS_calling_samfile_ref_dicts(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_ba_to_fa = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "SomVarIUS_calling.pyx":532
 * 	ba_to_fa = samfile_ref_dicts(samfile.references, fafile.references)
 * 
 * 	references = samfile.references             # <<<<<<<<<<<<<<
 * 	lengths = samfile.lengths
 * 	genome = {references[ref]:lengths[ref] for ref in xrange(len(references))}
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_references); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_references = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "SomVarIUS_calling.pyx":533
 * 
 * 	references = samfile.references
 * 	lengths = samfile.lengths             # <<<<<<<<<<<<<<
 * 	genome = {references[ref]:lengths[ref] for ref in xrange(len(references))}
 * 	# if copy number file provided
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_lengths); 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_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_lengths = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "SomVarIUS_calling.pyx":534
 * 	references = samfile.references
 * 	lengths = samfile.lengths
 * 	genome = {references[ref]:lengths[ref] for ref in xrange(len(references))}             # <<<<<<<<<<<<<<
 * 	# if copy number file provided
 * 	if copy_bed_name != '':
 */
  { /* enter inner scope */
    Py_ssize_t __pyx_7genexpr__pyx_v_ref;
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Length(__pyx_cur_scope->__pyx_v_references); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_7genexpr__pyx_v_ref = __pyx_t_5;
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_references, __pyx_7genexpr__pyx_v_ref, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_lengths, __pyx_7genexpr__pyx_v_ref, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_2, (PyObject*)__pyx_t_1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
  } /* exit inner scope */
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_genome = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "SomVarIUS_calling.pyx":536
 * 	genome = {references[ref]:lengths[ref] for ref in xrange(len(references))}
 * 	# if copy number file provided
 * 	if copy_bed_name != '':             # <<<<<<<<<<<<<<
 * 		copy_filter = True
 * 		print 'storing dbsnp/copy number intersection in memory...'
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_copy_bed_name, __pyx_kp_s__6, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "SomVarIUS_calling.pyx":537
 * 	# if copy number file provided
 * 	if copy_bed_name != '':
 * 		copy_filter = True             # <<<<<<<<<<<<<<
 * 		print 'storing dbsnp/copy number intersection in memory...'
 * 		copy_regions = []
 */
    __pyx_cur_scope->__pyx_v_copy_filter = 1;

    /* "SomVarIUS_calling.pyx":538
 * 	if copy_bed_name != '':
 * 		copy_filter = True
 * 		print 'storing dbsnp/copy number intersection in memory...'             # <<<<<<<<<<<<<<
 * 		copy_regions = []
 * 		for line in open(copy_bed_name,'r'):
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_storing_dbsnp_copy_number_inters) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":539
 * 		copy_filter = True
 * 		print 'storing dbsnp/copy number intersection in memory...'
 * 		copy_regions = []             # <<<<<<<<<<<<<<
 * 		for line in open(copy_bed_name,'r'):
 * 			copy_regions.append(line.strip().split('\t'))
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_copy_regions = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "SomVarIUS_calling.pyx":540
 * 		print 'storing dbsnp/copy number intersection in memory...'
 * 		copy_regions = []
 * 		for line in open(copy_bed_name,'r'):             # <<<<<<<<<<<<<<
 * 			copy_regions.append(line.strip().split('\t'))
 * 		copy_record, bed_chroms = filter_regions(dbsnp_bed_name, copy_regions)
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_copy_bed_name);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_copy_bed_name);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_copy_bed_name);
    __Pyx_INCREF(__pyx_n_s_r);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_r);
    __Pyx_GIVEREF(__pyx_n_s_r);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_8(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;

      /* "SomVarIUS_calling.pyx":541
 * 		copy_regions = []
 * 		for line in open(copy_bed_name,'r'):
 * 			copy_regions.append(line.strip().split('\t'))             # <<<<<<<<<<<<<<
 * 		copy_record, bed_chroms = filter_regions(dbsnp_bed_name, copy_regions)
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_line, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_9) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_copy_regions, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "SomVarIUS_calling.pyx":540
 * 		print 'storing dbsnp/copy number intersection in memory...'
 * 		copy_regions = []
 * 		for line in open(copy_bed_name,'r'):             # <<<<<<<<<<<<<<
 * 			copy_regions.append(line.strip().split('\t'))
 * 		copy_record, bed_chroms = filter_regions(dbsnp_bed_name, copy_regions)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "SomVarIUS_calling.pyx":542
 * 		for line in open(copy_bed_name,'r'):
 * 			copy_regions.append(line.strip().split('\t'))
 * 		copy_record, bed_chroms = filter_regions(dbsnp_bed_name, copy_regions)             # <<<<<<<<<<<<<<
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)
 * 		print 'calculating allele frequency distribution...'
 */
    __pyx_t_3 = __pyx_f_17SomVarIUS_calling_filter_regions(__pyx_cur_scope->__pyx_v_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_copy_regions); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(__pyx_t_3 != Py_None)) {
      PyObject* sequence = __pyx_t_3;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(PySet_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_copy_record = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_bed_chroms = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":543
 * 			copy_regions.append(line.strip().split('\t'))
 * 		copy_record, bed_chroms = filter_regions(dbsnp_bed_name, copy_regions)
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)             # <<<<<<<<<<<<<<
 * 		print 'calculating allele frequency distribution...'
 * 		copy_list = get_dist(copy_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_references); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_17SomVarIUS_calling_samfile_ref_dicts(__pyx_t_3, __pyx_cur_scope->__pyx_v_bed_chroms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ba_to_bed);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ba_to_bed, ((PyObject*)__pyx_t_2));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":544
 * 		copy_record, bed_chroms = filter_regions(dbsnp_bed_name, copy_regions)
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)
 * 		print 'calculating allele frequency distribution...'             # <<<<<<<<<<<<<<
 * 		copy_list = get_dist(copy_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 * 		if dist != '':
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_calculating_allele_frequency_dis) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":545
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)
 * 		print 'calculating allele frequency distribution...'
 * 		copy_list = get_dist(copy_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)             # <<<<<<<<<<<<<<
 * 		if dist != '':
 * 			dist_out = open(dist,"w")
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_dist); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_copy_record);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_cur_scope->__pyx_v_copy_record);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_copy_record);
    __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ba_to_bed);
    PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_cur_scope->__pyx_v_ba_to_bed);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ba_to_bed);
    PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_genome);
    PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_cur_scope->__pyx_v_genome);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_genome);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_t_9 = 0;
    __pyx_t_11 = 0;
    __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_copy_bed, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (!(likely(PyList_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_9)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_cur_scope->__pyx_v_copy_list = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "SomVarIUS_calling.pyx":546
 * 		print 'calculating allele frequency distribution...'
 * 		copy_list = get_dist(copy_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 * 		if dist != '':             # <<<<<<<<<<<<<<
 * 			dist_out = open(dist,"w")
 * 			for line in copy_list:
 */
    __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_dist, __pyx_kp_s__6, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "SomVarIUS_calling.pyx":547
 * 		copy_list = get_dist(copy_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 * 		if dist != '':
 * 			dist_out = open(dist,"w")             # <<<<<<<<<<<<<<
 * 			for line in copy_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 */
      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dist);
      PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_cur_scope->__pyx_v_dist);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dist);
      __Pyx_INCREF(__pyx_n_s_w);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_w);
      __Pyx_GIVEREF(__pyx_n_s_w);
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GIVEREF(__pyx_t_11);
      __pyx_cur_scope->__pyx_v_dist_out = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "SomVarIUS_calling.pyx":548
 * 		if dist != '':
 * 			dist_out = open(dist,"w")
 * 			for line in copy_list:             # <<<<<<<<<<<<<<
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 		print 'done calculating copy number distributions'
 */
      if (unlikely(__pyx_cur_scope->__pyx_v_copy_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_11 = __pyx_cur_scope->__pyx_v_copy_list; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
      for (;;) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;

        /* "SomVarIUS_calling.pyx":549
 * 			dist_out = open(dist,"w")
 * 			for line in copy_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')             # <<<<<<<<<<<<<<
 * 		print 'done calculating copy number distributions'
 * 
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_dist_out, __pyx_n_s_write); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
        __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_line);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_line);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_line);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        if (!__pyx_t_2) {
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_9);
        } else {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "SomVarIUS_calling.pyx":548
 * 		if dist != '':
 * 			dist_out = open(dist,"w")
 * 			for line in copy_list:             # <<<<<<<<<<<<<<
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 		print 'done calculating copy number distributions'
 */
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "SomVarIUS_calling.pyx":550
 * 			for line in copy_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 		print 'done calculating copy number distributions'             # <<<<<<<<<<<<<<
 * 
 * 		del copy_record
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_done_calculating_copy_number_dis) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":552
 * 		print 'done calculating copy number distributions'
 * 
 * 		del copy_record             # <<<<<<<<<<<<<<
 * 		print 'storing chromosome/dbsnp intersection in memory...'
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)
 */
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_copy_record);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_copy_record);
    __pyx_cur_scope->__pyx_v_copy_record = NULL;

    /* "SomVarIUS_calling.pyx":553
 * 
 * 		del copy_record
 * 		print 'storing chromosome/dbsnp intersection in memory...'             # <<<<<<<<<<<<<<
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)
 * 		chrom_record, all_bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_storing_chromosome_dbsnp_interse) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":554
 * 		del copy_record
 * 		print 'storing chromosome/dbsnp intersection in memory...'
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)             # <<<<<<<<<<<<<<
 * 		chrom_record, all_bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)
 * 		print 'calculating chromosome allele frequency distribution...'
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_references); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_lengths); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = __pyx_f_17SomVarIUS_calling_generate_chrom_dist(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_cur_scope->__pyx_v_chrom_regions = ((PyObject*)__pyx_t_12);
    __pyx_t_12 = 0;

    /* "SomVarIUS_calling.pyx":555
 * 		print 'storing chromosome/dbsnp intersection in memory...'
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)
 * 		chrom_record, all_bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)             # <<<<<<<<<<<<<<
 * 		print 'calculating chromosome allele frequency distribution...'
 * 		chrom_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 */
    __pyx_t_12 = __pyx_f_17SomVarIUS_calling_filter_regions(__pyx_cur_scope->__pyx_v_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_chrom_regions); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (likely(__pyx_t_12 != Py_None)) {
      PyObject* sequence = __pyx_t_12;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_11);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      #endif
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_cur_scope->__pyx_v_chrom_record = __pyx_t_9;
    __pyx_t_9 = 0;
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_cur_scope->__pyx_v_all_bed_chroms = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "SomVarIUS_calling.pyx":556
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)
 * 		chrom_record, all_bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)
 * 		print 'calculating chromosome allele frequency distribution...'             # <<<<<<<<<<<<<<
 * 		chrom_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 * 		if dist != '':
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_calculating_chromosome_allele_fr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":557
 * 		chrom_record, all_bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)
 * 		print 'calculating chromosome allele frequency distribution...'
 * 		chrom_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)             # <<<<<<<<<<<<<<
 * 		if dist != '':
 * 			for line in chrom_list:
 */
    __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_dist); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_chrom_record);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_chrom_record);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_chrom_record);
    __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ba_to_bed);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_cur_scope->__pyx_v_ba_to_bed);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ba_to_bed);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_genome);
    PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_cur_scope->__pyx_v_genome);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_genome);
    __pyx_t_11 = 0;
    __pyx_t_9 = 0;
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_bed, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_chrom_list = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "SomVarIUS_calling.pyx":558
 * 		print 'calculating chromosome allele frequency distribution...'
 * 		chrom_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 * 		if dist != '':             # <<<<<<<<<<<<<<
 * 			for line in chrom_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 */
    __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_dist, __pyx_kp_s__6, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = (__pyx_t_6 != 0);
    if (__pyx_t_7) {

      /* "SomVarIUS_calling.pyx":559
 * 		chrom_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 * 		if dist != '':
 * 			for line in chrom_list:             # <<<<<<<<<<<<<<
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 			dist_out.close()
 */
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_chrom_list)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_chrom_list)) {
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_chrom_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_chrom_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_8(__pyx_t_3);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;

        /* "SomVarIUS_calling.pyx":560
 * 		if dist != '':
 * 			for line in chrom_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')             # <<<<<<<<<<<<<<
 * 			dist_out.close()
 * 		chrom_dist = {field[0]:(field[3],field[4], field[5]) for field in chrom_list}
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_dist_out)) { __Pyx_RaiseUnboundLocalError("dist_out"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_dist_out, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
        PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
        __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_line);
        PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_cur_scope->__pyx_v_line);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_line);
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyNumber_Add(__pyx_t_12, __pyx_kp_s__8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (!__pyx_t_12) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_11);
          PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "SomVarIUS_calling.pyx":559
 * 		chrom_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 * 		if dist != '':
 * 			for line in chrom_list:             # <<<<<<<<<<<<<<
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 			dist_out.close()
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "SomVarIUS_calling.pyx":561
 * 			for line in chrom_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 			dist_out.close()             # <<<<<<<<<<<<<<
 * 		chrom_dist = {field[0]:(field[3],field[4], field[5]) for field in chrom_list}
 * 		del chrom_record, all_bed_chroms, chrom_list
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_dist_out)) { __Pyx_RaiseUnboundLocalError("dist_out"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_dist_out, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "SomVarIUS_calling.pyx":562
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 			dist_out.close()
 * 		chrom_dist = {field[0]:(field[3],field[4], field[5]) for field in chrom_list}             # <<<<<<<<<<<<<<
 * 		del chrom_record, all_bed_chroms, chrom_list
 * 
 */
    { /* enter inner scope */
      PyObject *__pyx_8genexpr1__pyx_v_field = NULL;
      __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_chrom_list)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_chrom_list)) {
        __pyx_t_1 = __pyx_cur_scope->__pyx_v_chrom_list; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_chrom_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #endif
          } else {
            if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #else
            __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            #endif
          }
        } else {
          __pyx_t_2 = __pyx_t_8(__pyx_t_1);
          if (unlikely(!__pyx_t_2)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_field, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_field, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_11 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_field, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_field, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_field, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;};
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_GOTREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        __pyx_t_11 = 0;
        __pyx_t_9 = 0;
        __pyx_t_12 = 0;
        if (unlikely(PyDict_SetItem(__pyx_t_3, (PyObject*)__pyx_t_2, (PyObject*)__pyx_t_13))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field);
      goto __pyx_L20_exit_scope;
      __pyx_L17_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field);
      goto __pyx_L1_error;
      __pyx_L20_exit_scope:;
    } /* exit inner scope */
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_chrom_dist = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "SomVarIUS_calling.pyx":563
 * 			dist_out.close()
 * 		chrom_dist = {field[0]:(field[3],field[4], field[5]) for field in chrom_list}
 * 		del chrom_record, all_bed_chroms, chrom_list             # <<<<<<<<<<<<<<
 * 
 * 		copy_chrom = copy_list[0][0]
 */
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_chrom_record);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_chrom_record);
    __pyx_cur_scope->__pyx_v_chrom_record = NULL;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_all_bed_chroms);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_all_bed_chroms);
    __pyx_cur_scope->__pyx_v_all_bed_chroms = NULL;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_chrom_list);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_chrom_list);
    __pyx_cur_scope->__pyx_v_chrom_list = NULL;

    /* "SomVarIUS_calling.pyx":565
 * 		del chrom_record, all_bed_chroms, chrom_list
 * 
 * 		copy_chrom = copy_list[0][0]             # <<<<<<<<<<<<<<
 * 		copy_start = int(copy_list[0][1])
 * 		copy_end = int(copy_list[0][2])
 */
    if (unlikely(__pyx_cur_scope->__pyx_v_copy_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v_copy_list, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_copy_chrom = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":566
 * 
 * 		copy_chrom = copy_list[0][0]
 * 		copy_start = int(copy_list[0][1])             # <<<<<<<<<<<<<<
 * 		copy_end = int(copy_list[0][2])
 * 		print 'done calculating chromosome distributions'
 */
    if (unlikely(__pyx_cur_scope->__pyx_v_copy_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v_copy_list, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_cur_scope->__pyx_v_copy_start = __pyx_t_14;

    /* "SomVarIUS_calling.pyx":567
 * 		copy_chrom = copy_list[0][0]
 * 		copy_start = int(copy_list[0][1])
 * 		copy_end = int(copy_list[0][2])             # <<<<<<<<<<<<<<
 * 		print 'done calculating chromosome distributions'
 * 		print
 */
    if (unlikely(__pyx_cur_scope->__pyx_v_copy_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_cur_scope->__pyx_v_copy_list, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_cur_scope->__pyx_v_copy_end = __pyx_t_14;

    /* "SomVarIUS_calling.pyx":568
 * 		copy_start = int(copy_list[0][1])
 * 		copy_end = int(copy_list[0][2])
 * 		print 'done calculating chromosome distributions'             # <<<<<<<<<<<<<<
 * 		print
 * 
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_done_calculating_chromosome_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":569
 * 		copy_end = int(copy_list[0][2])
 * 		print 'done calculating chromosome distributions'
 * 		print             # <<<<<<<<<<<<<<
 * 
 * 	# if no copy number file provided
 */
    if (__Pyx_Print(0, __pyx_empty_tuple, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  /*else*/ {

    /* "SomVarIUS_calling.pyx":573
 * 	# if no copy number file provided
 * 	else:
 * 		copy_filter = True             # <<<<<<<<<<<<<<
 * 		print 'storing chromosome/dbsnp intersection in memory...'
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)
 */
    __pyx_cur_scope->__pyx_v_copy_filter = 1;

    /* "SomVarIUS_calling.pyx":574
 * 	else:
 * 		copy_filter = True
 * 		print 'storing chromosome/dbsnp intersection in memory...'             # <<<<<<<<<<<<<<
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)
 * 		chrom_record, bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_storing_chromosome_dbsnp_interse) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":575
 * 		copy_filter = True
 * 		print 'storing chromosome/dbsnp intersection in memory...'
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)             # <<<<<<<<<<<<<<
 * 		chrom_record, bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_references); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_lengths); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_13 = __pyx_f_17SomVarIUS_calling_generate_chrom_dist(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_13);
    __pyx_cur_scope->__pyx_v_chrom_regions = ((PyObject*)__pyx_t_13);
    __pyx_t_13 = 0;

    /* "SomVarIUS_calling.pyx":576
 * 		print 'storing chromosome/dbsnp intersection in memory...'
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)
 * 		chrom_record, bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)             # <<<<<<<<<<<<<<
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)
 * 		print 'calculating chromosome allele frequency distribution...'
 */
    __pyx_t_13 = __pyx_f_17SomVarIUS_calling_filter_regions(__pyx_cur_scope->__pyx_v_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_chrom_regions); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    if (likely(__pyx_t_13 != Py_None)) {
      PyObject* sequence = __pyx_t_13;
      #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 = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(PySet_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_cur_scope->__pyx_v_chrom_record = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_bed_chroms = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":577
 * 		chrom_regions = generate_chrom_dist(samfile.references, samfile.lengths)
 * 		chrom_record, bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)             # <<<<<<<<<<<<<<
 * 		print 'calculating chromosome allele frequency distribution...'
 * 
 */
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_references); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_1 = __pyx_f_17SomVarIUS_calling_samfile_ref_dicts(__pyx_t_13, __pyx_cur_scope->__pyx_v_bed_chroms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ba_to_bed);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_ba_to_bed, ((PyObject*)__pyx_t_1));
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":578
 * 		chrom_record, bed_chroms = filter_regions(dbsnp_bed_name, chrom_regions)
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)
 * 		print 'calculating chromosome allele frequency distribution...'             # <<<<<<<<<<<<<<
 * 
 * 		copy_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_calculating_chromosome_allele_fr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":580
 * 		print 'calculating chromosome allele frequency distribution...'
 * 
 * 		copy_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)             # <<<<<<<<<<<<<<
 * 
 * 		if dist != '':
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_dist); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_chrom_record);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_cur_scope->__pyx_v_chrom_record);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_chrom_record);
    __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ba_to_bed);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_cur_scope->__pyx_v_ba_to_bed);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ba_to_bed);
    PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_genome);
    PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_cur_scope->__pyx_v_genome);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_genome);
    __pyx_t_13 = 0;
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_12 = 0;
    __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_copy_bed, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_copy_list = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":582
 * 		copy_list = get_dist(chrom_record, samfile, ba_to_bed, min_reads, min_support, min_mapq, min_baseq, genome, copy_bed=True)
 * 
 * 		if dist != '':             # <<<<<<<<<<<<<<
 * 			dist_out = open(dist,"w")
 * 			for line in copy_list:
 */
    __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_dist, __pyx_kp_s__6, Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "SomVarIUS_calling.pyx":583
 * 
 * 		if dist != '':
 * 			dist_out = open(dist,"w")             # <<<<<<<<<<<<<<
 * 			for line in copy_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 */
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_cur_scope->__pyx_v_dist);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_dist);
      __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_dist);
      __Pyx_INCREF(__pyx_n_s_w);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w);
      __Pyx_GIVEREF(__pyx_n_s_w);
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_cur_scope->__pyx_v_dist_out = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "SomVarIUS_calling.pyx":584
 * 		if dist != '':
 * 			dist_out = open(dist,"w")
 * 			for line in copy_list:             # <<<<<<<<<<<<<<
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 			dist_out.close()
 */
      if (unlikely(__pyx_cur_scope->__pyx_v_copy_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __pyx_cur_scope->__pyx_v_copy_list; __Pyx_INCREF(__pyx_t_12); __pyx_t_4 = 0;
      for (;;) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_12)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_12, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_line);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_line, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;

        /* "SomVarIUS_calling.pyx":585
 * 			dist_out = open(dist,"w")
 * 			for line in copy_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')             # <<<<<<<<<<<<<<
 * 			dist_out.close()
 * 		chrom_dist = {field[0]:(field[3],field[4], field[5]) for field in copy_list}
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_dist_out, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
        PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyString_Type))));
        __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_line);
        PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_line);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_line);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
          PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_3);
          __pyx_t_3 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "SomVarIUS_calling.pyx":584
 * 		if dist != '':
 * 			dist_out = open(dist,"w")
 * 			for line in copy_list:             # <<<<<<<<<<<<<<
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 			dist_out.close()
 */
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "SomVarIUS_calling.pyx":586
 * 			for line in copy_list:
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 			dist_out.close()             # <<<<<<<<<<<<<<
 * 		chrom_dist = {field[0]:(field[3],field[4], field[5]) for field in copy_list}
 * 		del chrom_record, chrom_regions
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_dist_out, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_9) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L21;
    }
    __pyx_L21:;

    /* "SomVarIUS_calling.pyx":587
 * 				dist_out.write('\t'.join(map(str,line))+'\n')
 * 			dist_out.close()
 * 		chrom_dist = {field[0]:(field[3],field[4], field[5]) for field in copy_list}             # <<<<<<<<<<<<<<
 * 		del chrom_record, chrom_regions
 * 
 */
    { /* enter inner scope */
      PyObject *__pyx_8genexpr2__pyx_v_field = NULL;
      __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
      __Pyx_GOTREF(__pyx_t_12);
      if (unlikely(__pyx_cur_scope->__pyx_v_copy_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
      }
      __pyx_t_2 = __pyx_cur_scope->__pyx_v_copy_list; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
      for (;;) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        #endif
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_field, __pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_GetItemInt(__pyx_8genexpr2__pyx_v_field, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;};
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_8genexpr2__pyx_v_field, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;};
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_8genexpr2__pyx_v_field, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;};
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_8genexpr2__pyx_v_field, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;};
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_GOTREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_13 = 0;
        __pyx_t_3 = 0;
        __pyx_t_1 = 0;
        if (unlikely(PyDict_SetItem(__pyx_t_12, (PyObject*)__pyx_t_9, (PyObject*)__pyx_t_11))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_field);
      goto __pyx_L29_exit_scope;
      __pyx_L26_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_field);
      goto __pyx_L1_error;
      __pyx_L29_exit_scope:;
    } /* exit inner scope */
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_cur_scope->__pyx_v_chrom_dist = ((PyObject*)__pyx_t_12);
    __pyx_t_12 = 0;

    /* "SomVarIUS_calling.pyx":588
 * 			dist_out.close()
 * 		chrom_dist = {field[0]:(field[3],field[4], field[5]) for field in copy_list}
 * 		del chrom_record, chrom_regions             # <<<<<<<<<<<<<<
 * 
 * 		copy_chrom = ''
 */
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_chrom_record);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_chrom_record);
    __pyx_cur_scope->__pyx_v_chrom_record = NULL;
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_chrom_regions);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_chrom_regions);
    __pyx_cur_scope->__pyx_v_chrom_regions = NULL;

    /* "SomVarIUS_calling.pyx":590
 * 		del chrom_record, chrom_regions
 * 
 * 		copy_chrom = ''             # <<<<<<<<<<<<<<
 * 		copy_start = 0
 * 		copy_end = 0
 */
    __Pyx_INCREF(__pyx_kp_s__6);
    __Pyx_GIVEREF(__pyx_kp_s__6);
    __pyx_cur_scope->__pyx_v_copy_chrom = __pyx_kp_s__6;

    /* "SomVarIUS_calling.pyx":591
 * 
 * 		copy_chrom = ''
 * 		copy_start = 0             # <<<<<<<<<<<<<<
 * 		copy_end = 0
 * 
 */
    __pyx_cur_scope->__pyx_v_copy_start = 0;

    /* "SomVarIUS_calling.pyx":592
 * 		copy_chrom = ''
 * 		copy_start = 0
 * 		copy_end = 0             # <<<<<<<<<<<<<<
 * 
 * 		print 'done calculating chromosome distributions'
 */
    __pyx_cur_scope->__pyx_v_copy_end = 0;

    /* "SomVarIUS_calling.pyx":594
 * 		copy_end = 0
 * 
 * 		print 'done calculating chromosome distributions'             # <<<<<<<<<<<<<<
 * 		print
 * 
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_done_calculating_chromosome_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":595
 * 
 * 		print 'done calculating chromosome distributions'
 * 		print             # <<<<<<<<<<<<<<
 * 
 * 	if rna_filter:
 */
    if (__Pyx_Print(0, __pyx_empty_tuple, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "SomVarIUS_calling.pyx":597
 * 		print
 * 
 * 	if rna_filter:             # <<<<<<<<<<<<<<
 * 		fmt = '{chrom}\t{pos}\t{refbase}\t{maj_allele}\t{alt_allele}'
 * 		fmt+='\t{alt_allele_freq}\t{pvalue}\t{prob_not_se}\t{prob_not_hetero}'
 */
  __pyx_t_6 = (__pyx_cur_scope->__pyx_v_rna_filter != 0);
  if (__pyx_t_6) {

    /* "SomVarIUS_calling.pyx":598
 * 
 * 	if rna_filter:
 * 		fmt = '{chrom}\t{pos}\t{refbase}\t{maj_allele}\t{alt_allele}'             # <<<<<<<<<<<<<<
 * 		fmt+='\t{alt_allele_freq}\t{pvalue}\t{prob_not_se}\t{prob_not_hetero}'
 * 		fmt+='\t{n}\t{alt_count}\t{rvs_ratio}\t{fwd_ratio}\t{mean_qual}\t{mean_mapq}\t{rna_seq}\n'
 */
    __Pyx_INCREF(__pyx_kp_s_chrom_pos_refbase_maj_allele_al);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_fmt);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fmt, __pyx_kp_s_chrom_pos_refbase_maj_allele_al);
    __Pyx_GIVEREF(__pyx_kp_s_chrom_pos_refbase_maj_allele_al);

    /* "SomVarIUS_calling.pyx":599
 * 	if rna_filter:
 * 		fmt = '{chrom}\t{pos}\t{refbase}\t{maj_allele}\t{alt_allele}'
 * 		fmt+='\t{alt_allele_freq}\t{pvalue}\t{prob_not_se}\t{prob_not_hetero}'             # <<<<<<<<<<<<<<
 * 		fmt+='\t{n}\t{alt_count}\t{rvs_ratio}\t{fwd_ratio}\t{mean_qual}\t{mean_mapq}\t{rna_seq}\n'
 * 		rna_seq_file = Samfile(rna_seq_file_name)
 */
    __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_fmt, __pyx_kp_s_alt_allele_freq_pvalue_prob_not); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_fmt);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fmt, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;

    /* "SomVarIUS_calling.pyx":600
 * 		fmt = '{chrom}\t{pos}\t{refbase}\t{maj_allele}\t{alt_allele}'
 * 		fmt+='\t{alt_allele_freq}\t{pvalue}\t{prob_not_se}\t{prob_not_hetero}'
 * 		fmt+='\t{n}\t{alt_count}\t{rvs_ratio}\t{fwd_ratio}\t{mean_qual}\t{mean_mapq}\t{rna_seq}\n'             # <<<<<<<<<<<<<<
 * 		rna_seq_file = Samfile(rna_seq_file_name)
 * 		ba_to_rna = samfile_ref_dicts(samfile.references, rna_seq_file.references)
 */
    __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_fmt, __pyx_kp_s_n_alt_count_rvs_ratio_fwd_ratio); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_fmt);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fmt, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;

    /* "SomVarIUS_calling.pyx":601
 * 		fmt+='\t{alt_allele_freq}\t{pvalue}\t{prob_not_se}\t{prob_not_hetero}'
 * 		fmt+='\t{n}\t{alt_count}\t{rvs_ratio}\t{fwd_ratio}\t{mean_qual}\t{mean_mapq}\t{rna_seq}\n'
 * 		rna_seq_file = Samfile(rna_seq_file_name)             # <<<<<<<<<<<<<<
 * 		ba_to_rna = samfile_ref_dicts(samfile.references, rna_seq_file.references)
 * 
 */
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_rna_seq_file_name);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_cur_scope->__pyx_v_rna_seq_file_name);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_rna_seq_file_name);
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_8csamfile_Samfile)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_rna_seq_file = ((struct __pyx_obj_5pysam_8csamfile_Samfile *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":602
 * 		fmt+='\t{n}\t{alt_count}\t{rvs_ratio}\t{fwd_ratio}\t{mean_qual}\t{mean_mapq}\t{rna_seq}\n'
 * 		rna_seq_file = Samfile(rna_seq_file_name)
 * 		ba_to_rna = samfile_ref_dicts(samfile.references, rna_seq_file.references)             # <<<<<<<<<<<<<<
 * 
 * 	if hap_filter:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_references); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file), __pyx_n_s_references); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_11 = __pyx_f_17SomVarIUS_calling_samfile_ref_dicts(__pyx_t_2, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_cur_scope->__pyx_v_ba_to_rna = ((PyObject*)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L30;
  }
  __pyx_L30:;

  /* "SomVarIUS_calling.pyx":604
 * 		ba_to_rna = samfile_ref_dicts(samfile.references, rna_seq_file.references)
 * 
 * 	if hap_filter:             # <<<<<<<<<<<<<<
 * 		print 'loading germline record...'
 * 		hapmap_record = cPickle.load(open(hapmap_file,'rb'))
 */
  __pyx_t_6 = (__pyx_cur_scope->__pyx_v_hap_filter != 0);
  if (__pyx_t_6) {

    /* "SomVarIUS_calling.pyx":605
 * 
 * 	if hap_filter:
 * 		print 'loading germline record...'             # <<<<<<<<<<<<<<
 * 		hapmap_record = cPickle.load(open(hapmap_file,'rb'))
 * 		ba_to_hapmap = samfile_ref_dicts(samfile.references, hapmap_record.keys())
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_loading_germline_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":606
 * 	if hap_filter:
 * 		print 'loading germline record...'
 * 		hapmap_record = cPickle.load(open(hapmap_file,'rb'))             # <<<<<<<<<<<<<<
 * 		ba_to_hapmap = samfile_ref_dicts(samfile.references, hapmap_record.keys())
 * 		print 'done loading germline record'
 */
    __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_cPickle); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_load); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hapmap_file);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_cur_scope->__pyx_v_hapmap_file);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hapmap_file);
    __Pyx_INCREF(__pyx_n_s_rb);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_rb);
    __Pyx_GIVEREF(__pyx_n_s_rb);
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_11);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_11);
    __pyx_cur_scope->__pyx_v_hapmap_record = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "SomVarIUS_calling.pyx":607
 * 		print 'loading germline record...'
 * 		hapmap_record = cPickle.load(open(hapmap_file,'rb'))
 * 		ba_to_hapmap = samfile_ref_dicts(samfile.references, hapmap_record.keys())             # <<<<<<<<<<<<<<
 * 		print 'done loading germline record'
 * 		print
 */
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_references); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_hapmap_record, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_9) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_17SomVarIUS_calling_samfile_ref_dicts(__pyx_t_11, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_v_ba_to_hapmap = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "SomVarIUS_calling.pyx":608
 * 		hapmap_record = cPickle.load(open(hapmap_file,'rb'))
 * 		ba_to_hapmap = samfile_ref_dicts(samfile.references, hapmap_record.keys())
 * 		print 'done loading germline record'             # <<<<<<<<<<<<<<
 * 		print
 * 
 */
    if (__Pyx_PrintOne(0, __pyx_kp_s_done_loading_germline_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "SomVarIUS_calling.pyx":609
 * 		ba_to_hapmap = samfile_ref_dicts(samfile.references, hapmap_record.keys())
 * 		print 'done loading germline record'
 * 		print             # <<<<<<<<<<<<<<
 * 
 * 	#out.write(fmt.replace('}','').replace('{',''))
 */
    if (__Pyx_Print(0, __pyx_empty_tuple, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L31;
  }
  __pyx_L31:;

  /* "SomVarIUS_calling.pyx":612
 * 
 * 	#out.write(fmt.replace('}','').replace('{',''))
 * 	samfile = Samfile(samfile_name)             # <<<<<<<<<<<<<<
 * 	fafile = Fastafile(fafile_name)
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_samfile_name);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_samfile_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_samfile_name);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_8csamfile_Samfile)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_samfile));
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_samfile, ((struct __pyx_obj_5pysam_8csamfile_Samfile *)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":613
 * 	#out.write(fmt.replace('}','').replace('{',''))
 * 	samfile = Samfile(samfile_name)
 * 	fafile = Fastafile(fafile_name)             # <<<<<<<<<<<<<<
 * 
 * 	it = samfile.pileup(reference=region_chrom, start=region_start, end=region_end,
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fafile_name);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_fafile_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fafile_name);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5pysam_6cfaidx_Fastafile)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_fafile));
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_fafile, ((struct __pyx_obj_5pysam_6cfaidx_Fastafile *)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":615
 * 	fafile = Fastafile(fafile_name)
 * 
 * 	it = samfile.pileup(reference=region_chrom, start=region_start, end=region_end,             # <<<<<<<<<<<<<<
 * 						truncate=False, max_depth=80000)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_pileup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reference, __pyx_cur_scope->__pyx_v_region_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_start, __pyx_cur_scope->__pyx_v_region_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_end, __pyx_cur_scope->__pyx_v_region_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":616
 * 
 * 	it = samfile.pileup(reference=region_chrom, start=region_start, end=region_end,
 * 						truncate=False, max_depth=80000)             # <<<<<<<<<<<<<<
 * 
 * 	# statically typed variables
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_truncate, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_depth, __pyx_int_80000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":615
 * 	fafile = Fastafile(fafile_name)
 * 
 * 	it = samfile.pileup(reference=region_chrom, start=region_start, end=region_end,             # <<<<<<<<<<<<<<
 * 						truncate=False, max_depth=80000)
 * 
 */
  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_cur_scope->__pyx_v_it = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "SomVarIUS_calling.pyx":627
 * 	cdef int n  # total number of reads in column
 * 	cdef double baseq
 * 	cdef double total_baseq = 0.0             # <<<<<<<<<<<<<<
 * 	cdef PileupColumn col
 * 	cdef double alt_allele_freq
 */
  __pyx_cur_scope->__pyx_v_total_baseq = 0.0;

  /* "SomVarIUS_calling.pyx":644
 * 	cdef double rna_seq
 * 
 * 	print 'calling mutations'             # <<<<<<<<<<<<<<
 * 
 * 	for col in it:
 */
  if (__Pyx_PrintOne(0, __pyx_kp_s_calling_mutations) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":646
 * 	print 'calling mutations'
 * 
 * 	for col in it:             # <<<<<<<<<<<<<<
 * 		# initialise variables
 * 		n = col.n
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_it)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_it)) {
    __pyx_t_11 = __pyx_cur_scope->__pyx_v_it; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_11))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_8(__pyx_t_11);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5pysam_14calignmentfile_PileupColumn))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_col));
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_col, ((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)__pyx_t_2));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

    /* "SomVarIUS_calling.pyx":648
 * 	for col in it:
 * 		# initialise variables
 * 		n = col.n             # <<<<<<<<<<<<<<
 * 		if n >= min_reads:
 * 			plp = col.plp
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_col), __pyx_n_s_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_cur_scope->__pyx_v_n = __pyx_t_14;

    /* "SomVarIUS_calling.pyx":649
 * 		# initialise variables
 * 		n = col.n
 * 		if n >= min_reads:             # <<<<<<<<<<<<<<
 * 			plp = col.plp
 * 			total_baseq = 0.0
 */
    __pyx_t_6 = ((__pyx_cur_scope->__pyx_v_n >= __pyx_cur_scope->__pyx_v_min_reads) != 0);
    if (__pyx_t_6) {

      /* "SomVarIUS_calling.pyx":650
 * 		n = col.n
 * 		if n >= min_reads:
 * 			plp = col.plp             # <<<<<<<<<<<<<<
 * 			total_baseq = 0.0
 * 			_init_count(&A)
 */
      __pyx_t_15 = __pyx_cur_scope->__pyx_v_col->plp;
      __pyx_cur_scope->__pyx_v_plp = __pyx_t_15;

      /* "SomVarIUS_calling.pyx":651
 * 		if n >= min_reads:
 * 			plp = col.plp
 * 			total_baseq = 0.0             # <<<<<<<<<<<<<<
 * 			_init_count(&A)
 * 			_init_count(&T)
 */
      __pyx_cur_scope->__pyx_v_total_baseq = 0.0;

      /* "SomVarIUS_calling.pyx":652
 * 			plp = col.plp
 * 			total_baseq = 0.0
 * 			_init_count(&A)             # <<<<<<<<<<<<<<
 * 			_init_count(&T)
 * 			_init_count(&G)
 */
      __pyx_t_2 = __pyx_f_17SomVarIUS_calling__init_count((&__pyx_cur_scope->__pyx_v_A)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "SomVarIUS_calling.pyx":653
 * 			total_baseq = 0.0
 * 			_init_count(&A)
 * 			_init_count(&T)             # <<<<<<<<<<<<<<
 * 			_init_count(&G)
 * 			_init_count(&C)
 */
      __pyx_t_2 = __pyx_f_17SomVarIUS_calling__init_count((&__pyx_cur_scope->__pyx_v_T)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "SomVarIUS_calling.pyx":654
 * 			_init_count(&A)
 * 			_init_count(&T)
 * 			_init_count(&G)             # <<<<<<<<<<<<<<
 * 			_init_count(&C)
 * 
 */
      __pyx_t_2 = __pyx_f_17SomVarIUS_calling__init_count((&__pyx_cur_scope->__pyx_v_G)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "SomVarIUS_calling.pyx":655
 * 			_init_count(&T)
 * 			_init_count(&G)
 * 			_init_count(&C)             # <<<<<<<<<<<<<<
 * 
 * 			# get chromosome name and position
 */
      __pyx_t_2 = __pyx_f_17SomVarIUS_calling__init_count((&__pyx_cur_scope->__pyx_v_C)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "SomVarIUS_calling.pyx":658
 * 
 * 			# get chromosome name and position
 * 			chrom = samfile.getrname(col.tid)             # <<<<<<<<<<<<<<
 * 			pos = col.pos + 1
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_samfile), __pyx_n_s_getrname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_col->tid); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_12 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_12) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chrom);
      __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chrom, ((PyObject*)__pyx_t_2));
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;

      /* "SomVarIUS_calling.pyx":659
 * 			# get chromosome name and position
 * 			chrom = samfile.getrname(col.tid)
 * 			pos = col.pos + 1             # <<<<<<<<<<<<<<
 * 
 * 			# loop over reads, extract what we need
 */
      __pyx_cur_scope->__pyx_v_pos = (__pyx_cur_scope->__pyx_v_col->pos + 1);

      /* "SomVarIUS_calling.pyx":662
 * 
 * 			# loop over reads, extract what we need
 * 			for i from 0<=i < n:             # <<<<<<<<<<<<<<
 * 				read = &(plp[0][i])
 * 				if read.indel == 0 and read.is_del == False:
 */
      __pyx_t_14 = __pyx_cur_scope->__pyx_v_n;
      for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_14; __pyx_cur_scope->__pyx_v_i++) {

        /* "SomVarIUS_calling.pyx":663
 * 			# loop over reads, extract what we need
 * 			for i from 0<=i < n:
 * 				read = &(plp[0][i])             # <<<<<<<<<<<<<<
 * 				if read.indel == 0 and read.is_del == False:
 * 					aln = read.b
 */
        __pyx_cur_scope->__pyx_v_read = (&((__pyx_cur_scope->__pyx_v_plp[0])[__pyx_cur_scope->__pyx_v_i]));

        /* "SomVarIUS_calling.pyx":664
 * 			for i from 0<=i < n:
 * 				read = &(plp[0][i])
 * 				if read.indel == 0 and read.is_del == False:             # <<<<<<<<<<<<<<
 * 					aln = read.b
 * 					flag = aln.core.flag
 */
        __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_read->indel == 0) != 0);
        if (__pyx_t_7) {
        } else {
          __pyx_t_6 = __pyx_t_7;
          goto __pyx_L38_bool_binop_done;
        }
        __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_read->is_del == 0) != 0);
        __pyx_t_6 = __pyx_t_7;
        __pyx_L38_bool_binop_done:;
        if (__pyx_t_6) {

          /* "SomVarIUS_calling.pyx":665
 * 				read = &(plp[0][i])
 * 				if read.indel == 0 and read.is_del == False:
 * 					aln = read.b             # <<<<<<<<<<<<<<
 * 					flag = aln.core.flag
 * 					mapq = aln.core.qual
 */
          __pyx_t_16 = __pyx_cur_scope->__pyx_v_read->b;
          __pyx_cur_scope->__pyx_v_aln = __pyx_t_16;

          /* "SomVarIUS_calling.pyx":666
 * 				if read.indel == 0 and read.is_del == False:
 * 					aln = read.b
 * 					flag = aln.core.flag             # <<<<<<<<<<<<<<
 * 					mapq = aln.core.qual
 * 					is_reverse = <bint>(flag & BAM_FREVERSE)
 */
          __pyx_t_17 = __pyx_cur_scope->__pyx_v_aln->core.flag;
          __pyx_cur_scope->__pyx_v_flag = __pyx_t_17;

          /* "SomVarIUS_calling.pyx":667
 * 					aln = read.b
 * 					flag = aln.core.flag
 * 					mapq = aln.core.qual             # <<<<<<<<<<<<<<
 * 					is_reverse = <bint>(flag & BAM_FREVERSE)
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)
 */
          __pyx_t_18 = __pyx_cur_scope->__pyx_v_aln->core.qual;
          __pyx_cur_scope->__pyx_v_mapq = __pyx_t_18;

          /* "SomVarIUS_calling.pyx":668
 * 					flag = aln.core.flag
 * 					mapq = aln.core.qual
 * 					is_reverse = <bint>(flag & BAM_FREVERSE)             # <<<<<<<<<<<<<<
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)
 * 					alnbase = _get_seq_base(aln, read.qpos)
 */
          __pyx_cur_scope->__pyx_v_is_reverse = ((__pyx_cur_scope->__pyx_v_flag & 16) != 0);

          /* "SomVarIUS_calling.pyx":669
 * 					mapq = aln.core.qual
 * 					is_reverse = <bint>(flag & BAM_FREVERSE)
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)             # <<<<<<<<<<<<<<
 * 					alnbase = _get_seq_base(aln, read.qpos)
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]
 */
          __pyx_cur_scope->__pyx_v_is_proper_pair = ((__pyx_cur_scope->__pyx_v_flag & 2) != 0);

          /* "SomVarIUS_calling.pyx":670
 * 					is_reverse = <bint>(flag & BAM_FREVERSE)
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)
 * 					alnbase = _get_seq_base(aln, read.qpos)             # <<<<<<<<<<<<<<
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]
 * 					total_baseq += pow(10.0, (-baseq/10.0))
 */
          __pyx_t_2 = __pyx_f_17SomVarIUS_calling__get_seq_base(__pyx_cur_scope->__pyx_v_aln, __pyx_cur_scope->__pyx_v_read->qpos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alnbase);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alnbase, ((PyObject*)__pyx_t_2));
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;

          /* "SomVarIUS_calling.pyx":671
 * 					is_proper_pair = <bint>(flag & BAM_FPROPER_PAIR)
 * 					alnbase = _get_seq_base(aln, read.qpos)
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]             # <<<<<<<<<<<<<<
 * 					total_baseq += pow(10.0, (-baseq/10.0))
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:
 */
          __pyx_cur_scope->__pyx_v_baseq = (pysam_bam_get_qual(__pyx_cur_scope->__pyx_v_aln)[__pyx_cur_scope->__pyx_v_read->qpos]);

          /* "SomVarIUS_calling.pyx":672
 * 					alnbase = _get_seq_base(aln, read.qpos)
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]
 * 					total_baseq += pow(10.0, (-baseq/10.0))             # <<<<<<<<<<<<<<
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:
 * 						if alnbase == b'A':
 */
          __pyx_cur_scope->__pyx_v_total_baseq = (__pyx_cur_scope->__pyx_v_total_baseq + pow(10.0, ((-__pyx_cur_scope->__pyx_v_baseq) / 10.0)));

          /* "SomVarIUS_calling.pyx":673
 * 					baseq = pysam_bam_get_qual(aln)[read.qpos]
 * 					total_baseq += pow(10.0, (-baseq/10.0))
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:             # <<<<<<<<<<<<<<
 * 						if alnbase == b'A':
 * 							_incr_count(&A, is_reverse, baseq, mapq)
 */
          __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_mapq >= __pyx_cur_scope->__pyx_v_min_mapq) != 0);
          if (__pyx_t_7) {
          } else {
            __pyx_t_6 = __pyx_t_7;
            goto __pyx_L41_bool_binop_done;
          }
          __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_baseq >= __pyx_cur_scope->__pyx_v_min_baseq) != 0);
          if (__pyx_t_7) {
          } else {
            __pyx_t_6 = __pyx_t_7;
            goto __pyx_L41_bool_binop_done;
          }
          __pyx_t_7 = (__pyx_cur_scope->__pyx_v_is_proper_pair != 0);
          __pyx_t_6 = __pyx_t_7;
          __pyx_L41_bool_binop_done:;
          if (__pyx_t_6) {

            /* "SomVarIUS_calling.pyx":674
 * 					total_baseq += pow(10.0, (-baseq/10.0))
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:
 * 						if alnbase == b'A':             # <<<<<<<<<<<<<<
 * 							_incr_count(&A, is_reverse, baseq, mapq)
 * 						elif alnbase == b'T':
 */
            __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_cur_scope->__pyx_v_alnbase, __pyx_n_b_A, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_7 = (__pyx_t_6 != 0);
            if (__pyx_t_7) {

              /* "SomVarIUS_calling.pyx":675
 * 					if mapq >= min_mapq and baseq >= min_baseq and is_proper_pair:
 * 						if alnbase == b'A':
 * 							_incr_count(&A, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 						elif alnbase == b'T':
 * 							_incr_count(&T, is_reverse, baseq, mapq)
 */
              __pyx_t_2 = __pyx_f_17SomVarIUS_calling__incr_count((&__pyx_cur_scope->__pyx_v_A), __pyx_cur_scope->__pyx_v_is_reverse, __pyx_cur_scope->__pyx_v_baseq, __pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L44;
            }

            /* "SomVarIUS_calling.pyx":676
 * 						if alnbase == b'A':
 * 							_incr_count(&A, is_reverse, baseq, mapq)
 * 						elif alnbase == b'T':             # <<<<<<<<<<<<<<
 * 							_incr_count(&T, is_reverse, baseq, mapq)
 * 						elif alnbase == b'G':
 */
            __pyx_t_7 = (__Pyx_PyBytes_Equals(__pyx_cur_scope->__pyx_v_alnbase, __pyx_n_b_T, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_6 = (__pyx_t_7 != 0);
            if (__pyx_t_6) {

              /* "SomVarIUS_calling.pyx":677
 * 							_incr_count(&A, is_reverse, baseq, mapq)
 * 						elif alnbase == b'T':
 * 							_incr_count(&T, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 						elif alnbase == b'G':
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 */
              __pyx_t_2 = __pyx_f_17SomVarIUS_calling__incr_count((&__pyx_cur_scope->__pyx_v_T), __pyx_cur_scope->__pyx_v_is_reverse, __pyx_cur_scope->__pyx_v_baseq, __pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L44;
            }

            /* "SomVarIUS_calling.pyx":678
 * 						elif alnbase == b'T':
 * 							_incr_count(&T, is_reverse, baseq, mapq)
 * 						elif alnbase == b'G':             # <<<<<<<<<<<<<<
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 * 						elif alnbase == b'C':
 */
            __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_cur_scope->__pyx_v_alnbase, __pyx_n_b_G, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_7 = (__pyx_t_6 != 0);
            if (__pyx_t_7) {

              /* "SomVarIUS_calling.pyx":679
 * 							_incr_count(&T, is_reverse, baseq, mapq)
 * 						elif alnbase == b'G':
 * 							_incr_count(&G, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 						elif alnbase == b'C':
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 */
              __pyx_t_2 = __pyx_f_17SomVarIUS_calling__incr_count((&__pyx_cur_scope->__pyx_v_G), __pyx_cur_scope->__pyx_v_is_reverse, __pyx_cur_scope->__pyx_v_baseq, __pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L44;
            }

            /* "SomVarIUS_calling.pyx":680
 * 						elif alnbase == b'G':
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 * 						elif alnbase == b'C':             # <<<<<<<<<<<<<<
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 * 
 */
            __pyx_t_7 = (__Pyx_PyBytes_Equals(__pyx_cur_scope->__pyx_v_alnbase, __pyx_n_b_C, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_6 = (__pyx_t_7 != 0);
            if (__pyx_t_6) {

              /* "SomVarIUS_calling.pyx":681
 * 							_incr_count(&G, is_reverse, baseq, mapq)
 * 						elif alnbase == b'C':
 * 							_incr_count(&C, is_reverse, baseq, mapq)             # <<<<<<<<<<<<<<
 * 
 * 			if A.pres+T.pres+G.pres+C.pres > 1:
 */
              __pyx_t_2 = __pyx_f_17SomVarIUS_calling__incr_count((&__pyx_cur_scope->__pyx_v_C), __pyx_cur_scope->__pyx_v_is_reverse, __pyx_cur_scope->__pyx_v_baseq, __pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L44;
            }
            __pyx_L44:;
            goto __pyx_L40;
          }
          __pyx_L40:;
          goto __pyx_L37;
        }
        __pyx_L37:;
      }

      /* "SomVarIUS_calling.pyx":683
 * 							_incr_count(&C, is_reverse, baseq, mapq)
 * 
 * 			if A.pres+T.pres+G.pres+C.pres > 1:             # <<<<<<<<<<<<<<
 * 
 * 				if hap_filter:
 */
      __pyx_t_6 = (((((__pyx_cur_scope->__pyx_v_A.pres + __pyx_cur_scope->__pyx_v_T.pres) + __pyx_cur_scope->__pyx_v_G.pres) + __pyx_cur_scope->__pyx_v_C.pres) > 1) != 0);
      if (__pyx_t_6) {

        /* "SomVarIUS_calling.pyx":685
 * 			if A.pres+T.pres+G.pres+C.pres > 1:
 * 
 * 				if hap_filter:             # <<<<<<<<<<<<<<
 * 					try:
 * 						hap_ref, hap_alt = hapmap_record[(ba_to_hapmap[chrom], pos)]
 */
        __pyx_t_6 = (__pyx_cur_scope->__pyx_v_hap_filter != 0);
        if (__pyx_t_6) {

          /* "SomVarIUS_calling.pyx":686
 * 
 * 				if hap_filter:
 * 					try:             # <<<<<<<<<<<<<<
 * 						hap_ref, hap_alt = hapmap_record[(ba_to_hapmap[chrom], pos)]
 * 						#check if there is more than one germline present
 */
          {
            __Pyx_ExceptionSave(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            /*try:*/ {

              /* "SomVarIUS_calling.pyx":687
 * 				if hap_filter:
 * 					try:
 * 						hap_ref, hap_alt = hapmap_record[(ba_to_hapmap[chrom], pos)]             # <<<<<<<<<<<<<<
 * 						#check if there is more than one germline present
 * 						if len(hap_alt) > 1:
 */
              if (unlikely(!__pyx_cur_scope->__pyx_v_hapmap_record)) { __Pyx_RaiseUnboundLocalError("hapmap_record"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;} }
              if (unlikely(!__pyx_cur_scope->__pyx_v_ba_to_hapmap)) { __Pyx_RaiseUnboundLocalError("ba_to_hapmap"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;} }
              if (unlikely(__pyx_cur_scope->__pyx_v_ba_to_hapmap == Py_None)) {
                PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_ba_to_hapmap, __pyx_cur_scope->__pyx_v_chrom); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_1);
              __pyx_t_2 = 0;
              __pyx_t_1 = 0;
              __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_hapmap_record, __pyx_t_3); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
                PyObject* sequence = __pyx_t_1;
                #if CYTHON_COMPILING_IN_CPYTHON
                Py_ssize_t size = Py_SIZE(sequence);
                #else
                Py_ssize_t size = PySequence_Size(sequence);
                #endif
                if (unlikely(size != 2)) {
                  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                #if CYTHON_COMPILING_IN_CPYTHON
                if (likely(PyTuple_CheckExact(sequence))) {
                  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
                  __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
                } else {
                  __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
                  __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
                }
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_2);
                #else
                __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_2);
                #endif
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              } else {
                Py_ssize_t index = -1;
                __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_22 = Py_TYPE(__pyx_t_9)->tp_iternext;
                index = 0; __pyx_t_3 = __pyx_t_22(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L55_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_3);
                index = 1; __pyx_t_2 = __pyx_t_22(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L55_unpacking_failed;
                __Pyx_GOTREF(__pyx_t_2);
                if (__Pyx_IternextUnpackEndCheck(__pyx_t_22(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __pyx_t_22 = NULL;
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                goto __pyx_L56_unpacking_done;
                __pyx_L55_unpacking_failed:;
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_22 = NULL;
                if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __pyx_L56_unpacking_done:;
              }
              __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_hap_ref);
              __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_hap_ref, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_3);
              __pyx_t_3 = 0;
              __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_hap_alt);
              __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_hap_alt, __pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_t_2 = 0;

              /* "SomVarIUS_calling.pyx":689
 * 						hap_ref, hap_alt = hapmap_record[(ba_to_hapmap[chrom], pos)]
 * 						#check if there is more than one germline present
 * 						if len(hap_alt) > 1:             # <<<<<<<<<<<<<<
 * 							possible_germs = hap_alt.split(',')
 * 							alt_germ = eval(possible_germs[0])
 */
              __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_hap_alt); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __pyx_t_6 = ((__pyx_t_5 > 1) != 0);
              if (__pyx_t_6) {

                /* "SomVarIUS_calling.pyx":690
 * 						#check if there is more than one germline present
 * 						if len(hap_alt) > 1:
 * 							possible_germs = hap_alt.split(',')             # <<<<<<<<<<<<<<
 * 							alt_germ = eval(possible_germs[0])
 * 							for i in xrange(1, len(possible_germs)):
 */
                __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_hap_alt, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_possible_germs);
                __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_possible_germs, __pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_2);
                __pyx_t_2 = 0;

                /* "SomVarIUS_calling.pyx":691
 * 						if len(hap_alt) > 1:
 * 							possible_germs = hap_alt.split(',')
 * 							alt_germ = eval(possible_germs[0])             # <<<<<<<<<<<<<<
 * 							for i in xrange(1, len(possible_germs)):
 * 								if eval(possible_germs[i])['count'] > alt_germ['count']:
 */
                __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_possible_germs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __pyx_t_9 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_A); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_A, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_C); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_C, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_G); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_G, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_T); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_T, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_all_bed_chroms) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_all_bed_chroms, __pyx_cur_scope->__pyx_v_all_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_alnbase) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alnbase, __pyx_cur_scope->__pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_alt_allele) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alt_allele, __pyx_cur_scope->__pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alt_allele_freq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alt_count, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_alt_germ) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alt_germ, __pyx_cur_scope->__pyx_v_alt_germ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_ba_to_bed) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ba_to_bed, __pyx_cur_scope->__pyx_v_ba_to_bed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_ba_to_fa) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ba_to_fa, __pyx_cur_scope->__pyx_v_ba_to_fa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_ba_to_hapmap) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ba_to_hapmap, __pyx_cur_scope->__pyx_v_ba_to_hapmap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_ba_to_rna) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ba_to_rna, __pyx_cur_scope->__pyx_v_ba_to_rna) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_baseq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_baseq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_bed_chroms) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bed_chroms, __pyx_cur_scope->__pyx_v_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_binom); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_binom, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_chrom) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom, __pyx_cur_scope->__pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_chrom_dist) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom_dist, __pyx_cur_scope->__pyx_v_chrom_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_chrom_list) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom_list, __pyx_cur_scope->__pyx_v_chrom_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_chrom_record) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom_record, __pyx_cur_scope->__pyx_v_chrom_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_chrom_regions) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom_regions, __pyx_cur_scope->__pyx_v_chrom_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (((PyObject *)__pyx_cur_scope->__pyx_v_col)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_col, ((PyObject *)__pyx_cur_scope->__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_copy_bed_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_bed_name, __pyx_cur_scope->__pyx_v_copy_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_copy_chrom) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_chrom, __pyx_cur_scope->__pyx_v_copy_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_end); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_end, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_copy_filter); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_filter, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_copy_list) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_list, __pyx_cur_scope->__pyx_v_copy_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_list_pos, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_copy_record) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_record, __pyx_cur_scope->__pyx_v_copy_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_copy_regions) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_regions, __pyx_cur_scope->__pyx_v_copy_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_start, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_counts) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_counts, __pyx_cur_scope->__pyx_v_counts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_dbsnp_bed_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_dbsnp_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_delta); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_delta, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_dist) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dist, __pyx_cur_scope->__pyx_v_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_dist_out) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dist_out, __pyx_cur_scope->__pyx_v_dist_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fafile, ((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_fafile_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fafile_name, __pyx_cur_scope->__pyx_v_fafile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_flag); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_flag, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_fmt) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fmt, __pyx_cur_scope->__pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_forward); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_forward, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_fourth_allele) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fourth_allele, __pyx_cur_scope->__pyx_v_fourth_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_fourth_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fourth_count, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fwd_ratio, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_genome) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_genome, __pyx_cur_scope->__pyx_v_genome) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_hap_alt) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hap_alt, __pyx_cur_scope->__pyx_v_hap_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_hap_filter); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hap_filter, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_hap_ref) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hap_ref, __pyx_cur_scope->__pyx_v_hap_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_hapmap_file) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hapmap_file, __pyx_cur_scope->__pyx_v_hapmap_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_hapmap_present); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hapmap_present, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_hapmap_record) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hapmap_record, __pyx_cur_scope->__pyx_v_hapmap_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_i, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_in_copy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_in_copy, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_proper_pair, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_reverse); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_reverse, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_it) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_it, __pyx_cur_scope->__pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_labels) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_labels, __pyx_cur_scope->__pyx_v_labels) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_lengths) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_lengths, __pyx_cur_scope->__pyx_v_lengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_line) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_line, __pyx_cur_scope->__pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_maj_allele) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_maj_allele, __pyx_cur_scope->__pyx_v_maj_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_maj_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_maj_count, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mapq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_mapq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mean_mapq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_qual); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mean_qual, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_af); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_af, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_baseq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_f_r); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_f_r, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_hetero); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_hetero, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_mapq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_pvalue); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_pvalue, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_qual); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_qual, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_reads, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_se); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_se, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_support, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_n, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_out_file) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_out_file, __pyx_cur_scope->__pyx_v_out_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_pos); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pos, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_possible_germs) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_possible_germs, __pyx_cur_scope->__pyx_v_possible_germs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_hetero); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prob_not_hetero, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_se); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prob_not_se, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_pvalue); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pvalue, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_ref_filter); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ref_filter, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (__pyx_cur_scope->__pyx_v_refbase) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_refbase, __pyx_cur_scope->__pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_references) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_references, __pyx_cur_scope->__pyx_v_references) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_region_chrom) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_region_chrom, __pyx_cur_scope->__pyx_v_region_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_region_end) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_region_end, __pyx_cur_scope->__pyx_v_region_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_region_start) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_region_start, __pyx_cur_scope->__pyx_v_region_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_reverse); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_reverse, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_rna_filter); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rna_filter, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rna_seq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rna_seq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rna_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_rna_seq_file_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rna_seq_file_name, __pyx_cur_scope->__pyx_v_rna_seq_file_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rnq_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rvs_ratio, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_samfile, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_samfile_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_samfile_name, __pyx_cur_scope->__pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_seen_chroms) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_seen_chroms, __pyx_cur_scope->__pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_third_allele) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_third_allele, __pyx_cur_scope->__pyx_v_third_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_third_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_third_count, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_total_alleles); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_total_alleles, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_total_baseq); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                if (__pyx_t_9) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_total_baseq, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_9);
                PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_2);
                PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
                __Pyx_GIVEREF(__pyx_t_1);
                PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_3);
                __pyx_t_2 = 0;
                __pyx_t_1 = 0;
                __pyx_t_3 = 0;
                __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alt_germ);
                __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alt_germ, __pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_3);
                __pyx_t_3 = 0;

                /* "SomVarIUS_calling.pyx":692
 * 							possible_germs = hap_alt.split(',')
 * 							alt_germ = eval(possible_germs[0])
 * 							for i in xrange(1, len(possible_germs)):             # <<<<<<<<<<<<<<
 * 								if eval(possible_germs[i])['count'] > alt_germ['count']:
 * 									alt_germ = eval(possible_germs[i])
 */
                __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_possible_germs); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                for (__pyx_t_14 = 1; __pyx_t_14 < __pyx_t_5; __pyx_t_14+=1) {
                  __pyx_cur_scope->__pyx_v_i = __pyx_t_14;

                  /* "SomVarIUS_calling.pyx":693
 * 							alt_germ = eval(possible_germs[0])
 * 							for i in xrange(1, len(possible_germs)):
 * 								if eval(possible_germs[i])['count'] > alt_germ['count']:             # <<<<<<<<<<<<<<
 * 									alt_germ = eval(possible_germs[i])
 * 						else:
 */
                  __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_possible_germs, __pyx_cur_scope->__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
                  __Pyx_GOTREF(__pyx_t_3);
                  __pyx_t_9 = __Pyx_Globals(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_9);
                  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_2 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_A); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_A, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_C); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_C, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_G); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_G, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_T, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_all_bed_chroms) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_all_bed_chroms, __pyx_cur_scope->__pyx_v_all_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_alnbase) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alnbase, __pyx_cur_scope->__pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_alt_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele, __pyx_cur_scope->__pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele_freq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_alt_germ) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_germ, __pyx_cur_scope->__pyx_v_alt_germ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_ba_to_bed) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_bed, __pyx_cur_scope->__pyx_v_ba_to_bed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_ba_to_fa) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_fa, __pyx_cur_scope->__pyx_v_ba_to_fa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_ba_to_hapmap) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_hapmap, __pyx_cur_scope->__pyx_v_ba_to_hapmap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_ba_to_rna) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_rna, __pyx_cur_scope->__pyx_v_ba_to_rna) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_baseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_baseq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_bed_chroms) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bed_chroms, __pyx_cur_scope->__pyx_v_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_binom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_binom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_chrom) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom, __pyx_cur_scope->__pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_chrom_dist) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_dist, __pyx_cur_scope->__pyx_v_chrom_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_chrom_list) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_list, __pyx_cur_scope->__pyx_v_chrom_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_chrom_record) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_record, __pyx_cur_scope->__pyx_v_chrom_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_chrom_regions) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_regions, __pyx_cur_scope->__pyx_v_chrom_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_col)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_col, ((PyObject *)__pyx_cur_scope->__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_copy_bed_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_bed_name, __pyx_cur_scope->__pyx_v_copy_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_copy_chrom) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_chrom, __pyx_cur_scope->__pyx_v_copy_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_end, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_copy_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_copy_list) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_list, __pyx_cur_scope->__pyx_v_copy_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_list_pos, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_copy_record) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_record, __pyx_cur_scope->__pyx_v_copy_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_copy_regions) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_regions, __pyx_cur_scope->__pyx_v_copy_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_start, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_counts) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_counts, __pyx_cur_scope->__pyx_v_counts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_dbsnp_bed_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_dbsnp_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_delta, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_dist) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dist, __pyx_cur_scope->__pyx_v_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_dist_out) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dist_out, __pyx_cur_scope->__pyx_v_dist_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fafile, ((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_fafile_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fafile_name, __pyx_cur_scope->__pyx_v_fafile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flag, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_fmt) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fmt, __pyx_cur_scope->__pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_forward); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_forward, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_fourth_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fourth_allele, __pyx_cur_scope->__pyx_v_fourth_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_fourth_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fourth_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fwd_ratio, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_genome) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_genome, __pyx_cur_scope->__pyx_v_genome) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_hap_alt) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_alt, __pyx_cur_scope->__pyx_v_hap_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_hap_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_hap_ref) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_ref, __pyx_cur_scope->__pyx_v_hap_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_hapmap_file) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_file, __pyx_cur_scope->__pyx_v_hapmap_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_hapmap_present); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_present, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_hapmap_record) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_record, __pyx_cur_scope->__pyx_v_hapmap_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_in_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_in_copy, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_proper_pair, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_reverse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_reverse, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_it) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_it, __pyx_cur_scope->__pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_labels) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_labels, __pyx_cur_scope->__pyx_v_labels) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_lengths) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lengths, __pyx_cur_scope->__pyx_v_lengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_line) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_line, __pyx_cur_scope->__pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_maj_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maj_allele, __pyx_cur_scope->__pyx_v_maj_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_maj_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maj_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mapq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_mapq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_qual); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_qual, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_af); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_af, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_baseq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_f_r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_f_r, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_hetero); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_hetero, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_mapq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_pvalue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_pvalue, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_qual); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_qual, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_reads, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_se); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_se, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_support, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_n, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_out_file) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out_file, __pyx_cur_scope->__pyx_v_out_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pos, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_possible_germs) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_possible_germs, __pyx_cur_scope->__pyx_v_possible_germs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_hetero); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_not_hetero, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_se); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_not_se, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_pvalue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pvalue, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_ref_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ref_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (__pyx_cur_scope->__pyx_v_refbase) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_refbase, __pyx_cur_scope->__pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_references) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_references, __pyx_cur_scope->__pyx_v_references) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_region_chrom) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_chrom, __pyx_cur_scope->__pyx_v_region_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_region_end) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_end, __pyx_cur_scope->__pyx_v_region_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_region_start) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_start, __pyx_cur_scope->__pyx_v_region_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_reverse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reverse, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_rna_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rna_seq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_rna_seq_file_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq_file_name, __pyx_cur_scope->__pyx_v_rna_seq_file_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rnq_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rvs_ratio, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_samfile_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile_name, __pyx_cur_scope->__pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_seen_chroms) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seen_chroms, __pyx_cur_scope->__pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_third_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_third_allele, __pyx_cur_scope->__pyx_v_third_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_third_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_third_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_total_alleles); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_alleles, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_total_baseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  if (__pyx_t_2) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_baseq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  }
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_2);
                  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
                  __Pyx_GIVEREF(__pyx_t_3);
                  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9);
                  __Pyx_GIVEREF(__pyx_t_9);
                  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
                  __Pyx_GIVEREF(__pyx_t_1);
                  __pyx_t_3 = 0;
                  __pyx_t_9 = 0;
                  __pyx_t_1 = 0;
                  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_count); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
                  __Pyx_GOTREF(__pyx_t_2);
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_alt_germ, __pyx_n_s_count); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  if (__pyx_t_6) {

                    /* "SomVarIUS_calling.pyx":694
 * 							for i in xrange(1, len(possible_germs)):
 * 								if eval(possible_germs[i])['count'] > alt_germ['count']:
 * 									alt_germ = eval(possible_germs[i])             # <<<<<<<<<<<<<<
 * 						else:
 * 							alt_germ = eval(hap_alt)
 */
                    __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_possible_germs, __pyx_cur_scope->__pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
                    __Pyx_GOTREF(__pyx_t_9);
                    __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_1);
                    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_2);
                    __pyx_t_3 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_A); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_A, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_C); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_C, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_G); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_G, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_T); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_T, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_all_bed_chroms) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_all_bed_chroms, __pyx_cur_scope->__pyx_v_all_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_alnbase) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alnbase, __pyx_cur_scope->__pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_alt_allele) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_allele, __pyx_cur_scope->__pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_allele_freq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_count, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_alt_germ) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_alt_germ, __pyx_cur_scope->__pyx_v_alt_germ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_ba_to_bed) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ba_to_bed, __pyx_cur_scope->__pyx_v_ba_to_bed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_ba_to_fa) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ba_to_fa, __pyx_cur_scope->__pyx_v_ba_to_fa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_ba_to_hapmap) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ba_to_hapmap, __pyx_cur_scope->__pyx_v_ba_to_hapmap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_ba_to_rna) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ba_to_rna, __pyx_cur_scope->__pyx_v_ba_to_rna) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_baseq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_baseq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_bed_chroms) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bed_chroms, __pyx_cur_scope->__pyx_v_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_binom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_binom, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_chrom) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chrom, __pyx_cur_scope->__pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_chrom_dist) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chrom_dist, __pyx_cur_scope->__pyx_v_chrom_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_chrom_list) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chrom_list, __pyx_cur_scope->__pyx_v_chrom_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_chrom_record) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chrom_record, __pyx_cur_scope->__pyx_v_chrom_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_chrom_regions) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_chrom_regions, __pyx_cur_scope->__pyx_v_chrom_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_col)) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_col, ((PyObject *)__pyx_cur_scope->__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_copy_bed_name) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_bed_name, __pyx_cur_scope->__pyx_v_copy_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_copy_chrom) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_chrom, __pyx_cur_scope->__pyx_v_copy_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_end, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_copy_filter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_filter, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_copy_list) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_list, __pyx_cur_scope->__pyx_v_copy_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_list_pos, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_copy_record) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_record, __pyx_cur_scope->__pyx_v_copy_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_copy_regions) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_regions, __pyx_cur_scope->__pyx_v_copy_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_start); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy_start, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_counts) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_counts, __pyx_cur_scope->__pyx_v_counts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_dbsnp_bed_name) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_dbsnp_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_delta); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_delta, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_dist) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dist, __pyx_cur_scope->__pyx_v_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_dist_out) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dist_out, __pyx_cur_scope->__pyx_v_dist_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fafile, ((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_fafile_name) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fafile_name, __pyx_cur_scope->__pyx_v_fafile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_flag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_flag, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_fmt) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fmt, __pyx_cur_scope->__pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_forward); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_forward, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_fourth_allele) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fourth_allele, __pyx_cur_scope->__pyx_v_fourth_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_fourth_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fourth_count, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fwd_ratio, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_genome) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_genome, __pyx_cur_scope->__pyx_v_genome) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_hap_alt) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hap_alt, __pyx_cur_scope->__pyx_v_hap_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_hap_filter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hap_filter, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_hap_ref) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hap_ref, __pyx_cur_scope->__pyx_v_hap_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_hapmap_file) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hapmap_file, __pyx_cur_scope->__pyx_v_hapmap_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_hapmap_present); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hapmap_present, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_hapmap_record) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hapmap_record, __pyx_cur_scope->__pyx_v_hapmap_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_i, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_in_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_in_copy, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_proper_pair, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_reverse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_is_reverse, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_it) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_it, __pyx_cur_scope->__pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_labels) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_labels, __pyx_cur_scope->__pyx_v_labels) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_lengths) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_lengths, __pyx_cur_scope->__pyx_v_lengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_line) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_line, __pyx_cur_scope->__pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_maj_allele) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maj_allele, __pyx_cur_scope->__pyx_v_maj_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_maj_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maj_count, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mapq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_mapq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mean_mapq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_qual); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_mean_qual, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_af); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_af, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_baseq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_f_r); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_f_r, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_hetero); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_hetero, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_mapq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_pvalue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_pvalue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_qual); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_qual, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_reads, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_se); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_se, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_min_support, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_n, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_out_file) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out_file, __pyx_cur_scope->__pyx_v_out_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_pos); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pos, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_possible_germs) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_possible_germs, __pyx_cur_scope->__pyx_v_possible_germs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_hetero); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_prob_not_hetero, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_se); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_prob_not_se, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_pvalue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pvalue, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_ref_filter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ref_filter, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (__pyx_cur_scope->__pyx_v_refbase) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_refbase, __pyx_cur_scope->__pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_references) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_references, __pyx_cur_scope->__pyx_v_references) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_region_chrom) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_region_chrom, __pyx_cur_scope->__pyx_v_region_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_region_end) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_region_end, __pyx_cur_scope->__pyx_v_region_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_region_start) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_region_start, __pyx_cur_scope->__pyx_v_region_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_reverse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_reverse, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_rna_filter); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rna_filter, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rna_seq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rna_seq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rna_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_rna_seq_file_name) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rna_seq_file_name, __pyx_cur_scope->__pyx_v_rna_seq_file_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rnq_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rvs_ratio, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_samfile, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_samfile_name) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_samfile_name, __pyx_cur_scope->__pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_seen_chroms) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seen_chroms, __pyx_cur_scope->__pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_third_allele) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_third_allele, __pyx_cur_scope->__pyx_v_third_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_third_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_third_count, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_total_alleles); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_total_alleles, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_total_baseq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    if (__pyx_t_3) {
                      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_total_baseq, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_3);
                    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
                    __Pyx_GIVEREF(__pyx_t_9);
                    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
                    __Pyx_GIVEREF(__pyx_t_1);
                    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
                    __Pyx_GIVEREF(__pyx_t_2);
                    __pyx_t_9 = 0;
                    __pyx_t_1 = 0;
                    __pyx_t_2 = 0;
                    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                    __Pyx_GOTREF(__pyx_t_2);
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_alt_germ);
                    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_alt_germ, __pyx_t_2);
                    __Pyx_GIVEREF(__pyx_t_2);
                    __pyx_t_2 = 0;
                    goto __pyx_L60;
                  }
                  __pyx_L60:;
                }
                goto __pyx_L57;
              }
              /*else*/ {

                /* "SomVarIUS_calling.pyx":696
 * 									alt_germ = eval(possible_germs[i])
 * 						else:
 * 							alt_germ = eval(hap_alt)             # <<<<<<<<<<<<<<
 * 
 * 						if eval(hap_ref)['count'] > 0 and alt_germ['count'] > 0:
 */
                __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_A); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_A, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_C); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_C, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_G); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_G, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_T); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_T, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_all_bed_chroms) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_all_bed_chroms, __pyx_cur_scope->__pyx_v_all_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_alnbase) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alnbase, __pyx_cur_scope->__pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_alt_allele) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alt_allele, __pyx_cur_scope->__pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alt_allele_freq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alt_count, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_alt_germ) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alt_germ, __pyx_cur_scope->__pyx_v_alt_germ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_ba_to_bed) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ba_to_bed, __pyx_cur_scope->__pyx_v_ba_to_bed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_ba_to_fa) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ba_to_fa, __pyx_cur_scope->__pyx_v_ba_to_fa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_ba_to_hapmap) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ba_to_hapmap, __pyx_cur_scope->__pyx_v_ba_to_hapmap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_ba_to_rna) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ba_to_rna, __pyx_cur_scope->__pyx_v_ba_to_rna) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_baseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_baseq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_bed_chroms) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bed_chroms, __pyx_cur_scope->__pyx_v_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_binom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_binom, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_chrom) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom, __pyx_cur_scope->__pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_chrom_dist) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom_dist, __pyx_cur_scope->__pyx_v_chrom_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_chrom_list) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom_list, __pyx_cur_scope->__pyx_v_chrom_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_chrom_record) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom_record, __pyx_cur_scope->__pyx_v_chrom_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_chrom_regions) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_chrom_regions, __pyx_cur_scope->__pyx_v_chrom_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (((PyObject *)__pyx_cur_scope->__pyx_v_col)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_col, ((PyObject *)__pyx_cur_scope->__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_copy_bed_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_bed_name, __pyx_cur_scope->__pyx_v_copy_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_copy_chrom) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_chrom, __pyx_cur_scope->__pyx_v_copy_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_end); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_end, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_copy_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_filter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_copy_list) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_list, __pyx_cur_scope->__pyx_v_copy_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_list_pos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_copy_record) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_record, __pyx_cur_scope->__pyx_v_copy_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_copy_regions) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_regions, __pyx_cur_scope->__pyx_v_copy_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy_start, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_counts) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_counts, __pyx_cur_scope->__pyx_v_counts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_dbsnp_bed_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_dbsnp_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_delta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_delta, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_dist) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dist, __pyx_cur_scope->__pyx_v_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_dist_out) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dist_out, __pyx_cur_scope->__pyx_v_dist_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fafile, ((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_fafile_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fafile_name, __pyx_cur_scope->__pyx_v_fafile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_flag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_flag, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_fmt) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fmt, __pyx_cur_scope->__pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_forward); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_forward, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_fourth_allele) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fourth_allele, __pyx_cur_scope->__pyx_v_fourth_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_fourth_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fourth_count, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fwd_ratio, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_genome) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_genome, __pyx_cur_scope->__pyx_v_genome) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_hap_alt) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hap_alt, __pyx_cur_scope->__pyx_v_hap_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_hap_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hap_filter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_hap_ref) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hap_ref, __pyx_cur_scope->__pyx_v_hap_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_hapmap_file) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hapmap_file, __pyx_cur_scope->__pyx_v_hapmap_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_hapmap_present); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hapmap_present, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_hapmap_record) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hapmap_record, __pyx_cur_scope->__pyx_v_hapmap_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_i, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_in_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_in_copy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_proper_pair, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_reverse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_is_reverse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_it) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_it, __pyx_cur_scope->__pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_labels) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_labels, __pyx_cur_scope->__pyx_v_labels) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_lengths) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_lengths, __pyx_cur_scope->__pyx_v_lengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_line) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_line, __pyx_cur_scope->__pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_maj_allele) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_maj_allele, __pyx_cur_scope->__pyx_v_maj_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_maj_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_maj_count, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mapq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mean_mapq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_qual); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mean_qual, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_af); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_af, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_baseq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_f_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_f_r, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_hetero); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_hetero, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_mapq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_pvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_pvalue, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_qual); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_qual, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_reads, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_se); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_se, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_support, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_n, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_out_file) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_out_file, __pyx_cur_scope->__pyx_v_out_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pos, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_possible_germs) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_possible_germs, __pyx_cur_scope->__pyx_v_possible_germs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_hetero); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prob_not_hetero, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_se); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_prob_not_se, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_pvalue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_pvalue, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_ref_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ref_filter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (__pyx_cur_scope->__pyx_v_refbase) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_refbase, __pyx_cur_scope->__pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_references) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_references, __pyx_cur_scope->__pyx_v_references) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_region_chrom) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_region_chrom, __pyx_cur_scope->__pyx_v_region_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_region_end) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_region_end, __pyx_cur_scope->__pyx_v_region_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_region_start) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_region_start, __pyx_cur_scope->__pyx_v_region_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_reverse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_reverse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_rna_filter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rna_filter, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rna_seq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rna_seq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rna_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_rna_seq_file_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rna_seq_file_name, __pyx_cur_scope->__pyx_v_rna_seq_file_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rnq_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_rvs_ratio, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                if (((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_samfile, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_samfile_name) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_samfile_name, __pyx_cur_scope->__pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_seen_chroms) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_seen_chroms, __pyx_cur_scope->__pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                if (__pyx_cur_scope->__pyx_v_third_allele) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_third_allele, __pyx_cur_scope->__pyx_v_third_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_third_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_third_count, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_total_alleles); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_total_alleles, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_total_baseq); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                if (__pyx_t_1) {
                  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_total_baseq, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hap_alt);
                PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_hap_alt);
                __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hap_alt);
                PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_2);
                PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_3);
                __pyx_t_2 = 0;
                __pyx_t_3 = 0;
                __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alt_germ);
                __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alt_germ, __pyx_t_3);
                __Pyx_GIVEREF(__pyx_t_3);
                __pyx_t_3 = 0;
              }
              __pyx_L57:;

              /* "SomVarIUS_calling.pyx":698
 * 							alt_germ = eval(hap_alt)
 * 
 * 						if eval(hap_ref)['count'] > 0 and alt_germ['count'] > 0:             # <<<<<<<<<<<<<<
 * 							continue
 * 
 */
              __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_3);
              __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_2 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_A); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_A, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_C); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_C, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_G); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_G, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_T); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_T, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_all_bed_chroms) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_all_bed_chroms, __pyx_cur_scope->__pyx_v_all_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_alnbase) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alnbase, __pyx_cur_scope->__pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_alt_allele) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele, __pyx_cur_scope->__pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele_freq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_alt_germ) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_germ, __pyx_cur_scope->__pyx_v_alt_germ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_ba_to_bed) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_bed, __pyx_cur_scope->__pyx_v_ba_to_bed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_ba_to_fa) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_fa, __pyx_cur_scope->__pyx_v_ba_to_fa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_ba_to_hapmap) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_hapmap, __pyx_cur_scope->__pyx_v_ba_to_hapmap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_ba_to_rna) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_rna, __pyx_cur_scope->__pyx_v_ba_to_rna) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_baseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_baseq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_bed_chroms) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bed_chroms, __pyx_cur_scope->__pyx_v_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_binom); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_binom, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_chrom) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom, __pyx_cur_scope->__pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_chrom_dist) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_dist, __pyx_cur_scope->__pyx_v_chrom_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_chrom_list) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_list, __pyx_cur_scope->__pyx_v_chrom_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_chrom_record) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_record, __pyx_cur_scope->__pyx_v_chrom_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_chrom_regions) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_regions, __pyx_cur_scope->__pyx_v_chrom_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (((PyObject *)__pyx_cur_scope->__pyx_v_col)) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_col, ((PyObject *)__pyx_cur_scope->__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_copy_bed_name) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_bed_name, __pyx_cur_scope->__pyx_v_copy_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_copy_chrom) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_chrom, __pyx_cur_scope->__pyx_v_copy_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_end, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_copy_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_copy_list) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_list, __pyx_cur_scope->__pyx_v_copy_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_list_pos, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_copy_record) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_record, __pyx_cur_scope->__pyx_v_copy_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_copy_regions) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_regions, __pyx_cur_scope->__pyx_v_copy_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_start, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_counts) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_counts, __pyx_cur_scope->__pyx_v_counts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_dbsnp_bed_name) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_dbsnp_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_delta, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_dist) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dist, __pyx_cur_scope->__pyx_v_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_dist_out) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dist_out, __pyx_cur_scope->__pyx_v_dist_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fafile, ((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_fafile_name) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fafile_name, __pyx_cur_scope->__pyx_v_fafile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_flag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flag, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_fmt) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fmt, __pyx_cur_scope->__pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_forward); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_forward, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_fourth_allele) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fourth_allele, __pyx_cur_scope->__pyx_v_fourth_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_fourth_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fourth_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fwd_ratio, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_genome) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_genome, __pyx_cur_scope->__pyx_v_genome) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_hap_alt) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_alt, __pyx_cur_scope->__pyx_v_hap_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_hap_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_hap_ref) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_ref, __pyx_cur_scope->__pyx_v_hap_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_hapmap_file) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_file, __pyx_cur_scope->__pyx_v_hapmap_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_hapmap_present); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_present, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_hapmap_record) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_record, __pyx_cur_scope->__pyx_v_hapmap_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_in_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_in_copy, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_proper_pair, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_reverse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_reverse, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_it) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_it, __pyx_cur_scope->__pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_labels) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_labels, __pyx_cur_scope->__pyx_v_labels) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_lengths) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lengths, __pyx_cur_scope->__pyx_v_lengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_line) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_line, __pyx_cur_scope->__pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_maj_allele) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maj_allele, __pyx_cur_scope->__pyx_v_maj_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_maj_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maj_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mapq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_mapq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_qual); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_qual, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_af); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_af, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_baseq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_f_r); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_f_r, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_hetero); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_hetero, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_mapq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_pvalue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_pvalue, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_qual); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_qual, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_reads, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_se); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_se, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_support, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_n, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_out_file) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out_file, __pyx_cur_scope->__pyx_v_out_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pos, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_possible_germs) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_possible_germs, __pyx_cur_scope->__pyx_v_possible_germs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_hetero); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_not_hetero, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_se); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_not_se, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_pvalue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pvalue, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_ref_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ref_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (__pyx_cur_scope->__pyx_v_refbase) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_refbase, __pyx_cur_scope->__pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_references) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_references, __pyx_cur_scope->__pyx_v_references) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_region_chrom) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_chrom, __pyx_cur_scope->__pyx_v_region_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_region_end) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_end, __pyx_cur_scope->__pyx_v_region_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_region_start) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_start, __pyx_cur_scope->__pyx_v_region_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_reverse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reverse, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_rna_filter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_filter, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rna_seq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_rna_seq_file_name) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq_file_name, __pyx_cur_scope->__pyx_v_rna_seq_file_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rnq_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rvs_ratio, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_samfile_name) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile_name, __pyx_cur_scope->__pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_seen_chroms) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seen_chroms, __pyx_cur_scope->__pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              if (__pyx_cur_scope->__pyx_v_third_allele) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_third_allele, __pyx_cur_scope->__pyx_v_third_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_third_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_third_count, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_total_alleles); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_alleles, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_total_baseq); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (__pyx_t_2) {
                if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_baseq, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              }
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hap_ref);
              PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_hap_ref);
              __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hap_ref);
              PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_3);
              PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_1);
              __pyx_t_3 = 0;
              __pyx_t_1 = 0;
              __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_count); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              if (__pyx_t_7) {
              } else {
                __pyx_t_6 = __pyx_t_7;
                goto __pyx_L62_bool_binop_done;
              }
              __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_alt_germ, __pyx_n_s_count); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;};
              __Pyx_GOTREF(__pyx_t_1);
              __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L47_error;}
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_6 = __pyx_t_7;
              __pyx_L62_bool_binop_done:;
              if (__pyx_t_6) {

                /* "SomVarIUS_calling.pyx":699
 * 
 * 						if eval(hap_ref)['count'] > 0 and alt_germ['count'] > 0:
 * 							continue             # <<<<<<<<<<<<<<
 * 
 * 					except KeyError:
 */
                goto __pyx_L53_try_continue;
              }
            }
            __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
            goto __pyx_L54_try_end;
            __pyx_L47_error:;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "SomVarIUS_calling.pyx":701
 * 							continue
 * 
 * 					except KeyError:             # <<<<<<<<<<<<<<
 * 						pass
 * 
 */
            __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
            if (__pyx_t_14) {
              PyErr_Restore(0,0,0);
              goto __pyx_L48_exception_handled;
            }
            goto __pyx_L49_except_error;
            __pyx_L49_except_error:;
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            goto __pyx_L1_error;
            __pyx_L53_try_continue:;
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            goto __pyx_L32_continue;
            __pyx_L48_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __pyx_L54_try_end:;
          }
          goto __pyx_L46;
        }
        __pyx_L46:;

        /* "SomVarIUS_calling.pyx":704
 * 						pass
 * 
 * 				counts, labels = get_highest(A.count,T.count,G.count,C.count)             # <<<<<<<<<<<<<<
 * 				maj_allele = labels[0]
 * 				maj_count = counts[0]
 */
        __pyx_t_2 = __pyx_f_17SomVarIUS_calling_get_highest(__pyx_cur_scope->__pyx_v_A.count, __pyx_cur_scope->__pyx_v_T.count, __pyx_cur_scope->__pyx_v_G.count, __pyx_cur_scope->__pyx_v_C.count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        if (likely(__pyx_t_2 != Py_None)) {
          PyObject* sequence = __pyx_t_2;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          #else
          __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          #endif
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        } else {
          __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_counts);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_counts, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_labels);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_labels, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

        /* "SomVarIUS_calling.pyx":705
 * 
 * 				counts, labels = get_highest(A.count,T.count,G.count,C.count)
 * 				maj_allele = labels[0]             # <<<<<<<<<<<<<<
 * 				maj_count = counts[0]
 * 				alt_allele = labels[1]
 */
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_labels, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_maj_allele);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_maj_allele, ((PyObject*)__pyx_t_2));
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;

        /* "SomVarIUS_calling.pyx":706
 * 				counts, labels = get_highest(A.count,T.count,G.count,C.count)
 * 				maj_allele = labels[0]
 * 				maj_count = counts[0]             # <<<<<<<<<<<<<<
 * 				alt_allele = labels[1]
 * 				alt_count = counts[1]
 */
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_counts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_cur_scope->__pyx_v_maj_count = __pyx_t_14;

        /* "SomVarIUS_calling.pyx":707
 * 				maj_allele = labels[0]
 * 				maj_count = counts[0]
 * 				alt_allele = labels[1]             # <<<<<<<<<<<<<<
 * 				alt_count = counts[1]
 * 				if maj_count != alt_count:
 */
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_labels, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alt_allele);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_alt_allele, ((PyObject*)__pyx_t_2));
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;

        /* "SomVarIUS_calling.pyx":708
 * 				maj_count = counts[0]
 * 				alt_allele = labels[1]
 * 				alt_count = counts[1]             # <<<<<<<<<<<<<<
 * 				if maj_count != alt_count:
 * 					if A.pres+T.pres+G.pres+C.pres > 2:
 */
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_counts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_cur_scope->__pyx_v_alt_count = __pyx_t_14;

        /* "SomVarIUS_calling.pyx":709
 * 				alt_allele = labels[1]
 * 				alt_count = counts[1]
 * 				if maj_count != alt_count:             # <<<<<<<<<<<<<<
 * 					if A.pres+T.pres+G.pres+C.pres > 2:
 * 						third_allele = labels[2]
 */
        __pyx_t_6 = ((__pyx_cur_scope->__pyx_v_maj_count != __pyx_cur_scope->__pyx_v_alt_count) != 0);
        if (__pyx_t_6) {

          /* "SomVarIUS_calling.pyx":710
 * 				alt_count = counts[1]
 * 				if maj_count != alt_count:
 * 					if A.pres+T.pres+G.pres+C.pres > 2:             # <<<<<<<<<<<<<<
 * 						third_allele = labels[2]
 * 						third_count = counts[2]
 */
          __pyx_t_6 = (((((__pyx_cur_scope->__pyx_v_A.pres + __pyx_cur_scope->__pyx_v_T.pres) + __pyx_cur_scope->__pyx_v_G.pres) + __pyx_cur_scope->__pyx_v_C.pres) > 2) != 0);
          if (__pyx_t_6) {

            /* "SomVarIUS_calling.pyx":711
 * 				if maj_count != alt_count:
 * 					if A.pres+T.pres+G.pres+C.pres > 2:
 * 						third_allele = labels[2]             # <<<<<<<<<<<<<<
 * 						third_count = counts[2]
 * 						fourth_allele = labels[3]
 */
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_labels, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_2);
            if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_third_allele);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_third_allele, ((PyObject*)__pyx_t_2));
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_2 = 0;

            /* "SomVarIUS_calling.pyx":712
 * 					if A.pres+T.pres+G.pres+C.pres > 2:
 * 						third_allele = labels[2]
 * 						third_count = counts[2]             # <<<<<<<<<<<<<<
 * 						fourth_allele = labels[3]
 * 						fourth_count = counts[3]
 */
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_counts, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_cur_scope->__pyx_v_third_count = __pyx_t_14;

            /* "SomVarIUS_calling.pyx":713
 * 						third_allele = labels[2]
 * 						third_count = counts[2]
 * 						fourth_allele = labels[3]             # <<<<<<<<<<<<<<
 * 						fourth_count = counts[3]
 * 						if third_count == alt_count:
 */
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_labels, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_2);
            if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fourth_allele);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_fourth_allele, ((PyObject*)__pyx_t_2));
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_2 = 0;

            /* "SomVarIUS_calling.pyx":714
 * 						third_count = counts[2]
 * 						fourth_allele = labels[3]
 * 						fourth_count = counts[3]             # <<<<<<<<<<<<<<
 * 						if third_count == alt_count:
 * 							alt_allele, alt_count = multi_alleles(alt_allele, third_allele, fourth_allele,
 */
            __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_counts, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_cur_scope->__pyx_v_fourth_count = __pyx_t_14;

            /* "SomVarIUS_calling.pyx":715
 * 						fourth_allele = labels[3]
 * 						fourth_count = counts[3]
 * 						if third_count == alt_count:             # <<<<<<<<<<<<<<
 * 							alt_allele, alt_count = multi_alleles(alt_allele, third_allele, fourth_allele,
 * 													A, T, G, C, alt_count, third_count, fourth_count)
 */
            __pyx_t_6 = ((__pyx_cur_scope->__pyx_v_third_count == __pyx_cur_scope->__pyx_v_alt_count) != 0);
            if (__pyx_t_6) {

              /* "SomVarIUS_calling.pyx":716
 * 						fourth_count = counts[3]
 * 						if third_count == alt_count:
 * 							alt_allele, alt_count = multi_alleles(alt_allele, third_allele, fourth_allele,             # <<<<<<<<<<<<<<
 * 													A, T, G, C, alt_count, third_count, fourth_count)
 * 					if alt_allele == 'A':
 */
              __pyx_t_2 = __pyx_f_17SomVarIUS_calling_multi_alleles(__pyx_cur_scope->__pyx_v_alt_allele, __pyx_cur_scope->__pyx_v_third_allele, __pyx_cur_scope->__pyx_v_fourth_allele, __pyx_cur_scope->__pyx_v_A, __pyx_cur_scope->__pyx_v_T, __pyx_cur_scope->__pyx_v_G, __pyx_cur_scope->__pyx_v_C, __pyx_cur_scope->__pyx_v_alt_count, __pyx_cur_scope->__pyx_v_third_count, __pyx_cur_scope->__pyx_v_fourth_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_2);
              if (likely(__pyx_t_2 != Py_None)) {
                PyObject* sequence = __pyx_t_2;
                #if CYTHON_COMPILING_IN_CPYTHON
                Py_ssize_t size = Py_SIZE(sequence);
                #else
                Py_ssize_t size = PySequence_Size(sequence);
                #endif
                if (unlikely(size != 2)) {
                  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
                __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_1);
                #else
                __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_3);
                __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_1);
                #endif
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              } else {
                __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_alt_allele);
              __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_alt_allele, ((PyObject*)__pyx_t_3));
              __Pyx_GIVEREF(__pyx_t_3);
              __pyx_t_3 = 0;
              __pyx_cur_scope->__pyx_v_alt_count = __pyx_t_14;
              goto __pyx_L66;
            }
            __pyx_L66:;
            goto __pyx_L65;
          }
          __pyx_L65:;

          /* "SomVarIUS_calling.pyx":718
 * 							alt_allele, alt_count = multi_alleles(alt_allele, third_allele, fourth_allele,
 * 													A, T, G, C, alt_count, third_count, fourth_count)
 * 					if alt_allele == 'A':             # <<<<<<<<<<<<<<
 * 						mean_mapq = A.mapqual / float(A.count)
 * 						mean_qual = A.qual / A.count
 */
          __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_alt_allele, __pyx_n_s_A, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_7 = (__pyx_t_6 != 0);
          if (__pyx_t_7) {

            /* "SomVarIUS_calling.pyx":719
 * 													A, T, G, C, alt_count, third_count, fourth_count)
 * 					if alt_allele == 'A':
 * 						mean_mapq = A.mapqual / float(A.count)             # <<<<<<<<<<<<<<
 * 						mean_qual = A.qual / A.count
 * 						fwd_ratio = A.fwd / float(A.fwd+A.rev)
 */
            if (unlikely(((double)__pyx_cur_scope->__pyx_v_A.count) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_mean_mapq = (__pyx_cur_scope->__pyx_v_A.mapqual / ((double)__pyx_cur_scope->__pyx_v_A.count));

            /* "SomVarIUS_calling.pyx":720
 * 					if alt_allele == 'A':
 * 						mean_mapq = A.mapqual / float(A.count)
 * 						mean_qual = A.qual / A.count             # <<<<<<<<<<<<<<
 * 						fwd_ratio = A.fwd / float(A.fwd+A.rev)
 * 						rvs_ratio = A.rev / float(A.fwd+A.rev)
 */
            if (unlikely(__pyx_cur_scope->__pyx_v_A.count == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_mean_qual = (__pyx_cur_scope->__pyx_v_A.qual / __pyx_cur_scope->__pyx_v_A.count);

            /* "SomVarIUS_calling.pyx":721
 * 						mean_mapq = A.mapqual / float(A.count)
 * 						mean_qual = A.qual / A.count
 * 						fwd_ratio = A.fwd / float(A.fwd+A.rev)             # <<<<<<<<<<<<<<
 * 						rvs_ratio = A.rev / float(A.fwd+A.rev)
 * 					elif alt_allele == 'T':
 */
            if (unlikely(((double)(__pyx_cur_scope->__pyx_v_A.fwd + __pyx_cur_scope->__pyx_v_A.rev)) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_fwd_ratio = (__pyx_cur_scope->__pyx_v_A.fwd / ((double)(__pyx_cur_scope->__pyx_v_A.fwd + __pyx_cur_scope->__pyx_v_A.rev)));

            /* "SomVarIUS_calling.pyx":722
 * 						mean_qual = A.qual / A.count
 * 						fwd_ratio = A.fwd / float(A.fwd+A.rev)
 * 						rvs_ratio = A.rev / float(A.fwd+A.rev)             # <<<<<<<<<<<<<<
 * 					elif alt_allele == 'T':
 * 						mean_mapq = T.mapqual / float(T.count)
 */
            if (unlikely(((double)(__pyx_cur_scope->__pyx_v_A.fwd + __pyx_cur_scope->__pyx_v_A.rev)) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_rvs_ratio = (__pyx_cur_scope->__pyx_v_A.rev / ((double)(__pyx_cur_scope->__pyx_v_A.fwd + __pyx_cur_scope->__pyx_v_A.rev)));
            goto __pyx_L67;
          }

          /* "SomVarIUS_calling.pyx":723
 * 						fwd_ratio = A.fwd / float(A.fwd+A.rev)
 * 						rvs_ratio = A.rev / float(A.fwd+A.rev)
 * 					elif alt_allele == 'T':             # <<<<<<<<<<<<<<
 * 						mean_mapq = T.mapqual / float(T.count)
 * 						mean_qual = T.qual / T.count
 */
          __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_alt_allele, __pyx_n_s_T, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_6 = (__pyx_t_7 != 0);
          if (__pyx_t_6) {

            /* "SomVarIUS_calling.pyx":724
 * 						rvs_ratio = A.rev / float(A.fwd+A.rev)
 * 					elif alt_allele == 'T':
 * 						mean_mapq = T.mapqual / float(T.count)             # <<<<<<<<<<<<<<
 * 						mean_qual = T.qual / T.count
 * 						fwd_ratio = T.fwd / float(T.fwd+T.rev)
 */
            if (unlikely(((double)__pyx_cur_scope->__pyx_v_T.count) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_mean_mapq = (__pyx_cur_scope->__pyx_v_T.mapqual / ((double)__pyx_cur_scope->__pyx_v_T.count));

            /* "SomVarIUS_calling.pyx":725
 * 					elif alt_allele == 'T':
 * 						mean_mapq = T.mapqual / float(T.count)
 * 						mean_qual = T.qual / T.count             # <<<<<<<<<<<<<<
 * 						fwd_ratio = T.fwd / float(T.fwd+T.rev)
 * 						rvs_ratio = T.rev / float(T.fwd+T.rev)
 */
            if (unlikely(__pyx_cur_scope->__pyx_v_T.count == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_mean_qual = (__pyx_cur_scope->__pyx_v_T.qual / __pyx_cur_scope->__pyx_v_T.count);

            /* "SomVarIUS_calling.pyx":726
 * 						mean_mapq = T.mapqual / float(T.count)
 * 						mean_qual = T.qual / T.count
 * 						fwd_ratio = T.fwd / float(T.fwd+T.rev)             # <<<<<<<<<<<<<<
 * 						rvs_ratio = T.rev / float(T.fwd+T.rev)
 * 					elif alt_allele == 'G':
 */
            if (unlikely(((double)(__pyx_cur_scope->__pyx_v_T.fwd + __pyx_cur_scope->__pyx_v_T.rev)) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_fwd_ratio = (__pyx_cur_scope->__pyx_v_T.fwd / ((double)(__pyx_cur_scope->__pyx_v_T.fwd + __pyx_cur_scope->__pyx_v_T.rev)));

            /* "SomVarIUS_calling.pyx":727
 * 						mean_qual = T.qual / T.count
 * 						fwd_ratio = T.fwd / float(T.fwd+T.rev)
 * 						rvs_ratio = T.rev / float(T.fwd+T.rev)             # <<<<<<<<<<<<<<
 * 					elif alt_allele == 'G':
 * 						mean_mapq = G.mapqual / float(G.count)
 */
            if (unlikely(((double)(__pyx_cur_scope->__pyx_v_T.fwd + __pyx_cur_scope->__pyx_v_T.rev)) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_rvs_ratio = (__pyx_cur_scope->__pyx_v_T.rev / ((double)(__pyx_cur_scope->__pyx_v_T.fwd + __pyx_cur_scope->__pyx_v_T.rev)));
            goto __pyx_L67;
          }

          /* "SomVarIUS_calling.pyx":728
 * 						fwd_ratio = T.fwd / float(T.fwd+T.rev)
 * 						rvs_ratio = T.rev / float(T.fwd+T.rev)
 * 					elif alt_allele == 'G':             # <<<<<<<<<<<<<<
 * 						mean_mapq = G.mapqual / float(G.count)
 * 						mean_qual = G.qual / G.count
 */
          __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_alt_allele, __pyx_n_s_G, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_7 = (__pyx_t_6 != 0);
          if (__pyx_t_7) {

            /* "SomVarIUS_calling.pyx":729
 * 						rvs_ratio = T.rev / float(T.fwd+T.rev)
 * 					elif alt_allele == 'G':
 * 						mean_mapq = G.mapqual / float(G.count)             # <<<<<<<<<<<<<<
 * 						mean_qual = G.qual / G.count
 * 						fwd_ratio = G.fwd / float(G.fwd+G.rev)
 */
            if (unlikely(((double)__pyx_cur_scope->__pyx_v_G.count) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_mean_mapq = (__pyx_cur_scope->__pyx_v_G.mapqual / ((double)__pyx_cur_scope->__pyx_v_G.count));

            /* "SomVarIUS_calling.pyx":730
 * 					elif alt_allele == 'G':
 * 						mean_mapq = G.mapqual / float(G.count)
 * 						mean_qual = G.qual / G.count             # <<<<<<<<<<<<<<
 * 						fwd_ratio = G.fwd / float(G.fwd+G.rev)
 * 						rvs_ratio = G.rev / float(G.fwd+G.rev)
 */
            if (unlikely(__pyx_cur_scope->__pyx_v_G.count == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_mean_qual = (__pyx_cur_scope->__pyx_v_G.qual / __pyx_cur_scope->__pyx_v_G.count);

            /* "SomVarIUS_calling.pyx":731
 * 						mean_mapq = G.mapqual / float(G.count)
 * 						mean_qual = G.qual / G.count
 * 						fwd_ratio = G.fwd / float(G.fwd+G.rev)             # <<<<<<<<<<<<<<
 * 						rvs_ratio = G.rev / float(G.fwd+G.rev)
 * 					elif alt_allele == 'C':
 */
            if (unlikely(((double)(__pyx_cur_scope->__pyx_v_G.fwd + __pyx_cur_scope->__pyx_v_G.rev)) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_fwd_ratio = (__pyx_cur_scope->__pyx_v_G.fwd / ((double)(__pyx_cur_scope->__pyx_v_G.fwd + __pyx_cur_scope->__pyx_v_G.rev)));

            /* "SomVarIUS_calling.pyx":732
 * 						mean_qual = G.qual / G.count
 * 						fwd_ratio = G.fwd / float(G.fwd+G.rev)
 * 						rvs_ratio = G.rev / float(G.fwd+G.rev)             # <<<<<<<<<<<<<<
 * 					elif alt_allele == 'C':
 * 						mean_mapq = C.mapqual / float(C.count)
 */
            if (unlikely(((double)(__pyx_cur_scope->__pyx_v_G.fwd + __pyx_cur_scope->__pyx_v_G.rev)) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_rvs_ratio = (__pyx_cur_scope->__pyx_v_G.rev / ((double)(__pyx_cur_scope->__pyx_v_G.fwd + __pyx_cur_scope->__pyx_v_G.rev)));
            goto __pyx_L67;
          }

          /* "SomVarIUS_calling.pyx":733
 * 						fwd_ratio = G.fwd / float(G.fwd+G.rev)
 * 						rvs_ratio = G.rev / float(G.fwd+G.rev)
 * 					elif alt_allele == 'C':             # <<<<<<<<<<<<<<
 * 						mean_mapq = C.mapqual / float(C.count)
 * 						mean_qual = C.qual / C.count
 */
          __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_alt_allele, __pyx_n_s_C, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_6 = (__pyx_t_7 != 0);
          if (__pyx_t_6) {

            /* "SomVarIUS_calling.pyx":734
 * 						rvs_ratio = G.rev / float(G.fwd+G.rev)
 * 					elif alt_allele == 'C':
 * 						mean_mapq = C.mapqual / float(C.count)             # <<<<<<<<<<<<<<
 * 						mean_qual = C.qual / C.count
 * 						fwd_ratio = C.fwd / float(C.fwd+C.rev)
 */
            if (unlikely(((double)__pyx_cur_scope->__pyx_v_C.count) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_mean_mapq = (__pyx_cur_scope->__pyx_v_C.mapqual / ((double)__pyx_cur_scope->__pyx_v_C.count));

            /* "SomVarIUS_calling.pyx":735
 * 					elif alt_allele == 'C':
 * 						mean_mapq = C.mapqual / float(C.count)
 * 						mean_qual = C.qual / C.count             # <<<<<<<<<<<<<<
 * 						fwd_ratio = C.fwd / float(C.fwd+C.rev)
 * 						rvs_ratio = C.rev / float(C.fwd+C.rev)
 */
            if (unlikely(__pyx_cur_scope->__pyx_v_C.count == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_mean_qual = (__pyx_cur_scope->__pyx_v_C.qual / __pyx_cur_scope->__pyx_v_C.count);

            /* "SomVarIUS_calling.pyx":736
 * 						mean_mapq = C.mapqual / float(C.count)
 * 						mean_qual = C.qual / C.count
 * 						fwd_ratio = C.fwd / float(C.fwd+C.rev)             # <<<<<<<<<<<<<<
 * 						rvs_ratio = C.rev / float(C.fwd+C.rev)
 * 
 */
            if (unlikely(((double)(__pyx_cur_scope->__pyx_v_C.fwd + __pyx_cur_scope->__pyx_v_C.rev)) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_fwd_ratio = (__pyx_cur_scope->__pyx_v_C.fwd / ((double)(__pyx_cur_scope->__pyx_v_C.fwd + __pyx_cur_scope->__pyx_v_C.rev)));

            /* "SomVarIUS_calling.pyx":737
 * 						mean_qual = C.qual / C.count
 * 						fwd_ratio = C.fwd / float(C.fwd+C.rev)
 * 						rvs_ratio = C.rev / float(C.fwd+C.rev)             # <<<<<<<<<<<<<<
 * 
 * 					if alt_count >= min_support and fwd_ratio >= min_f_r and rvs_ratio >= min_f_r and mean_qual >= min_qual and mean_mapq >= min_mapq:
 */
            if (unlikely(((double)(__pyx_cur_scope->__pyx_v_C.fwd + __pyx_cur_scope->__pyx_v_C.rev)) == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_rvs_ratio = (__pyx_cur_scope->__pyx_v_C.rev / ((double)(__pyx_cur_scope->__pyx_v_C.fwd + __pyx_cur_scope->__pyx_v_C.rev)));
            goto __pyx_L67;
          }
          __pyx_L67:;

          /* "SomVarIUS_calling.pyx":739
 * 						rvs_ratio = C.rev / float(C.fwd+C.rev)
 * 
 * 					if alt_count >= min_support and fwd_ratio >= min_f_r and rvs_ratio >= min_f_r and mean_qual >= min_qual and mean_mapq >= min_mapq:             # <<<<<<<<<<<<<<
 * 						total_baseq = fmax(1e-25,total_baseq)
 * 						delta = (alt_count/total_baseq) - 1
 */
          __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_alt_count >= __pyx_cur_scope->__pyx_v_min_support) != 0);
          if (__pyx_t_7) {
          } else {
            __pyx_t_6 = __pyx_t_7;
            goto __pyx_L69_bool_binop_done;
          }
          __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_fwd_ratio >= __pyx_cur_scope->__pyx_v_min_f_r) != 0);
          if (__pyx_t_7) {
          } else {
            __pyx_t_6 = __pyx_t_7;
            goto __pyx_L69_bool_binop_done;
          }
          __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_rvs_ratio >= __pyx_cur_scope->__pyx_v_min_f_r) != 0);
          if (__pyx_t_7) {
          } else {
            __pyx_t_6 = __pyx_t_7;
            goto __pyx_L69_bool_binop_done;
          }
          __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_mean_qual >= __pyx_cur_scope->__pyx_v_min_qual) != 0);
          if (__pyx_t_7) {
          } else {
            __pyx_t_6 = __pyx_t_7;
            goto __pyx_L69_bool_binop_done;
          }
          __pyx_t_7 = ((__pyx_cur_scope->__pyx_v_mean_mapq >= __pyx_cur_scope->__pyx_v_min_mapq) != 0);
          __pyx_t_6 = __pyx_t_7;
          __pyx_L69_bool_binop_done:;
          if (__pyx_t_6) {

            /* "SomVarIUS_calling.pyx":740
 * 
 * 					if alt_count >= min_support and fwd_ratio >= min_f_r and rvs_ratio >= min_f_r and mean_qual >= min_qual and mean_mapq >= min_mapq:
 * 						total_baseq = fmax(1e-25,total_baseq)             # <<<<<<<<<<<<<<
 * 						delta = (alt_count/total_baseq) - 1
 * 						total_alleles = A.count+T.count+C.count+G.count
 */
            __pyx_cur_scope->__pyx_v_total_baseq = fmax(1e-25, __pyx_cur_scope->__pyx_v_total_baseq);

            /* "SomVarIUS_calling.pyx":741
 * 					if alt_count >= min_support and fwd_ratio >= min_f_r and rvs_ratio >= min_f_r and mean_qual >= min_qual and mean_mapq >= min_mapq:
 * 						total_baseq = fmax(1e-25,total_baseq)
 * 						delta = (alt_count/total_baseq) - 1             # <<<<<<<<<<<<<<
 * 						total_alleles = A.count+T.count+C.count+G.count
 * 						if copy_filter:
 */
            if (unlikely(__pyx_cur_scope->__pyx_v_total_baseq == 0)) {
              #ifdef WITH_THREAD
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
              #endif
              PyErr_SetString(PyExc_ZeroDivisionError, "float division");
              #ifdef WITH_THREAD
              PyGILState_Release(__pyx_gilstate_save);
              #endif
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_cur_scope->__pyx_v_delta = ((__pyx_cur_scope->__pyx_v_alt_count / __pyx_cur_scope->__pyx_v_total_baseq) - 1.0);

            /* "SomVarIUS_calling.pyx":742
 * 						total_baseq = fmax(1e-25,total_baseq)
 * 						delta = (alt_count/total_baseq) - 1
 * 						total_alleles = A.count+T.count+C.count+G.count             # <<<<<<<<<<<<<<
 * 						if copy_filter:
 * 							if copy_chrom == chrom and pos >= copy_start and pos <= copy_end:
 */
            __pyx_cur_scope->__pyx_v_total_alleles = (((__pyx_cur_scope->__pyx_v_A.count + __pyx_cur_scope->__pyx_v_T.count) + __pyx_cur_scope->__pyx_v_C.count) + __pyx_cur_scope->__pyx_v_G.count);

            /* "SomVarIUS_calling.pyx":743
 * 						delta = (alt_count/total_baseq) - 1
 * 						total_alleles = A.count+T.count+C.count+G.count
 * 						if copy_filter:             # <<<<<<<<<<<<<<
 * 							if copy_chrom == chrom and pos >= copy_start and pos <= copy_end:
 * 								in_copy = True
 */
            __pyx_t_6 = (__pyx_cur_scope->__pyx_v_copy_filter != 0);
            if (__pyx_t_6) {

              /* "SomVarIUS_calling.pyx":744
 * 						total_alleles = A.count+T.count+C.count+G.count
 * 						if copy_filter:
 * 							if copy_chrom == chrom and pos >= copy_start and pos <= copy_end:             # <<<<<<<<<<<<<<
 * 								in_copy = True
 * 							elif copy_list_pos >= (len(copy_list)-1):
 */
              __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_copy_chrom, __pyx_cur_scope->__pyx_v_chrom, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __pyx_t_23 = (__pyx_t_7 != 0);
              if (__pyx_t_23) {
              } else {
                __pyx_t_6 = __pyx_t_23;
                goto __pyx_L76_bool_binop_done;
              }
              __pyx_t_23 = ((__pyx_cur_scope->__pyx_v_pos >= __pyx_cur_scope->__pyx_v_copy_start) != 0);
              if (__pyx_t_23) {
              } else {
                __pyx_t_6 = __pyx_t_23;
                goto __pyx_L76_bool_binop_done;
              }
              __pyx_t_23 = ((__pyx_cur_scope->__pyx_v_pos <= __pyx_cur_scope->__pyx_v_copy_end) != 0);
              __pyx_t_6 = __pyx_t_23;
              __pyx_L76_bool_binop_done:;
              if (__pyx_t_6) {

                /* "SomVarIUS_calling.pyx":745
 * 						if copy_filter:
 * 							if copy_chrom == chrom and pos >= copy_start and pos <= copy_end:
 * 								in_copy = True             # <<<<<<<<<<<<<<
 * 							elif copy_list_pos >= (len(copy_list)-1):
 * 								in_copy = False
 */
                __pyx_cur_scope->__pyx_v_in_copy = 1;
                goto __pyx_L75;
              }

              /* "SomVarIUS_calling.pyx":746
 * 							if copy_chrom == chrom and pos >= copy_start and pos <= copy_end:
 * 								in_copy = True
 * 							elif copy_list_pos >= (len(copy_list)-1):             # <<<<<<<<<<<<<<
 * 								in_copy = False
 * 							else:
 */
              if (unlikely(__pyx_cur_scope->__pyx_v_copy_list == Py_None)) {
                PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              __pyx_t_5 = PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_copy_list); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __pyx_t_6 = ((__pyx_cur_scope->__pyx_v_copy_list_pos >= (__pyx_t_5 - 1)) != 0);
              if (__pyx_t_6) {

                /* "SomVarIUS_calling.pyx":747
 * 								in_copy = True
 * 							elif copy_list_pos >= (len(copy_list)-1):
 * 								in_copy = False             # <<<<<<<<<<<<<<
 * 							else:
 * 								copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy = track_copy_pos(ba_to_bed[chrom],
 */
                __pyx_cur_scope->__pyx_v_in_copy = 0;
                goto __pyx_L75;
              }
              /*else*/ {

                /* "SomVarIUS_calling.pyx":749
 * 								in_copy = False
 * 							else:
 * 								copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy = track_copy_pos(ba_to_bed[chrom],             # <<<<<<<<<<<<<<
 * 																										pos, copy_list, seen_chroms,
 * 																										copy_list_pos)
 */
                if (unlikely(__pyx_cur_scope->__pyx_v_ba_to_bed == Py_None)) {
                  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_ba_to_bed, __pyx_cur_scope->__pyx_v_chrom); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
                __Pyx_GOTREF(__pyx_t_2);
                if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

                /* "SomVarIUS_calling.pyx":751
 * 								copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy = track_copy_pos(ba_to_bed[chrom],
 * 																										pos, copy_list, seen_chroms,
 * 																										copy_list_pos)             # <<<<<<<<<<<<<<
 * 						else:
 * 							in_copy = False
 */
                __pyx_t_1 = __pyx_f_17SomVarIUS_calling_track_copy_pos(((PyObject*)__pyx_t_2), __pyx_cur_scope->__pyx_v_pos, __pyx_cur_scope->__pyx_v_copy_list, __pyx_cur_scope->__pyx_v_seen_chroms, __pyx_cur_scope->__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                if (likely(__pyx_t_1 != Py_None)) {
                  PyObject* sequence = __pyx_t_1;
                  #if CYTHON_COMPILING_IN_CPYTHON
                  Py_ssize_t size = Py_SIZE(sequence);
                  #else
                  Py_ssize_t size = PySequence_Size(sequence);
                  #endif
                  if (unlikely(size != 6)) {
                    if (size > 6) __Pyx_RaiseTooManyValuesError(6);
                    else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  #if CYTHON_COMPILING_IN_CPYTHON
                  __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
                  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
                  __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); 
                  __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3); 
                  __pyx_t_13 = PyTuple_GET_ITEM(sequence, 4); 
                  __pyx_t_24 = PyTuple_GET_ITEM(sequence, 5); 
                  __Pyx_INCREF(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_3);
                  __Pyx_INCREF(__pyx_t_9);
                  __Pyx_INCREF(__pyx_t_12);
                  __Pyx_INCREF(__pyx_t_13);
                  __Pyx_INCREF(__pyx_t_24);
                  #else
                  {
                    Py_ssize_t i;
                    PyObject** temps[6] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_9,&__pyx_t_12,&__pyx_t_13,&__pyx_t_24};
                    for (i=0; i < 6; i++) {
                      PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                      __Pyx_GOTREF(item);
                      *(temps[i]) = item;
                    }
                  }
                  #endif
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                } else {
                  __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }

                /* "SomVarIUS_calling.pyx":749
 * 								in_copy = False
 * 							else:
 * 								copy_chrom, copy_start, copy_end, copy_list_pos, seen_chroms, in_copy = track_copy_pos(ba_to_bed[chrom],             # <<<<<<<<<<<<<<
 * 																										pos, copy_list, seen_chroms,
 * 																										copy_list_pos)
 */
                if (!(likely(PyString_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __pyx_t_25 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_25 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __pyx_t_26 = __Pyx_PyInt_As_int(__pyx_t_12); if (unlikely((__pyx_t_26 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                if (!(likely(PySet_CheckExact(__pyx_t_13))||((__pyx_t_13) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_t_13)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_24); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_copy_chrom);
                __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_copy_chrom, ((PyObject*)__pyx_t_2));
                __Pyx_GIVEREF(__pyx_t_2);
                __pyx_t_2 = 0;
                __pyx_cur_scope->__pyx_v_copy_start = __pyx_t_14;
                __pyx_cur_scope->__pyx_v_copy_end = __pyx_t_25;
                __pyx_cur_scope->__pyx_v_copy_list_pos = __pyx_t_26;
                __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_seen_chroms);
                __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_seen_chroms, ((PyObject*)__pyx_t_13));
                __Pyx_GIVEREF(__pyx_t_13);
                __pyx_t_13 = 0;
                __pyx_cur_scope->__pyx_v_in_copy = __pyx_t_6;
              }
              __pyx_L75:;
              goto __pyx_L74;
            }
            /*else*/ {

              /* "SomVarIUS_calling.pyx":753
 * 																										copy_list_pos)
 * 						else:
 * 							in_copy = False             # <<<<<<<<<<<<<<
 * 						pvalue, prob_not_se, prob_not_hetero = chernoff(total_baseq, delta, alt_count,
 * 																total_alleles, min_se, min_hetero, pos,
 */
              __pyx_cur_scope->__pyx_v_in_copy = 0;
            }
            __pyx_L74:;

            /* "SomVarIUS_calling.pyx":754
 * 						else:
 * 							in_copy = False
 * 						pvalue, prob_not_se, prob_not_hetero = chernoff(total_baseq, delta, alt_count,             # <<<<<<<<<<<<<<
 * 																total_alleles, min_se, min_hetero, pos,
 * 																chrom, copy_filter, copy_list, ba_to_bed,
 */
            __pyx_t_1 = __pyx_f_17SomVarIUS_calling_chernoff(__pyx_cur_scope->__pyx_v_total_baseq, __pyx_cur_scope->__pyx_v_delta, __pyx_cur_scope->__pyx_v_alt_count, __pyx_cur_scope->__pyx_v_total_alleles, __pyx_cur_scope->__pyx_v_min_se, __pyx_cur_scope->__pyx_v_min_hetero, __pyx_cur_scope->__pyx_v_pos, __pyx_cur_scope->__pyx_v_chrom, __pyx_cur_scope->__pyx_v_copy_filter, __pyx_cur_scope->__pyx_v_copy_list, __pyx_cur_scope->__pyx_v_ba_to_bed, __pyx_cur_scope->__pyx_v_in_copy, __pyx_cur_scope->__pyx_v_copy_list_pos, __pyx_cur_scope->__pyx_v_chrom_dist, __pyx_cur_scope->__pyx_v_binom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            if (likely(__pyx_t_1 != Py_None)) {
              PyObject* sequence = __pyx_t_1;
              #if CYTHON_COMPILING_IN_CPYTHON
              Py_ssize_t size = Py_SIZE(sequence);
              #else
              Py_ssize_t size = PySequence_Size(sequence);
              #endif
              if (unlikely(size != 3)) {
                if (size > 3) __Pyx_RaiseTooManyValuesError(3);
                else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              #if CYTHON_COMPILING_IN_CPYTHON
              __pyx_t_24 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
              __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); 
              __Pyx_INCREF(__pyx_t_24);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_12);
              #else
              __pyx_t_24 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_24);
              __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_13);
              __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              __Pyx_GOTREF(__pyx_t_12);
              #endif
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else {
              __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            __pyx_t_27 = __pyx_PyFloat_AsDouble(__pyx_t_24); if (unlikely((__pyx_t_27 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
            __pyx_t_28 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_28 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_29 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_29 == (long double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_cur_scope->__pyx_v_pvalue = __pyx_t_27;
            __pyx_cur_scope->__pyx_v_prob_not_se = __pyx_t_28;
            __pyx_cur_scope->__pyx_v_prob_not_hetero = __pyx_t_29;

            /* "SomVarIUS_calling.pyx":758
 * 																chrom, copy_filter, copy_list, ba_to_bed,
 * 																in_copy, copy_list_pos, chrom_dist, binom)
 * 						if pvalue <= min_pvalue:             # <<<<<<<<<<<<<<
 * 							alt_allele_freq = alt_count / float(total_alleles)
 * 							if alt_allele_freq >= min_af:
 */
            __pyx_t_6 = ((__pyx_cur_scope->__pyx_v_pvalue <= __pyx_cur_scope->__pyx_v_min_pvalue) != 0);
            if (__pyx_t_6) {

              /* "SomVarIUS_calling.pyx":759
 * 																in_copy, copy_list_pos, chrom_dist, binom)
 * 						if pvalue <= min_pvalue:
 * 							alt_allele_freq = alt_count / float(total_alleles)             # <<<<<<<<<<<<<<
 * 							if alt_allele_freq >= min_af:
 * 								# reference base
 */
              if (unlikely(((double)__pyx_cur_scope->__pyx_v_total_alleles) == 0)) {
                #ifdef WITH_THREAD
                PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
                #endif
                PyErr_SetString(PyExc_ZeroDivisionError, "float division");
                #ifdef WITH_THREAD
                PyGILState_Release(__pyx_gilstate_save);
                #endif
                {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              }
              __pyx_cur_scope->__pyx_v_alt_allele_freq = (__pyx_cur_scope->__pyx_v_alt_count / ((double)__pyx_cur_scope->__pyx_v_total_alleles));

              /* "SomVarIUS_calling.pyx":760
 * 						if pvalue <= min_pvalue:
 * 							alt_allele_freq = alt_count / float(total_alleles)
 * 							if alt_allele_freq >= min_af:             # <<<<<<<<<<<<<<
 * 								# reference base
 * 								prob_not_se = 1 - prob_not_se
 */
              __pyx_t_6 = ((__pyx_cur_scope->__pyx_v_alt_allele_freq >= __pyx_cur_scope->__pyx_v_min_af) != 0);
              if (__pyx_t_6) {

                /* "SomVarIUS_calling.pyx":762
 * 							if alt_allele_freq >= min_af:
 * 								# reference base
 * 								prob_not_se = 1 - prob_not_se             # <<<<<<<<<<<<<<
 * 								prob_not_hetero = 1 - prob_not_hetero
 * 								refbase = fafile\
 */
                __pyx_cur_scope->__pyx_v_prob_not_se = (1.0 - __pyx_cur_scope->__pyx_v_prob_not_se);

                /* "SomVarIUS_calling.pyx":763
 * 								# reference base
 * 								prob_not_se = 1 - prob_not_se
 * 								prob_not_hetero = 1 - prob_not_hetero             # <<<<<<<<<<<<<<
 * 								refbase = fafile\
 * 								    .fetch(reference=ba_to_fa[chrom], start=col.pos, end=col.pos+1)\
 */
                __pyx_cur_scope->__pyx_v_prob_not_hetero = (1.0 - __pyx_cur_scope->__pyx_v_prob_not_hetero);

                /* "SomVarIUS_calling.pyx":765
 * 								prob_not_hetero = 1 - prob_not_hetero
 * 								refbase = fafile\
 * 								    .fetch(reference=ba_to_fa[chrom], start=col.pos, end=col.pos+1)\             # <<<<<<<<<<<<<<
 * 								    .upper()
 * 								if rna_filter:
 */
                __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_fafile), __pyx_n_s_fetch); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_12);
                __pyx_t_13 = PyDict_New(); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_13);
                if (unlikely(__pyx_cur_scope->__pyx_v_ba_to_fa == Py_None)) {
                  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                __pyx_t_24 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_ba_to_fa, __pyx_cur_scope->__pyx_v_chrom); if (unlikely(__pyx_t_24 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
                __Pyx_GOTREF(__pyx_t_24);
                if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_reference, __pyx_t_24) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_col->pos); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_24);
                if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_start, __pyx_t_24) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                __pyx_t_24 = __Pyx_PyInt_From_long((__pyx_cur_scope->__pyx_v_col->pos + 1)); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_24);
                if (PyDict_SetItem(__pyx_t_13, __pyx_n_s_end, __pyx_t_24) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_13); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_24);
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

                /* "SomVarIUS_calling.pyx":766
 * 								refbase = fafile\
 * 								    .fetch(reference=ba_to_fa[chrom], start=col.pos, end=col.pos+1)\
 * 								    .upper()             # <<<<<<<<<<<<<<
 * 								if rna_filter:
 * 									rna_seq = rna_seq_filter(ba_to_rna[chrom],col.pos,alt_allele,rna_seq_file)
 */
                __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_24, __pyx_n_s_upper); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                __Pyx_GOTREF(__pyx_t_13);
                __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                __pyx_t_24 = NULL;
                if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_13))) {
                  __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_13);
                  if (likely(__pyx_t_24)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
                    __Pyx_INCREF(__pyx_t_24);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_13, function);
                  }
                }
                if (__pyx_t_24) {
                  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                } else {
                  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_refbase);
                __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_refbase, __pyx_t_1);
                __Pyx_GIVEREF(__pyx_t_1);
                __pyx_t_1 = 0;

                /* "SomVarIUS_calling.pyx":767
 * 								    .fetch(reference=ba_to_fa[chrom], start=col.pos, end=col.pos+1)\
 * 								    .upper()
 * 								if rna_filter:             # <<<<<<<<<<<<<<
 * 									rna_seq = rna_seq_filter(ba_to_rna[chrom],col.pos,alt_allele,rna_seq_file)
 * 								if ref_filter:
 */
                __pyx_t_6 = (__pyx_cur_scope->__pyx_v_rna_filter != 0);
                if (__pyx_t_6) {

                  /* "SomVarIUS_calling.pyx":768
 * 								    .upper()
 * 								if rna_filter:
 * 									rna_seq = rna_seq_filter(ba_to_rna[chrom],col.pos,alt_allele,rna_seq_file)             # <<<<<<<<<<<<<<
 * 								if ref_filter:
 * 									if refbase != alt_allele:
 */
                  if (unlikely(!__pyx_cur_scope->__pyx_v_ba_to_rna)) { __Pyx_RaiseUnboundLocalError("ba_to_rna"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
                  if (unlikely(__pyx_cur_scope->__pyx_v_ba_to_rna == Py_None)) {
                    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
                    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_ba_to_rna, __pyx_cur_scope->__pyx_v_chrom); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
                  __Pyx_GOTREF(__pyx_t_1);
                  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  if (unlikely(!__pyx_cur_scope->__pyx_v_rna_seq_file)) { __Pyx_RaiseUnboundLocalError("rna_seq_file"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
                  __pyx_cur_scope->__pyx_v_rna_seq = __pyx_f_17SomVarIUS_calling_rna_seq_filter(((PyObject*)__pyx_t_1), __pyx_cur_scope->__pyx_v_col->pos, __pyx_cur_scope->__pyx_v_alt_allele, __pyx_cur_scope->__pyx_v_rna_seq_file);
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  goto __pyx_L81;
                }
                __pyx_L81:;

                /* "SomVarIUS_calling.pyx":769
 * 								if rna_filter:
 * 									rna_seq = rna_seq_filter(ba_to_rna[chrom],col.pos,alt_allele,rna_seq_file)
 * 								if ref_filter:             # <<<<<<<<<<<<<<
 * 									if refbase != alt_allele:
 * 										yield fmt.format(**locals())
 */
                __pyx_t_6 = (__pyx_cur_scope->__pyx_v_ref_filter != 0);
                if (__pyx_t_6) {

                  /* "SomVarIUS_calling.pyx":770
 * 									rna_seq = rna_seq_filter(ba_to_rna[chrom],col.pos,alt_allele,rna_seq_file)
 * 								if ref_filter:
 * 									if refbase != alt_allele:             # <<<<<<<<<<<<<<
 * 										yield fmt.format(**locals())
 * 								else:
 */
                  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_cur_scope->__pyx_v_refbase, __pyx_cur_scope->__pyx_v_alt_allele, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  if (__pyx_t_6) {

                    /* "SomVarIUS_calling.pyx":771
 * 								if ref_filter:
 * 									if refbase != alt_allele:
 * 										yield fmt.format(**locals())             # <<<<<<<<<<<<<<
 * 								else:
 * 									yield fmt.format(**locals())
 */
                    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_fmt, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_1);
                    __pyx_t_24 = PyDict_New(); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_24);
                    __pyx_t_12 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_A); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_A, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_C); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_C, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_G); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_G, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_T); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_T, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_all_bed_chroms) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_all_bed_chroms, __pyx_cur_scope->__pyx_v_all_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_alnbase) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_alnbase, __pyx_cur_scope->__pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_alt_allele) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_alt_allele, __pyx_cur_scope->__pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_alt_allele_freq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_alt_count, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_alt_germ) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_alt_germ, __pyx_cur_scope->__pyx_v_alt_germ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_ba_to_bed) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_ba_to_bed, __pyx_cur_scope->__pyx_v_ba_to_bed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_ba_to_fa) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_ba_to_fa, __pyx_cur_scope->__pyx_v_ba_to_fa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_ba_to_hapmap) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_ba_to_hapmap, __pyx_cur_scope->__pyx_v_ba_to_hapmap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_ba_to_rna) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_ba_to_rna, __pyx_cur_scope->__pyx_v_ba_to_rna) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_baseq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_baseq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_bed_chroms) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_bed_chroms, __pyx_cur_scope->__pyx_v_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_binom); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_binom, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_chrom) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_chrom, __pyx_cur_scope->__pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_chrom_dist) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_chrom_dist, __pyx_cur_scope->__pyx_v_chrom_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_chrom_list) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_chrom_list, __pyx_cur_scope->__pyx_v_chrom_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_chrom_record) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_chrom_record, __pyx_cur_scope->__pyx_v_chrom_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_chrom_regions) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_chrom_regions, __pyx_cur_scope->__pyx_v_chrom_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_col)) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_col, ((PyObject *)__pyx_cur_scope->__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_copy_bed_name) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_bed_name, __pyx_cur_scope->__pyx_v_copy_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_copy_chrom) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_chrom, __pyx_cur_scope->__pyx_v_copy_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_end); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_end, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_copy_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_filter, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_copy_list) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_list, __pyx_cur_scope->__pyx_v_copy_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_list_pos, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_copy_record) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_record, __pyx_cur_scope->__pyx_v_copy_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_copy_regions) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_regions, __pyx_cur_scope->__pyx_v_copy_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_copy_start, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_counts) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_counts, __pyx_cur_scope->__pyx_v_counts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_dbsnp_bed_name) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_dbsnp_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_delta); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_delta, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_dist) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dist, __pyx_cur_scope->__pyx_v_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_dist_out) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_dist_out, __pyx_cur_scope->__pyx_v_dist_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_fafile, ((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_fafile_name) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_fafile_name, __pyx_cur_scope->__pyx_v_fafile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_flag); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_flag, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_fmt) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_fmt, __pyx_cur_scope->__pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_forward); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_forward, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_fourth_allele) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_fourth_allele, __pyx_cur_scope->__pyx_v_fourth_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_fourth_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_fourth_count, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_fwd_ratio, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_genome) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_genome, __pyx_cur_scope->__pyx_v_genome) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_hap_alt) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_hap_alt, __pyx_cur_scope->__pyx_v_hap_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_hap_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_hap_filter, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_hap_ref) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_hap_ref, __pyx_cur_scope->__pyx_v_hap_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_hapmap_file) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_hapmap_file, __pyx_cur_scope->__pyx_v_hapmap_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_hapmap_present); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_hapmap_present, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_hapmap_record) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_hapmap_record, __pyx_cur_scope->__pyx_v_hapmap_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_i, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_in_copy); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_in_copy, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_is_proper_pair, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_reverse); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_is_reverse, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_it) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_it, __pyx_cur_scope->__pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_labels) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_labels, __pyx_cur_scope->__pyx_v_labels) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_lengths) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_lengths, __pyx_cur_scope->__pyx_v_lengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_line) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_line, __pyx_cur_scope->__pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_maj_allele) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_maj_allele, __pyx_cur_scope->__pyx_v_maj_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_maj_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_maj_count, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_uint8_t(__pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_mapq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_mapq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_mean_mapq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_qual); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_mean_qual, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_af); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_af, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_baseq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_f_r); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_f_r, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_hetero); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_hetero, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_mapq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_pvalue); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_pvalue, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_qual); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_qual, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_reads, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_se); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_se, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_min_support, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_n, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_out_file) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_out_file, __pyx_cur_scope->__pyx_v_out_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_pos); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_pos, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_possible_germs) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_possible_germs, __pyx_cur_scope->__pyx_v_possible_germs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_hetero); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_prob_not_hetero, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_se); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_prob_not_se, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_pvalue); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_pvalue, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_ref_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_ref_filter, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (__pyx_cur_scope->__pyx_v_refbase) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_refbase, __pyx_cur_scope->__pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_references) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_references, __pyx_cur_scope->__pyx_v_references) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_region_chrom) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_region_chrom, __pyx_cur_scope->__pyx_v_region_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_region_end) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_region_end, __pyx_cur_scope->__pyx_v_region_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_region_start) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_region_start, __pyx_cur_scope->__pyx_v_region_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_reverse); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_reverse, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_rna_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_rna_filter, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rna_seq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_rna_seq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_rna_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_rna_seq_file_name) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_rna_seq_file_name, __pyx_cur_scope->__pyx_v_rna_seq_file_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_rnq_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_rvs_ratio, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    if (((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_samfile, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_samfile_name) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_samfile_name, __pyx_cur_scope->__pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_seen_chroms) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_seen_chroms, __pyx_cur_scope->__pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    if (__pyx_cur_scope->__pyx_v_third_allele) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_third_allele, __pyx_cur_scope->__pyx_v_third_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_third_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_third_count, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_total_alleles); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_total_alleles, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_total_baseq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_12);
                    if (__pyx_t_12) {
                      if (PyDict_SetItem(__pyx_t_24, __pyx_n_s_total_baseq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    }
                    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                    __pyx_t_13 = __pyx_t_24;
                    __Pyx_INCREF(__pyx_t_13);
                    __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                    __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_13); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    __Pyx_GOTREF(__pyx_t_24);
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                    __pyx_r = __pyx_t_24;
                    __pyx_t_24 = 0;
                    __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
                    __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
                    __Pyx_XGIVEREF(__pyx_t_11);
                    __pyx_cur_scope->__pyx_t_2 = __pyx_t_11;
                    __Pyx_XGIVEREF(__pyx_r);
                    __Pyx_RefNannyFinishContext();
                    /* return from generator, yielding value */
                    __pyx_generator->resume_label = 1;
                    return __pyx_r;
                    __pyx_L84_resume_from_yield:;
                    __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
                    __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
                    __pyx_t_11 = __pyx_cur_scope->__pyx_t_2;
                    __pyx_cur_scope->__pyx_t_2 = 0;
                    __Pyx_XGOTREF(__pyx_t_11);
                    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                    goto __pyx_L83;
                  }
                  __pyx_L83:;
                  goto __pyx_L82;
                }
                /*else*/ {

                  /* "SomVarIUS_calling.pyx":773
 * 										yield fmt.format(**locals())
 * 								else:
 * 									yield fmt.format(**locals())             # <<<<<<<<<<<<<<
 * 	#out.close()
 * 
 */
                  __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_fmt, __pyx_n_s_format); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_24);
                  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_12 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_A); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_A, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_C); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_C, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_G); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_G, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(__pyx_cur_scope->__pyx_v_T); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_T, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_all_bed_chroms) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_all_bed_chroms, __pyx_cur_scope->__pyx_v_all_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_alnbase) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alnbase, __pyx_cur_scope->__pyx_v_alnbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_alt_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele, __pyx_cur_scope->__pyx_v_alt_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_alt_allele_freq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_allele_freq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_alt_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_count, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_alt_germ) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alt_germ, __pyx_cur_scope->__pyx_v_alt_germ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_ba_to_bed) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_bed, __pyx_cur_scope->__pyx_v_ba_to_bed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_ba_to_fa) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_fa, __pyx_cur_scope->__pyx_v_ba_to_fa) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_ba_to_hapmap) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_hapmap, __pyx_cur_scope->__pyx_v_ba_to_hapmap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_ba_to_rna) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ba_to_rna, __pyx_cur_scope->__pyx_v_ba_to_rna) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_baseq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_baseq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_bed_chroms) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bed_chroms, __pyx_cur_scope->__pyx_v_bed_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_binom); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_binom, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_chrom) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom, __pyx_cur_scope->__pyx_v_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_chrom_dist) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_dist, __pyx_cur_scope->__pyx_v_chrom_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_chrom_list) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_list, __pyx_cur_scope->__pyx_v_chrom_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_chrom_record) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_record, __pyx_cur_scope->__pyx_v_chrom_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_chrom_regions) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chrom_regions, __pyx_cur_scope->__pyx_v_chrom_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_col)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_col, ((PyObject *)__pyx_cur_scope->__pyx_v_col)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_copy_bed_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_bed_name, __pyx_cur_scope->__pyx_v_copy_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_copy_chrom) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_chrom, __pyx_cur_scope->__pyx_v_copy_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_end); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_end, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_copy_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_filter, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_copy_list) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_list, __pyx_cur_scope->__pyx_v_copy_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_list_pos); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_list_pos, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_copy_record) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_record, __pyx_cur_scope->__pyx_v_copy_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_copy_regions) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_regions, __pyx_cur_scope->__pyx_v_copy_regions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_copy_start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy_start, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_counts) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_counts, __pyx_cur_scope->__pyx_v_counts) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_dbsnp_bed_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dbsnp_bed_name, __pyx_cur_scope->__pyx_v_dbsnp_bed_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_delta); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_delta, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_dist) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dist, __pyx_cur_scope->__pyx_v_dist) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_dist_out) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dist_out, __pyx_cur_scope->__pyx_v_dist_out) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fafile, ((PyObject *)__pyx_cur_scope->__pyx_v_fafile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_fafile_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fafile_name, __pyx_cur_scope->__pyx_v_fafile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_uint32_t(__pyx_cur_scope->__pyx_v_flag); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_flag, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_fmt) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fmt, __pyx_cur_scope->__pyx_v_fmt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_forward); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_forward, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_fourth_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fourth_allele, __pyx_cur_scope->__pyx_v_fourth_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_fourth_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fourth_count, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_fwd_ratio); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_fwd_ratio, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_genome) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_genome, __pyx_cur_scope->__pyx_v_genome) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_hap_alt) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_alt, __pyx_cur_scope->__pyx_v_hap_alt) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_hap_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_filter, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_hap_ref) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hap_ref, __pyx_cur_scope->__pyx_v_hap_ref) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_hapmap_file) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_file, __pyx_cur_scope->__pyx_v_hapmap_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_hapmap_present); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_present, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_hapmap_record) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hapmap_record, __pyx_cur_scope->__pyx_v_hapmap_record) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_in_copy); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_in_copy, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_proper_pair); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_proper_pair, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_is_reverse); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_is_reverse, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_it) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_it, __pyx_cur_scope->__pyx_v_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_labels) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_labels, __pyx_cur_scope->__pyx_v_labels) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_lengths) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_lengths, __pyx_cur_scope->__pyx_v_lengths) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_line) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_line, __pyx_cur_scope->__pyx_v_line) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_maj_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maj_allele, __pyx_cur_scope->__pyx_v_maj_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_maj_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maj_count, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_uint8_t(__pyx_cur_scope->__pyx_v_mapq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mapq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_mapq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_mapq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_mean_qual); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mean_qual, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_af); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_af, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_baseq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_baseq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_f_r); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_f_r, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_hetero); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_hetero, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_min_mapq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_mapq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_pvalue); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_pvalue, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_qual); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_qual, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_reads); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_reads, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_min_se); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_se, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_min_support); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_min_support, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_n); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_n, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_out_file) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out_file, __pyx_cur_scope->__pyx_v_out_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_pos); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pos, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_possible_germs) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_possible_germs, __pyx_cur_scope->__pyx_v_possible_germs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_hetero); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_not_hetero, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_prob_not_se); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_prob_not_se, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_pvalue); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pvalue, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_ref_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ref_filter, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (__pyx_cur_scope->__pyx_v_refbase) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_refbase, __pyx_cur_scope->__pyx_v_refbase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_references) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_references, __pyx_cur_scope->__pyx_v_references) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_region_chrom) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_chrom, __pyx_cur_scope->__pyx_v_region_chrom) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_region_end) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_end, __pyx_cur_scope->__pyx_v_region_end) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_region_start) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_region_start, __pyx_cur_scope->__pyx_v_region_start) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_reverse); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reverse, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_rna_filter); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_filter, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rna_seq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rna_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_rna_seq_file_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rna_seq_file_name, __pyx_cur_scope->__pyx_v_rna_seq_file_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rnq_seq_file, ((PyObject *)__pyx_cur_scope->__pyx_v_rnq_seq_file)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_rvs_ratio); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rvs_ratio, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  if (((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile, ((PyObject *)__pyx_cur_scope->__pyx_v_samfile)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_samfile_name) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_samfile_name, __pyx_cur_scope->__pyx_v_samfile_name) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_seen_chroms) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seen_chroms, __pyx_cur_scope->__pyx_v_seen_chroms) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  if (__pyx_cur_scope->__pyx_v_third_allele) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_third_allele, __pyx_cur_scope->__pyx_v_third_allele) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_third_count); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_third_count, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_total_alleles); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_alleles, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_12 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_total_baseq); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_12);
                  if (__pyx_t_12) {
                    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_total_baseq, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  }
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_13 = __pyx_t_1;
                  __Pyx_INCREF(__pyx_t_13);
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_24, __pyx_empty_tuple, __pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __pyx_r = __pyx_t_1;
                  __pyx_t_1 = 0;
                  __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
                  __pyx_cur_scope->__pyx_t_1 = __pyx_t_8;
                  __Pyx_XGIVEREF(__pyx_t_11);
                  __pyx_cur_scope->__pyx_t_2 = __pyx_t_11;
                  __Pyx_XGIVEREF(__pyx_r);
                  __Pyx_RefNannyFinishContext();
                  /* return from generator, yielding value */
                  __pyx_generator->resume_label = 2;
                  return __pyx_r;
                  __pyx_L85_resume_from_yield:;
                  __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
                  __pyx_t_8 = __pyx_cur_scope->__pyx_t_1;
                  __pyx_t_11 = __pyx_cur_scope->__pyx_t_2;
                  __pyx_cur_scope->__pyx_t_2 = 0;
                  __Pyx_XGOTREF(__pyx_t_11);
                  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                }
                __pyx_L82:;
                goto __pyx_L80;
              }
              __pyx_L80:;
              goto __pyx_L79;
            }
            __pyx_L79:;
            goto __pyx_L68;
          }
          __pyx_L68:;
          goto __pyx_L64;
        }
        __pyx_L64:;
        goto __pyx_L45;
      }
      __pyx_L45:;
      goto __pyx_L34;
    }
    __pyx_L34:;

    /* "SomVarIUS_calling.pyx":646
 * 	print 'calling mutations'
 * 
 * 	for col in it:             # <<<<<<<<<<<<<<
 * 		# initialise variables
 * 		n = col.n
 */
    __pyx_L32_continue:;
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "SomVarIUS_calling.pyx":495
 * 
 * 
 * def write_mutations(str out_file, str samfile_name, str fafile_name,             # <<<<<<<<<<<<<<
 * 						  str rna_seq_file_name='', str hapmap_file='',
 *                           int min_reads=10, int min_support=4, double min_af=0.05,
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("write_mutations", __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;
}

/* "SomVarIUS_calling.pyx":777
 * 
 * 
 * cdef inline object _get_seq_base(bam1_t *src, uint32_t k):             # <<<<<<<<<<<<<<
 * 	cdef uint8_t * p
 * 	cdef char * s
 */

static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling__get_seq_base(bam1_t *__pyx_v_src, uint32_t __pyx_v_k) {
  uint8_t *__pyx_v_p;
  char *__pyx_v_s;
  PyObject *__pyx_v_seq = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  char *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_seq_base", 0);

  /* "SomVarIUS_calling.pyx":781
 * 	cdef char * s
 * 
 * 	if not src.core.l_qseq:             # <<<<<<<<<<<<<<
 * 		return None
 * 
 */
  __pyx_t_1 = ((!(__pyx_v_src->core.l_qseq != 0)) != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":782
 * 
 * 	if not src.core.l_qseq:
 * 		return None             # <<<<<<<<<<<<<<
 * 
 * 	seq = PyBytes_FromStringAndSize(NULL, 1)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }

  /* "SomVarIUS_calling.pyx":784
 * 		return None
 * 
 * 	seq = PyBytes_FromStringAndSize(NULL, 1)             # <<<<<<<<<<<<<<
 * 	s   = <char*>seq
 * 	p   = pysam_bam_get_seq(src)
 */
  __pyx_t_2 = PyBytes_FromStringAndSize(NULL, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_seq = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":785
 * 
 * 	seq = PyBytes_FromStringAndSize(NULL, 1)
 * 	s   = <char*>seq             # <<<<<<<<<<<<<<
 * 	p   = pysam_bam_get_seq(src)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_seq); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_s = ((char *)__pyx_t_3);

  /* "SomVarIUS_calling.pyx":786
 * 	seq = PyBytes_FromStringAndSize(NULL, 1)
 * 	s   = <char*>seq
 * 	p   = pysam_bam_get_seq(src)             # <<<<<<<<<<<<<<
 * 
 * 	s[0] = bam_nt16_rev_table[p[k//2] >> 4 * (1 - k%2) & 0xf]
 */
  __pyx_v_p = pysam_bam_get_seq(__pyx_v_src);

  /* "SomVarIUS_calling.pyx":788
 * 	p   = pysam_bam_get_seq(src)
 * 
 * 	s[0] = bam_nt16_rev_table[p[k//2] >> 4 * (1 - k%2) & 0xf]             # <<<<<<<<<<<<<<
 * 
 * 	return seq
 */
  (__pyx_v_s[0]) = (__pyx_v_17SomVarIUS_calling_bam_nt16_rev_table[(((__pyx_v_p[__Pyx_div_long(__pyx_v_k, 2)]) >> (4 * (1 - __Pyx_mod_long(__pyx_v_k, 2)))) & 0xf)]);

  /* "SomVarIUS_calling.pyx":790
 * 	s[0] = bam_nt16_rev_table[p[k//2] >> 4 * (1 - k%2) & 0xf]
 * 
 * 	return seq             # <<<<<<<<<<<<<<
 * 
 * cdef struct _CountAllele:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_seq);
  __pyx_r = __pyx_v_seq;
  goto __pyx_L0;

  /* "SomVarIUS_calling.pyx":777
 * 
 * 
 * cdef inline object _get_seq_base(bam1_t *src, uint32_t k):             # <<<<<<<<<<<<<<
 * 	cdef uint8_t * p
 * 	cdef char * s
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("SomVarIUS_calling._get_seq_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_seq);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":796
 * 	double qual
 * 
 * cdef inline _init_count(_CountAllele* c):             # <<<<<<<<<<<<<<
 * 	c.qual = c.fwd = c.rev = c.pres = c.count = c.mapqual = 0
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling__init_count(struct __pyx_t_17SomVarIUS_calling__CountAllele *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_count", 0);

  /* "SomVarIUS_calling.pyx":797
 * 
 * cdef inline _init_count(_CountAllele* c):
 * 	c.qual = c.fwd = c.rev = c.pres = c.count = c.mapqual = 0             # <<<<<<<<<<<<<<
 * 
 * cdef inline _incr_count(_CountAllele* c, bint is_reverse, double baseq, int mapq):
 */
  __pyx_v_c->qual = 0.0;
  __pyx_v_c->fwd = 0;
  __pyx_v_c->rev = 0;
  __pyx_v_c->pres = 0;
  __pyx_v_c->count = 0;
  __pyx_v_c->mapqual = 0;

  /* "SomVarIUS_calling.pyx":796
 * 	double qual
 * 
 * cdef inline _init_count(_CountAllele* c):             # <<<<<<<<<<<<<<
 * 	c.qual = c.fwd = c.rev = c.pres = c.count = c.mapqual = 0
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "SomVarIUS_calling.pyx":799
 * 	c.qual = c.fwd = c.rev = c.pres = c.count = c.mapqual = 0
 * 
 * cdef inline _incr_count(_CountAllele* c, bint is_reverse, double baseq, int mapq):             # <<<<<<<<<<<<<<
 * 	c.count+=1
 * 	c.pres=1
 */

static CYTHON_INLINE PyObject *__pyx_f_17SomVarIUS_calling__incr_count(struct __pyx_t_17SomVarIUS_calling__CountAllele *__pyx_v_c, int __pyx_v_is_reverse, double __pyx_v_baseq, int __pyx_v_mapq) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_incr_count", 0);

  /* "SomVarIUS_calling.pyx":800
 * 
 * cdef inline _incr_count(_CountAllele* c, bint is_reverse, double baseq, int mapq):
 * 	c.count+=1             # <<<<<<<<<<<<<<
 * 	c.pres=1
 * 	c.qual+=baseq
 */
  __pyx_v_c->count = (__pyx_v_c->count + 1);

  /* "SomVarIUS_calling.pyx":801
 * cdef inline _incr_count(_CountAllele* c, bint is_reverse, double baseq, int mapq):
 * 	c.count+=1
 * 	c.pres=1             # <<<<<<<<<<<<<<
 * 	c.qual+=baseq
 * 	c.mapqual+=mapq
 */
  __pyx_v_c->pres = 1;

  /* "SomVarIUS_calling.pyx":802
 * 	c.count+=1
 * 	c.pres=1
 * 	c.qual+=baseq             # <<<<<<<<<<<<<<
 * 	c.mapqual+=mapq
 * 	if is_reverse:
 */
  __pyx_v_c->qual = (__pyx_v_c->qual + __pyx_v_baseq);

  /* "SomVarIUS_calling.pyx":803
 * 	c.pres=1
 * 	c.qual+=baseq
 * 	c.mapqual+=mapq             # <<<<<<<<<<<<<<
 * 	if is_reverse:
 * 		c.rev += 1
 */
  __pyx_v_c->mapqual = (__pyx_v_c->mapqual + __pyx_v_mapq);

  /* "SomVarIUS_calling.pyx":804
 * 	c.qual+=baseq
 * 	c.mapqual+=mapq
 * 	if is_reverse:             # <<<<<<<<<<<<<<
 * 		c.rev += 1
 * 	else:
 */
  __pyx_t_1 = (__pyx_v_is_reverse != 0);
  if (__pyx_t_1) {

    /* "SomVarIUS_calling.pyx":805
 * 	c.mapqual+=mapq
 * 	if is_reverse:
 * 		c.rev += 1             # <<<<<<<<<<<<<<
 * 	else:
 * 		c.fwd += 1
 */
    __pyx_v_c->rev = (__pyx_v_c->rev + 1);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "SomVarIUS_calling.pyx":807
 * 		c.rev += 1
 * 	else:
 * 		c.fwd += 1             # <<<<<<<<<<<<<<
 */
    __pyx_v_c->fwd = (__pyx_v_c->fwd + 1);
  }
  __pyx_L3:;

  /* "SomVarIUS_calling.pyx":799
 * 	c.qual = c.fwd = c.rev = c.pres = c.count = c.mapqual = 0
 * 
 * cdef inline _incr_count(_CountAllele* c, bint is_reverse, double baseq, int mapq):             # <<<<<<<<<<<<<<
 * 	c.count+=1
 * 	c.pres=1
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

/* Python wrapper */
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  if (__pyx_v_info != NULL) {
    __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(__pyx_v_info->obj);
  }

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
 *             # of flags
 * 
 *             if info == NULL: return             # <<<<<<<<<<<<<<
 * 
 *             cdef int copy_shape, i, ndim
 */
  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
 * 
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":207
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":212
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L4:;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":216
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L6_bool_binop_done;
  }

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":220
 *                 raise ValueError(u"ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 */
  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L9_bool_binop_done;
  }

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 */
  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":224
 *                 raise ValueError(u"ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info.
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 */
  __pyx_t_1 = (__pyx_v_copy_shape != 0);
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
 *                 # Allocate new buffer for strides and shape info.
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
 *                 # This is allocated as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    __pyx_t_4 = __pyx_v_ndim;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
    }
    goto __pyx_L11;
  }
  /*else*/ {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  }
  __pyx_L11:;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":238
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L14;
  }
  /*else*/ {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  }
  __pyx_L14:;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 */
  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 */
    __pyx_t_4 = __pyx_v_descr->type_num;
    __pyx_v_t = __pyx_t_4;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
    if (!__pyx_t_2) {
      goto __pyx_L20_next_or;
    } else {
    }
    __pyx_t_2 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_L20_next_or:;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
 *                 t = descr.type_num
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
    __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L19_bool_binop_done:;
    if (__pyx_t_1) {

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
    switch (__pyx_v_t) {

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
      case NPY_BYTE:
      __pyx_v_f = __pyx_k_b;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
 *                     raise ValueError(u"Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
      case NPY_UBYTE:
      __pyx_v_f = __pyx_k_B;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
      case NPY_SHORT:
      __pyx_v_f = __pyx_k_h;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
      case NPY_USHORT:
      __pyx_v_f = __pyx_k_H;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
      case NPY_INT:
      __pyx_v_f = __pyx_k_i;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
      case NPY_UINT:
      __pyx_v_f = __pyx_k_I;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
      case NPY_LONG:
      __pyx_v_f = __pyx_k_l;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
      case NPY_ULONG:
      __pyx_v_f = __pyx_k_L;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
      case NPY_LONGLONG:
      __pyx_v_f = __pyx_k_q;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
      case NPY_ULONGLONG:
      __pyx_v_f = __pyx_k_Q;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
      case NPY_FLOAT:
      __pyx_v_f = __pyx_k_f;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
      case NPY_DOUBLE:
      __pyx_v_f = __pyx_k_d;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
      case NPY_LONGDOUBLE:
      __pyx_v_f = __pyx_k_g;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
      case NPY_CFLOAT:
      __pyx_v_f = __pyx_k_Zf;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
      case NPY_CDOUBLE:
      __pyx_v_f = __pyx_k_Zd;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
      case NPY_CLONGDOUBLE:
      __pyx_v_f = __pyx_k_Zg;
      break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      case NPY_OBJECT:
      __pyx_v_f = __pyx_k_O;
      break;
      default:

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      break;
    }

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
 *                 else:
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
 *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
 *                 info.format[0] = c'^' # Native data types, manual alignment
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 */
    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_7;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = '\x00';
  }

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":197
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

/* Python wrapper */
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__releasebuffer__", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
 *                 f[0] = c'\0' # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
 * 
 * cdef inline object PyArray_MultiIterNew1(a):
 *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
 *     return PyArray_MultiIterNew(1, <void*>a)
 * 
 * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
 *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
 * 
 * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
 *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
 * 
 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
 *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
 * 
 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child = 0;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_childname = NULL;
  PyObject *__pyx_v_new_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  long __pyx_t_8;
  char *__pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_util_dtypestring", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":793
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (unlikely(__pyx_v_descr->names == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 797; __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[1]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    if (unlikely(__pyx_v_descr->fields == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 */
    if (likely(__pyx_v_fields != Py_None)) {
      PyObject* sequence = __pyx_v_fields;
      #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[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
 *         child, new_offset = fields
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
    if (__pyx_t_6) {

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
    if (!__pyx_t_7) {
      goto __pyx_L8_next_or;
    } else {
    }
    __pyx_t_7 = (__pyx_v_little_endian != 0);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_L8_next_or:;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError(u"Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
    __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
    __pyx_t_6 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_6) {

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_6) break;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f = (__pyx_v_f + 1);

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      __pyx_t_8 = 0;
      (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
    }

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    __pyx_t_8 = 0;
    (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
    if (__pyx_t_6) {

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")
 */
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(u"Format string allocated too short.")
 * 
 */
      __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
      if (__pyx_t_6) {

        /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f = (__pyx_v_f + 1);
        goto __pyx_L15;
      }

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_6) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L15:;

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
 *             else:
 *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f = (__pyx_v_f + 1);
      goto __pyx_L13;
    }
    /*else*/ {

      /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L13:;

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":797
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
 *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_childname);
  __Pyx_XDECREF(__pyx_v_new_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  PyObject *__pyx_v_baseptr;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("set_array_base", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
 * cdef inline void set_array_base(ndarray arr, object base):
 *      cdef PyObject* baseptr
 *      if base is None:             # <<<<<<<<<<<<<<
 *          baseptr = NULL
 *      else:
 */
  __pyx_t_1 = (__pyx_v_base == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
 *      cdef PyObject* baseptr
 *      if base is None:
 *          baseptr = NULL             # <<<<<<<<<<<<<<
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 */
    __pyx_v_baseptr = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
 *          baseptr = NULL
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!             # <<<<<<<<<<<<<<
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 */
    Py_INCREF(__pyx_v_base);

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":975
 *      else:
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base             # <<<<<<<<<<<<<<
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr
 */
    __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
  }
  __pyx_L3:;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
 *          Py_INCREF(base) # important to do this before decref below!
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)             # <<<<<<<<<<<<<<
 *      arr.base = baseptr
 * 
 */
  Py_XDECREF(__pyx_v_arr->base);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
 *          baseptr = <PyObject*>base
 *      Py_XDECREF(arr.base)
 *      arr.base = baseptr             # <<<<<<<<<<<<<<
 * 
 * cdef inline object get_array_base(ndarray arr):
 */
  __pyx_v_arr->base = __pyx_v_baseptr;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
 * 
 * 
 * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
 *      cdef PyObject* baseptr
 *      if base is None:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("get_array_base", 0);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
 * 
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
  if (__pyx_t_1) {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":981
 * cdef inline object get_array_base(ndarray arr):
 *     if arr.base is NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         return <object>arr.base
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983
 *         return None
 *     else:
 *         return <object>arr.base             # <<<<<<<<<<<<<<
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
    __pyx_r = ((PyObject *)__pyx_v_arr->base);
    goto __pyx_L0;
  }

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *__pyx_freelist_17SomVarIUS_calling___pyx_scope_struct__write_mutations[8];
static int __pyx_freecount_17SomVarIUS_calling___pyx_scope_struct__write_mutations = 0;

static PyObject *__pyx_tp_new_17SomVarIUS_calling___pyx_scope_struct__write_mutations(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_17SomVarIUS_calling___pyx_scope_struct__write_mutations > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations)))) {
    o = (PyObject*)__pyx_freelist_17SomVarIUS_calling___pyx_scope_struct__write_mutations[--__pyx_freecount_17SomVarIUS_calling___pyx_scope_struct__write_mutations];
    memset(o, 0, sizeof(struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_17SomVarIUS_calling___pyx_scope_struct__write_mutations(PyObject *o) {
  struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *p = (struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_all_bed_chroms);
  Py_CLEAR(p->__pyx_v_alnbase);
  Py_CLEAR(p->__pyx_v_alt_allele);
  Py_CLEAR(p->__pyx_v_alt_germ);
  Py_CLEAR(p->__pyx_v_ba_to_bed);
  Py_CLEAR(p->__pyx_v_ba_to_fa);
  Py_CLEAR(p->__pyx_v_ba_to_hapmap);
  Py_CLEAR(p->__pyx_v_ba_to_rna);
  Py_CLEAR(p->__pyx_v_bed_chroms);
  Py_CLEAR(p->__pyx_v_chrom);
  Py_CLEAR(p->__pyx_v_chrom_dist);
  Py_CLEAR(p->__pyx_v_chrom_list);
  Py_CLEAR(p->__pyx_v_chrom_record);
  Py_CLEAR(p->__pyx_v_chrom_regions);
  Py_CLEAR(p->__pyx_v_col);
  Py_CLEAR(p->__pyx_v_copy_bed_name);
  Py_CLEAR(p->__pyx_v_copy_chrom);
  Py_CLEAR(p->__pyx_v_copy_list);
  Py_CLEAR(p->__pyx_v_copy_record);
  Py_CLEAR(p->__pyx_v_copy_regions);
  Py_CLEAR(p->__pyx_v_counts);
  Py_CLEAR(p->__pyx_v_dbsnp_bed_name);
  Py_CLEAR(p->__pyx_v_dist);
  Py_CLEAR(p->__pyx_v_dist_out);
  Py_CLEAR(p->__pyx_v_fafile);
  Py_CLEAR(p->__pyx_v_fafile_name);
  Py_CLEAR(p->__pyx_v_fmt);
  Py_CLEAR(p->__pyx_v_fourth_allele);
  Py_CLEAR(p->__pyx_v_genome);
  Py_CLEAR(p->__pyx_v_hap_alt);
  Py_CLEAR(p->__pyx_v_hap_ref);
  Py_CLEAR(p->__pyx_v_hapmap_file);
  Py_CLEAR(p->__pyx_v_hapmap_record);
  Py_CLEAR(p->__pyx_v_it);
  Py_CLEAR(p->__pyx_v_labels);
  Py_CLEAR(p->__pyx_v_lengths);
  Py_CLEAR(p->__pyx_v_line);
  Py_CLEAR(p->__pyx_v_maj_allele);
  Py_CLEAR(p->__pyx_v_out_file);
  Py_CLEAR(p->__pyx_v_possible_germs);
  Py_CLEAR(p->__pyx_v_refbase);
  Py_CLEAR(p->__pyx_v_references);
  Py_CLEAR(p->__pyx_v_region_chrom);
  Py_CLEAR(p->__pyx_v_region_end);
  Py_CLEAR(p->__pyx_v_region_start);
  Py_CLEAR(p->__pyx_v_rna_seq_file);
  Py_CLEAR(p->__pyx_v_rna_seq_file_name);
  Py_CLEAR(p->__pyx_v_rnq_seq_file);
  Py_CLEAR(p->__pyx_v_samfile);
  Py_CLEAR(p->__pyx_v_samfile_name);
  Py_CLEAR(p->__pyx_v_seen_chroms);
  Py_CLEAR(p->__pyx_v_third_allele);
  Py_CLEAR(p->__pyx_t_2);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_17SomVarIUS_calling___pyx_scope_struct__write_mutations < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations)))) {
    __pyx_freelist_17SomVarIUS_calling___pyx_scope_struct__write_mutations[__pyx_freecount_17SomVarIUS_calling___pyx_scope_struct__write_mutations++] = ((struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_17SomVarIUS_calling___pyx_scope_struct__write_mutations(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *p = (struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *)o;
  if (p->__pyx_v_all_bed_chroms) {
    e = (*v)(p->__pyx_v_all_bed_chroms, a); if (e) return e;
  }
  if (p->__pyx_v_alt_germ) {
    e = (*v)(p->__pyx_v_alt_germ, a); if (e) return e;
  }
  if (p->__pyx_v_ba_to_bed) {
    e = (*v)(p->__pyx_v_ba_to_bed, a); if (e) return e;
  }
  if (p->__pyx_v_ba_to_fa) {
    e = (*v)(p->__pyx_v_ba_to_fa, a); if (e) return e;
  }
  if (p->__pyx_v_ba_to_hapmap) {
    e = (*v)(p->__pyx_v_ba_to_hapmap, a); if (e) return e;
  }
  if (p->__pyx_v_ba_to_rna) {
    e = (*v)(p->__pyx_v_ba_to_rna, a); if (e) return e;
  }
  if (p->__pyx_v_bed_chroms) {
    e = (*v)(p->__pyx_v_bed_chroms, a); if (e) return e;
  }
  if (p->__pyx_v_chrom_dist) {
    e = (*v)(p->__pyx_v_chrom_dist, a); if (e) return e;
  }
  if (p->__pyx_v_chrom_list) {
    e = (*v)(p->__pyx_v_chrom_list, a); if (e) return e;
  }
  if (p->__pyx_v_chrom_record) {
    e = (*v)(p->__pyx_v_chrom_record, a); if (e) return e;
  }
  if (p->__pyx_v_chrom_regions) {
    e = (*v)(p->__pyx_v_chrom_regions, a); if (e) return e;
  }
  if (p->__pyx_v_col) {
    e = (*v)(((PyObject*)p->__pyx_v_col), a); if (e) return e;
  }
  if (p->__pyx_v_copy_list) {
    e = (*v)(p->__pyx_v_copy_list, a); if (e) return e;
  }
  if (p->__pyx_v_copy_record) {
    e = (*v)(p->__pyx_v_copy_record, a); if (e) return e;
  }
  if (p->__pyx_v_copy_regions) {
    e = (*v)(p->__pyx_v_copy_regions, a); if (e) return e;
  }
  if (p->__pyx_v_counts) {
    e = (*v)(p->__pyx_v_counts, a); if (e) return e;
  }
  if (p->__pyx_v_dist_out) {
    e = (*v)(p->__pyx_v_dist_out, a); if (e) return e;
  }
  if (p->__pyx_v_fafile) {
    e = (*v)(((PyObject*)p->__pyx_v_fafile), a); if (e) return e;
  }
  if (p->__pyx_v_fmt) {
    e = (*v)(p->__pyx_v_fmt, a); if (e) return e;
  }
  if (p->__pyx_v_genome) {
    e = (*v)(p->__pyx_v_genome, a); if (e) return e;
  }
  if (p->__pyx_v_hap_alt) {
    e = (*v)(p->__pyx_v_hap_alt, a); if (e) return e;
  }
  if (p->__pyx_v_hap_ref) {
    e = (*v)(p->__pyx_v_hap_ref, a); if (e) return e;
  }
  if (p->__pyx_v_hapmap_record) {
    e = (*v)(p->__pyx_v_hapmap_record, a); if (e) return e;
  }
  if (p->__pyx_v_it) {
    e = (*v)(p->__pyx_v_it, a); if (e) return e;
  }
  if (p->__pyx_v_labels) {
    e = (*v)(p->__pyx_v_labels, a); if (e) return e;
  }
  if (p->__pyx_v_lengths) {
    e = (*v)(p->__pyx_v_lengths, a); if (e) return e;
  }
  if (p->__pyx_v_line) {
    e = (*v)(p->__pyx_v_line, a); if (e) return e;
  }
  if (p->__pyx_v_possible_germs) {
    e = (*v)(p->__pyx_v_possible_germs, a); if (e) return e;
  }
  if (p->__pyx_v_refbase) {
    e = (*v)(p->__pyx_v_refbase, a); if (e) return e;
  }
  if (p->__pyx_v_references) {
    e = (*v)(p->__pyx_v_references, a); if (e) return e;
  }
  if (p->__pyx_v_region_chrom) {
    e = (*v)(p->__pyx_v_region_chrom, a); if (e) return e;
  }
  if (p->__pyx_v_region_end) {
    e = (*v)(p->__pyx_v_region_end, a); if (e) return e;
  }
  if (p->__pyx_v_region_start) {
    e = (*v)(p->__pyx_v_region_start, a); if (e) return e;
  }
  if (p->__pyx_v_rna_seq_file) {
    e = (*v)(((PyObject*)p->__pyx_v_rna_seq_file), a); if (e) return e;
  }
  if (p->__pyx_v_rnq_seq_file) {
    e = (*v)(((PyObject*)p->__pyx_v_rnq_seq_file), a); if (e) return e;
  }
  if (p->__pyx_v_samfile) {
    e = (*v)(((PyObject*)p->__pyx_v_samfile), a); if (e) return e;
  }
  if (p->__pyx_v_seen_chroms) {
    e = (*v)(p->__pyx_v_seen_chroms, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_17SomVarIUS_calling___pyx_scope_struct__write_mutations(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *p = (struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations *)o;
  tmp = ((PyObject*)p->__pyx_v_all_bed_chroms);
  p->__pyx_v_all_bed_chroms = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_alt_germ);
  p->__pyx_v_alt_germ = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ba_to_bed);
  p->__pyx_v_ba_to_bed = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ba_to_fa);
  p->__pyx_v_ba_to_fa = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ba_to_hapmap);
  p->__pyx_v_ba_to_hapmap = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_ba_to_rna);
  p->__pyx_v_ba_to_rna = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_bed_chroms);
  p->__pyx_v_bed_chroms = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_chrom_dist);
  p->__pyx_v_chrom_dist = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_chrom_list);
  p->__pyx_v_chrom_list = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_chrom_record);
  p->__pyx_v_chrom_record = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_chrom_regions);
  p->__pyx_v_chrom_regions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_col);
  p->__pyx_v_col = ((struct __pyx_obj_5pysam_14calignmentfile_PileupColumn *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_copy_list);
  p->__pyx_v_copy_list = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_copy_record);
  p->__pyx_v_copy_record = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_copy_regions);
  p->__pyx_v_copy_regions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_counts);
  p->__pyx_v_counts = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_dist_out);
  p->__pyx_v_dist_out = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_fafile);
  p->__pyx_v_fafile = ((struct __pyx_obj_5pysam_6cfaidx_Fastafile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_fmt);
  p->__pyx_v_fmt = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_genome);
  p->__pyx_v_genome = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_hap_alt);
  p->__pyx_v_hap_alt = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_hap_ref);
  p->__pyx_v_hap_ref = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_hapmap_record);
  p->__pyx_v_hapmap_record = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_it);
  p->__pyx_v_it = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_labels);
  p->__pyx_v_labels = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_lengths);
  p->__pyx_v_lengths = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_line);
  p->__pyx_v_line = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_possible_germs);
  p->__pyx_v_possible_germs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_refbase);
  p->__pyx_v_refbase = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_references);
  p->__pyx_v_references = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_region_chrom);
  p->__pyx_v_region_chrom = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_region_end);
  p->__pyx_v_region_end = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_region_start);
  p->__pyx_v_region_start = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_rna_seq_file);
  p->__pyx_v_rna_seq_file = ((struct __pyx_obj_5pysam_8csamfile_Samfile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_rnq_seq_file);
  p->__pyx_v_rnq_seq_file = ((struct __pyx_obj_5pysam_8csamfile_Samfile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_samfile);
  p->__pyx_v_samfile = ((struct __pyx_obj_5pysam_8csamfile_Samfile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_seen_chroms);
  p->__pyx_v_seen_chroms = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_2);
  p->__pyx_t_2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_17SomVarIUS_calling___pyx_scope_struct__write_mutations = {
  PyVarObject_HEAD_INIT(0, 0)
  "SomVarIUS_calling.__pyx_scope_struct__write_mutations", /*tp_name*/
  sizeof(struct __pyx_obj_17SomVarIUS_calling___pyx_scope_struct__write_mutations), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_17SomVarIUS_calling___pyx_scope_struct__write_mutations, /*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_17SomVarIUS_calling___pyx_scope_struct__write_mutations, /*tp_traverse*/
  __pyx_tp_clear_17SomVarIUS_calling___pyx_scope_struct__write_mutations, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_17SomVarIUS_calling___pyx_scope_struct__write_mutations, /*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*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

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

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "SomVarIUS_calling",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_0_15, __pyx_k_0_15, sizeof(__pyx_k_0_15), 0, 0, 1, 0},
  {&__pyx_n_b_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 0, 1},
  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
  {&__pyx_n_b_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 0, 1},
  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  {&__pyx_n_b_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 0, 0, 1},
  {&__pyx_n_s_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 0, 1, 1},
  {&__pyx_kp_s_GP_prob_not_hetero_DP_total_alle, __pyx_k_GP_prob_not_hetero_DP_total_alle, sizeof(__pyx_k_GP_prob_not_hetero_DP_total_alle), 0, 0, 1, 0},
  {&__pyx_kp_s_GT_GQ_DP_1_0_60_total_alleles, __pyx_k_GT_GQ_DP_1_0_60_total_alleles, sizeof(__pyx_k_GT_GQ_DP_1_0_60_total_alleles), 0, 0, 1, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_s_NS_1_AF_alt_allele_freq_P_pvalue, __pyx_k_NS_1_AF_alt_allele_freq_P_pvalue, sizeof(__pyx_k_NS_1_AF_alt_allele_freq_P_pvalue), 0, 0, 1, 0},
  {&__pyx_n_s_NaN, __pyx_k_NaN, sizeof(__pyx_k_NaN), 0, 0, 1, 1},
  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
  {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_SomVarIUS_calling, __pyx_k_SomVarIUS_calling, sizeof(__pyx_k_SomVarIUS_calling), 0, 0, 1, 1},
  {&__pyx_n_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 1},
  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
  {&__pyx_kp_s_Users_smithk_Documents_git_repo, __pyx_k_Users_smithk_Documents_git_repo, sizeof(__pyx_k_Users_smithk_Documents_git_repo), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
  {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
  {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
  {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0},
  {&__pyx_n_s_all_bed_chroms, __pyx_k_all_bed_chroms, sizeof(__pyx_k_all_bed_chroms), 0, 0, 1, 1},
  {&__pyx_n_s_alleles, __pyx_k_alleles, sizeof(__pyx_k_alleles), 0, 0, 1, 1},
  {&__pyx_n_s_aln, __pyx_k_aln, sizeof(__pyx_k_aln), 0, 0, 1, 1},
  {&__pyx_n_s_alnbase, __pyx_k_alnbase, sizeof(__pyx_k_alnbase), 0, 0, 1, 1},
  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
  {&__pyx_n_s_alt_allele, __pyx_k_alt_allele, sizeof(__pyx_k_alt_allele), 0, 0, 1, 1},
  {&__pyx_n_s_alt_allele_freq, __pyx_k_alt_allele_freq, sizeof(__pyx_k_alt_allele_freq), 0, 0, 1, 1},
  {&__pyx_kp_s_alt_allele_freq_pvalue_prob_not, __pyx_k_alt_allele_freq_pvalue_prob_not, sizeof(__pyx_k_alt_allele_freq_pvalue_prob_not), 0, 0, 1, 0},
  {&__pyx_n_s_alt_alleles, __pyx_k_alt_alleles, sizeof(__pyx_k_alt_alleles), 0, 0, 1, 1},
  {&__pyx_n_s_alt_count, __pyx_k_alt_count, sizeof(__pyx_k_alt_count), 0, 0, 1, 1},
  {&__pyx_n_s_alt_germ, __pyx_k_alt_germ, sizeof(__pyx_k_alt_germ), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_ba_to_bed, __pyx_k_ba_to_bed, sizeof(__pyx_k_ba_to_bed), 0, 0, 1, 1},
  {&__pyx_n_s_ba_to_fa, __pyx_k_ba_to_fa, sizeof(__pyx_k_ba_to_fa), 0, 0, 1, 1},
  {&__pyx_n_s_ba_to_hapmap, __pyx_k_ba_to_hapmap, sizeof(__pyx_k_ba_to_hapmap), 0, 0, 1, 1},
  {&__pyx_n_s_ba_to_rna, __pyx_k_ba_to_rna, sizeof(__pyx_k_ba_to_rna), 0, 0, 1, 1},
  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
  {&__pyx_n_s_baseq, __pyx_k_baseq, sizeof(__pyx_k_baseq), 0, 0, 1, 1},
  {&__pyx_n_s_bed_chroms, __pyx_k_bed_chroms, sizeof(__pyx_k_bed_chroms), 0, 0, 1, 1},
  {&__pyx_n_s_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 0, 1, 1},
  {&__pyx_n_s_binned_data, __pyx_k_binned_data, sizeof(__pyx_k_binned_data), 0, 0, 1, 1},
  {&__pyx_n_s_binom, __pyx_k_binom, sizeof(__pyx_k_binom), 0, 0, 1, 1},
  {&__pyx_n_s_cPickle, __pyx_k_cPickle, sizeof(__pyx_k_cPickle), 0, 0, 1, 1},
  {&__pyx_kp_s_calculating_allele_frequency_dis, __pyx_k_calculating_allele_frequency_dis, sizeof(__pyx_k_calculating_allele_frequency_dis), 0, 0, 1, 0},
  {&__pyx_kp_s_calculating_chromosome_allele_fr, __pyx_k_calculating_chromosome_allele_fr, sizeof(__pyx_k_calculating_chromosome_allele_fr), 0, 0, 1, 0},
  {&__pyx_kp_s_calling_mutations, __pyx_k_calling_mutations, sizeof(__pyx_k_calling_mutations), 0, 0, 1, 0},
  {&__pyx_n_s_cdf, __pyx_k_cdf, sizeof(__pyx_k_cdf), 0, 0, 1, 1},
  {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
  {&__pyx_n_s_chrom, __pyx_k_chrom, sizeof(__pyx_k_chrom), 0, 0, 1, 1},
  {&__pyx_n_s_chrom_dist, __pyx_k_chrom_dist, sizeof(__pyx_k_chrom_dist), 0, 0, 1, 1},
  {&__pyx_n_s_chrom_list, __pyx_k_chrom_list, sizeof(__pyx_k_chrom_list), 0, 0, 1, 1},
  {&__pyx_kp_s_chrom_pos_refbase_alt_allele_PA, __pyx_k_chrom_pos_refbase_alt_allele_PA, sizeof(__pyx_k_chrom_pos_refbase_alt_allele_PA), 0, 0, 1, 0},
  {&__pyx_kp_s_chrom_pos_refbase_maj_allele_al, __pyx_k_chrom_pos_refbase_maj_allele_al, sizeof(__pyx_k_chrom_pos_refbase_maj_allele_al), 0, 0, 1, 0},
  {&__pyx_n_s_chrom_record, __pyx_k_chrom_record, sizeof(__pyx_k_chrom_record), 0, 0, 1, 1},
  {&__pyx_n_s_chrom_regions, __pyx_k_chrom_regions, sizeof(__pyx_k_chrom_regions), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_col, __pyx_k_col, sizeof(__pyx_k_col), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_copy_bed, __pyx_k_copy_bed, sizeof(__pyx_k_copy_bed), 0, 0, 1, 1},
  {&__pyx_n_s_copy_bed_name, __pyx_k_copy_bed_name, sizeof(__pyx_k_copy_bed_name), 0, 0, 1, 1},
  {&__pyx_n_s_copy_chrom, __pyx_k_copy_chrom, sizeof(__pyx_k_copy_chrom), 0, 0, 1, 1},
  {&__pyx_n_s_copy_end, __pyx_k_copy_end, sizeof(__pyx_k_copy_end), 0, 0, 1, 1},
  {&__pyx_n_s_copy_filter, __pyx_k_copy_filter, sizeof(__pyx_k_copy_filter), 0, 0, 1, 1},
  {&__pyx_n_s_copy_list, __pyx_k_copy_list, sizeof(__pyx_k_copy_list), 0, 0, 1, 1},
  {&__pyx_n_s_copy_list_pos, __pyx_k_copy_list_pos, sizeof(__pyx_k_copy_list_pos), 0, 0, 1, 1},
  {&__pyx_n_s_copy_record, __pyx_k_copy_record, sizeof(__pyx_k_copy_record), 0, 0, 1, 1},
  {&__pyx_n_s_copy_region, __pyx_k_copy_region, sizeof(__pyx_k_copy_region), 0, 0, 1, 1},
  {&__pyx_n_s_copy_regions, __pyx_k_copy_regions, sizeof(__pyx_k_copy_regions), 0, 0, 1, 1},
  {&__pyx_n_s_copy_start, __pyx_k_copy_start, sizeof(__pyx_k_copy_start), 0, 0, 1, 1},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_counts, __pyx_k_counts, sizeof(__pyx_k_counts), 0, 0, 1, 1},
  {&__pyx_n_s_dbsnp_alt_alleles, __pyx_k_dbsnp_alt_alleles, sizeof(__pyx_k_dbsnp_alt_alleles), 0, 0, 1, 1},
  {&__pyx_n_s_dbsnp_bed_name, __pyx_k_dbsnp_bed_name, sizeof(__pyx_k_dbsnp_bed_name), 0, 0, 1, 1},
  {&__pyx_n_s_dbsnp_maj_allele, __pyx_k_dbsnp_maj_allele, sizeof(__pyx_k_dbsnp_maj_allele), 0, 0, 1, 1},
  {&__pyx_n_s_dbsnp_obs_overlap, __pyx_k_dbsnp_obs_overlap, sizeof(__pyx_k_dbsnp_obs_overlap), 0, 0, 1, 1},
  {&__pyx_n_s_delta, __pyx_k_delta, sizeof(__pyx_k_delta), 0, 0, 1, 1},
  {&__pyx_n_s_dist, __pyx_k_dist, sizeof(__pyx_k_dist), 0, 0, 1, 1},
  {&__pyx_n_s_dist_out, __pyx_k_dist_out, sizeof(__pyx_k_dist_out), 0, 0, 1, 1},
  {&__pyx_kp_s_done_calculating_chromosome_dist, __pyx_k_done_calculating_chromosome_dist, sizeof(__pyx_k_done_calculating_chromosome_dist), 0, 0, 1, 0},
  {&__pyx_kp_s_done_calculating_copy_number_dis, __pyx_k_done_calculating_copy_number_dis, sizeof(__pyx_k_done_calculating_copy_number_dis), 0, 0, 1, 0},
  {&__pyx_kp_s_done_loading_germline_record, __pyx_k_done_loading_germline_record, sizeof(__pyx_k_done_loading_germline_record), 0, 0, 1, 0},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_eval, __pyx_k_eval, sizeof(__pyx_k_eval), 0, 0, 1, 1},
  {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1},
  {&__pyx_n_s_factorial, __pyx_k_factorial, sizeof(__pyx_k_factorial), 0, 0, 1, 1},
  {&__pyx_n_s_fafile, __pyx_k_fafile, sizeof(__pyx_k_fafile), 0, 0, 1, 1},
  {&__pyx_n_s_fafile_name, __pyx_k_fafile_name, sizeof(__pyx_k_fafile_name), 0, 0, 1, 1},
  {&__pyx_n_s_fetch, __pyx_k_fetch, sizeof(__pyx_k_fetch), 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_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_s_fmt, __pyx_k_fmt, sizeof(__pyx_k_fmt), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_forward, __pyx_k_forward, sizeof(__pyx_k_forward), 0, 0, 1, 1},
  {&__pyx_n_s_fourth_allele, __pyx_k_fourth_allele, sizeof(__pyx_k_fourth_allele), 0, 0, 1, 1},
  {&__pyx_n_s_fourth_count, __pyx_k_fourth_count, sizeof(__pyx_k_fourth_count), 0, 0, 1, 1},
  {&__pyx_n_s_fwd, __pyx_k_fwd, sizeof(__pyx_k_fwd), 0, 0, 1, 1},
  {&__pyx_n_s_fwd_ratio, __pyx_k_fwd_ratio, sizeof(__pyx_k_fwd_ratio), 0, 0, 1, 1},
  {&__pyx_n_s_gammaln, __pyx_k_gammaln, sizeof(__pyx_k_gammaln), 0, 0, 1, 1},
  {&__pyx_n_s_genome, __pyx_k_genome, sizeof(__pyx_k_genome), 0, 0, 1, 1},
  {&__pyx_n_s_get_dist, __pyx_k_get_dist, sizeof(__pyx_k_get_dist), 0, 0, 1, 1},
  {&__pyx_n_s_getrname, __pyx_k_getrname, sizeof(__pyx_k_getrname), 0, 0, 1, 1},
  {&__pyx_n_s_hap_alt, __pyx_k_hap_alt, sizeof(__pyx_k_hap_alt), 0, 0, 1, 1},
  {&__pyx_n_s_hap_filter, __pyx_k_hap_filter, sizeof(__pyx_k_hap_filter), 0, 0, 1, 1},
  {&__pyx_n_s_hap_ref, __pyx_k_hap_ref, sizeof(__pyx_k_hap_ref), 0, 0, 1, 1},
  {&__pyx_n_s_hapmap_file, __pyx_k_hapmap_file, sizeof(__pyx_k_hapmap_file), 0, 0, 1, 1},
  {&__pyx_n_s_hapmap_present, __pyx_k_hapmap_present, sizeof(__pyx_k_hapmap_present), 0, 0, 1, 1},
  {&__pyx_n_s_hapmap_record, __pyx_k_hapmap_record, sizeof(__pyx_k_hapmap_record), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_in_copy, __pyx_k_in_copy, sizeof(__pyx_k_in_copy), 0, 0, 1, 1},
  {&__pyx_n_s_is_proper_pair, __pyx_k_is_proper_pair, sizeof(__pyx_k_is_proper_pair), 0, 0, 1, 1},
  {&__pyx_n_s_is_reverse, __pyx_k_is_reverse, sizeof(__pyx_k_is_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_it, __pyx_k_it, sizeof(__pyx_k_it), 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_labels, __pyx_k_labels, sizeof(__pyx_k_labels), 0, 0, 1, 1},
  {&__pyx_n_s_lengths, __pyx_k_lengths, sizeof(__pyx_k_lengths), 0, 0, 1, 1},
  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
  {&__pyx_n_s_load, __pyx_k_load, sizeof(__pyx_k_load), 0, 0, 1, 1},
  {&__pyx_kp_s_loading_germline_record, __pyx_k_loading_germline_record, sizeof(__pyx_k_loading_germline_record), 0, 0, 1, 0},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_maj_allele, __pyx_k_maj_allele, sizeof(__pyx_k_maj_allele), 0, 0, 1, 1},
  {&__pyx_n_s_maj_count, __pyx_k_maj_count, sizeof(__pyx_k_maj_count), 0, 0, 1, 1},
  {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_mapq, __pyx_k_mapq, sizeof(__pyx_k_mapq), 0, 0, 1, 1},
  {&__pyx_n_s_mapqual, __pyx_k_mapqual, sizeof(__pyx_k_mapqual), 0, 0, 1, 1},
  {&__pyx_n_s_max_depth, __pyx_k_max_depth, sizeof(__pyx_k_max_depth), 0, 0, 1, 1},
  {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
  {&__pyx_n_s_mean_mapq, __pyx_k_mean_mapq, sizeof(__pyx_k_mean_mapq), 0, 0, 1, 1},
  {&__pyx_n_s_mean_qual, __pyx_k_mean_qual, sizeof(__pyx_k_mean_qual), 0, 0, 1, 1},
  {&__pyx_n_s_min_af, __pyx_k_min_af, sizeof(__pyx_k_min_af), 0, 0, 1, 1},
  {&__pyx_n_s_min_baseq, __pyx_k_min_baseq, sizeof(__pyx_k_min_baseq), 0, 0, 1, 1},
  {&__pyx_n_s_min_f_r, __pyx_k_min_f_r, sizeof(__pyx_k_min_f_r), 0, 0, 1, 1},
  {&__pyx_n_s_min_hetero, __pyx_k_min_hetero, sizeof(__pyx_k_min_hetero), 0, 0, 1, 1},
  {&__pyx_n_s_min_mapq, __pyx_k_min_mapq, sizeof(__pyx_k_min_mapq), 0, 0, 1, 1},
  {&__pyx_n_s_min_pvalue, __pyx_k_min_pvalue, sizeof(__pyx_k_min_pvalue), 0, 0, 1, 1},
  {&__pyx_n_s_min_qual, __pyx_k_min_qual, sizeof(__pyx_k_min_qual), 0, 0, 1, 1},
  {&__pyx_n_s_min_reads, __pyx_k_min_reads, sizeof(__pyx_k_min_reads), 0, 0, 1, 1},
  {&__pyx_n_s_min_se, __pyx_k_min_se, sizeof(__pyx_k_min_se), 0, 0, 1, 1},
  {&__pyx_n_s_min_support, __pyx_k_min_support, sizeof(__pyx_k_min_support), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_kp_s_n_alt_count_rvs_ratio_fwd_ratio, __pyx_k_n_alt_count_rvs_ratio_fwd_ratio, sizeof(__pyx_k_n_alt_count_rvs_ratio_fwd_ratio), 0, 0, 1, 0},
  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  {&__pyx_n_s_obs_alleles, __pyx_k_obs_alleles, sizeof(__pyx_k_obs_alleles), 0, 0, 1, 1},
  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
  {&__pyx_n_s_out_file, __pyx_k_out_file, sizeof(__pyx_k_out_file), 0, 0, 1, 1},
  {&__pyx_n_s_pileup, __pyx_k_pileup, sizeof(__pyx_k_pileup), 0, 0, 1, 1},
  {&__pyx_n_s_plp, __pyx_k_plp, sizeof(__pyx_k_plp), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_possible_germs, __pyx_k_possible_germs, sizeof(__pyx_k_possible_germs), 0, 0, 1, 1},
  {&__pyx_n_s_pres, __pyx_k_pres, sizeof(__pyx_k_pres), 0, 0, 1, 1},
  {&__pyx_n_s_previous_copy_region, __pyx_k_previous_copy_region, sizeof(__pyx_k_previous_copy_region), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_prob_not_hetero, __pyx_k_prob_not_hetero, sizeof(__pyx_k_prob_not_hetero), 0, 0, 1, 1},
  {&__pyx_n_s_prob_not_se, __pyx_k_prob_not_se, sizeof(__pyx_k_prob_not_se), 0, 0, 1, 1},
  {&__pyx_n_s_pvalue, __pyx_k_pvalue, sizeof(__pyx_k_pvalue), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qual, __pyx_k_qual, sizeof(__pyx_k_qual), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_record, __pyx_k_record, sizeof(__pyx_k_record), 0, 0, 1, 1},
  {&__pyx_n_s_ref_filter, __pyx_k_ref_filter, sizeof(__pyx_k_ref_filter), 0, 0, 1, 1},
  {&__pyx_n_s_refbase, __pyx_k_refbase, sizeof(__pyx_k_refbase), 0, 0, 1, 1},
  {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1},
  {&__pyx_n_s_references, __pyx_k_references, sizeof(__pyx_k_references), 0, 0, 1, 1},
  {&__pyx_n_s_region_chrom, __pyx_k_region_chrom, sizeof(__pyx_k_region_chrom), 0, 0, 1, 1},
  {&__pyx_n_s_region_end, __pyx_k_region_end, sizeof(__pyx_k_region_end), 0, 0, 1, 1},
  {&__pyx_n_s_region_start, __pyx_k_region_start, sizeof(__pyx_k_region_start), 0, 0, 1, 1},
  {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1},
  {&__pyx_n_s_rev, __pyx_k_rev, sizeof(__pyx_k_rev), 0, 0, 1, 1},
  {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_rna_filter, __pyx_k_rna_filter, sizeof(__pyx_k_rna_filter), 0, 0, 1, 1},
  {&__pyx_n_s_rna_seq, __pyx_k_rna_seq, sizeof(__pyx_k_rna_seq), 0, 0, 1, 1},
  {&__pyx_n_s_rna_seq_file, __pyx_k_rna_seq_file, sizeof(__pyx_k_rna_seq_file), 0, 0, 1, 1},
  {&__pyx_n_s_rna_seq_file_name, __pyx_k_rna_seq_file_name, sizeof(__pyx_k_rna_seq_file_name), 0, 0, 1, 1},
  {&__pyx_n_s_rnq_seq_file, __pyx_k_rnq_seq_file, sizeof(__pyx_k_rnq_seq_file), 0, 0, 1, 1},
  {&__pyx_n_s_rvs_ratio, __pyx_k_rvs_ratio, sizeof(__pyx_k_rvs_ratio), 0, 0, 1, 1},
  {&__pyx_n_s_samfile, __pyx_k_samfile, sizeof(__pyx_k_samfile), 0, 0, 1, 1},
  {&__pyx_n_s_samfile_name, __pyx_k_samfile_name, sizeof(__pyx_k_samfile_name), 0, 0, 1, 1},
  {&__pyx_n_s_scipy, __pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 0, 1, 1},
  {&__pyx_n_s_scipy_misc, __pyx_k_scipy_misc, sizeof(__pyx_k_scipy_misc), 0, 0, 1, 1},
  {&__pyx_n_s_scipy_special, __pyx_k_scipy_special, sizeof(__pyx_k_scipy_special), 0, 0, 1, 1},
  {&__pyx_n_s_scipy_stats, __pyx_k_scipy_stats, sizeof(__pyx_k_scipy_stats), 0, 0, 1, 1},
  {&__pyx_n_s_seen_chroms, __pyx_k_seen_chroms, sizeof(__pyx_k_seen_chroms), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_stats, __pyx_k_stats, sizeof(__pyx_k_stats), 0, 0, 1, 1},
  {&__pyx_kp_s_storing_chromosome_dbsnp_interse, __pyx_k_storing_chromosome_dbsnp_interse, sizeof(__pyx_k_storing_chromosome_dbsnp_interse), 0, 0, 1, 0},
  {&__pyx_kp_s_storing_dbsnp_copy_number_inters, __pyx_k_storing_dbsnp_copy_number_inters, sizeof(__pyx_k_storing_dbsnp_copy_number_inters), 0, 0, 1, 0},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_third_allele, __pyx_k_third_allele, sizeof(__pyx_k_third_allele), 0, 0, 1, 1},
  {&__pyx_n_s_third_count, __pyx_k_third_count, sizeof(__pyx_k_third_count), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_total_alleles, __pyx_k_total_alleles, sizeof(__pyx_k_total_alleles), 0, 0, 1, 1},
  {&__pyx_n_s_total_baseq, __pyx_k_total_baseq, sizeof(__pyx_k_total_baseq), 0, 0, 1, 1},
  {&__pyx_n_s_total_counts, __pyx_k_total_counts, sizeof(__pyx_k_total_counts), 0, 0, 1, 1},
  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_write_mutations, __pyx_k_write_mutations, sizeof(__pyx_k_write_mutations), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __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 = 39; __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 = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __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 = 304; __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 = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_n_s_eval); if (!__pyx_builtin_eval) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __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);

  /* "SomVarIUS_calling.pyx":235
 * 				#print "dbsnp", dbsnp_maj_allele
 * 				if len(dbsnp_obs_overlap) > 0 and dbsnp_maj_allele in obs_alleles:
 * 					copy_region = copy_record[(ba_to_bed[chrom],pos)][0:3]             # <<<<<<<<<<<<<<
 * 					try:
 * 						record[copy_region]
 */
  __pyx_slice_ = PySlice_New(__pyx_int_0, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice_);
  __Pyx_GIVEREF(__pyx_slice_);

  /* "SomVarIUS_calling.pyx":305
 * 
 * 	for dbsnp in open(dbsnp_bed_name,'r'):
 * 		fields = dbsnp.strip().split('\t')             # <<<<<<<<<<<<<<
 * 		chrom = fields[0]
 * 		pos = int(fields[1])
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "SomVarIUS_calling.pyx":311
 * 																				regions, seen_chroms, copy_list_pos)
 * 		if in_copy:
 * 			alleles = (fields[3], frozenset(fields[4].split(',')))             # <<<<<<<<<<<<<<
 * 			copy_record[(chrom,pos)] = (copy_chrom,copy_start,copy_end,alleles)
 * 		else:
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "SomVarIUS_calling.pyx":541
 * 		copy_regions = []
 * 		for line in open(copy_bed_name,'r'):
 * 			copy_regions.append(line.strip().split('\t'))             # <<<<<<<<<<<<<<
 * 		copy_record, bed_chroms = filter_regions(dbsnp_bed_name, copy_regions)
 * 		ba_to_bed = samfile_ref_dicts(samfile.references, bed_chroms)
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "SomVarIUS_calling.pyx":690
 * 						#check if there is more than one germline present
 * 						if len(hap_alt) > 1:
 * 							possible_germs = hap_alt.split(',')             # <<<<<<<<<<<<<<
 * 							alt_germ = eval(possible_germs[0])
 * 							for i in xrange(1, len(possible_germs)):
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
 *                 if ((descr.byteorder == c'>' and little_endian) or
 *                     (descr.byteorder == c'<' and not little_endian)):
 *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
 * 
 *         if (end - f) - <int>(new_offset - offset[0]) < 15:
 *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == c'>' and little_endian) or
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
 *         if ((child.byteorder == c'>' and little_endian) or
 *             (child.byteorder == c'<' and not little_endian)):
 *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "SomVarIUS_calling.pyx":164
 * 
 * 
 * def get_dist(copy_record, Samfile samfile, dict ba_to_bed,             # <<<<<<<<<<<<<<
 *  			int min_reads, int min_support, int min_mapq,
 * 			int min_baseq, dict genome, bint copy_bed=False):
 */
  __pyx_tuple__16 = PyTuple_Pack(51, __pyx_n_s_copy_record, __pyx_n_s_samfile, __pyx_n_s_ba_to_bed, __pyx_n_s_min_reads, __pyx_n_s_min_support, __pyx_n_s_min_mapq, __pyx_n_s_min_baseq, __pyx_n_s_genome, __pyx_n_s_copy_bed, __pyx_n_s_A, __pyx_n_s_T, __pyx_n_s_G, __pyx_n_s_C, __pyx_n_s_chrom, __pyx_n_s_alnbase, __pyx_n_s_maj_allele, __pyx_n_s_alt_allele, __pyx_n_s_base, __pyx_n_s_pos, __pyx_n_s_i, __pyx_n_s_maj_count, __pyx_n_s_alt_count, __pyx_n_s_col, __pyx_n_s_plp, __pyx_n_s_read, __pyx_n_s_aln, __pyx_n_s_alleles, __pyx_n_s_is_reverse, __pyx_n_s_is_proper_pair, __pyx_n_s_mapq, __pyx_n_s_baseq, __pyx_n_s_counts, __pyx_n_s_labels, __pyx_n_s_copy_region, __pyx_n_s_copy_list, __pyx_n_s_binned_data, __pyx_n_s_n, __pyx_n_s_alpha, __pyx_n_s_beta, __pyx_n_s_mean, __pyx_n_s_total_counts, __pyx_n_s_dbsnp_maj_allele, __pyx_n_s_dbsnp_alt_alleles, __pyx_n_s_previous_copy_region, __pyx_n_s_record, __pyx_n_s_it, __pyx_n_s_flag, __pyx_n_s_obs_alleles, __pyx_n_s_dbsnp_obs_overlap, __pyx_n_s_start, __pyx_n_s_end); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(9, 0, 51, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_smithk_Documents_git_repo, __pyx_n_s_get_dist, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":495
 * 
 * 
 * def write_mutations(str out_file, str samfile_name, str fafile_name,             # <<<<<<<<<<<<<<
 * 						  str rna_seq_file_name='', str hapmap_file='',
 *                           int min_reads=10, int min_support=4, double min_af=0.05,
 */
  __pyx_tuple__18 = PyTuple_Pack(105, __pyx_n_s_out_file, __pyx_n_s_samfile_name, __pyx_n_s_fafile_name, __pyx_n_s_rna_seq_file_name, __pyx_n_s_hapmap_file, __pyx_n_s_min_reads, __pyx_n_s_min_support, __pyx_n_s_min_af, __pyx_n_s_min_pvalue, __pyx_n_s_min_f_r, __pyx_n_s_rna_filter, __pyx_n_s_hap_filter, __pyx_n_s_min_qual, __pyx_n_s_min_se, __pyx_n_s_min_hetero, __pyx_n_s_ref_filter, __pyx_n_s_min_mapq, __pyx_n_s_dbsnp_bed_name, __pyx_n_s_copy_bed_name, __pyx_n_s_binom, __pyx_n_s_region_chrom, __pyx_n_s_region_start, __pyx_n_s_region_end, __pyx_n_s_min_baseq, __pyx_n_s_dist, __pyx_n_s_fmt, __pyx_n_s_rnq_seq_file, __pyx_n_s_samfile, __pyx_n_s_fafile, __pyx_n_s_ba_to_fa, __pyx_n_s_ba_to_rna, __pyx_n_s_ba_to_hapmap, __pyx_n_s_ba_to_bed, __pyx_n_s_bed_chroms, __pyx_n_s_seen_chroms, __pyx_n_s_copy_list, __pyx_n_s_copy_list_pos, __pyx_n_s_in_copy, __pyx_n_s_copy_chrom, __pyx_n_s_copy_start, __pyx_n_s_copy_end, __pyx_n_s_references, __pyx_n_s_lengths, __pyx_n_s_genome, __pyx_n_s_copy_filter, __pyx_n_s_copy_regions, __pyx_n_s_line, __pyx_n_s_copy_record, __pyx_n_s_dist_out, __pyx_n_s_chrom_regions, __pyx_n_s_chrom_record, __pyx_n_s_all_bed_chroms, __pyx_n_s_chrom_list, __pyx_n_s_chrom_dist, __pyx_n_s_rna_seq_file, __pyx_n_s_hapmap_record, __pyx_n_s_it, __pyx_n_s_plp, __pyx_n_s_read, __pyx_n_s_aln, __pyx_n_s_flag, __pyx_n_s_is_reverse, __pyx_n_s_is_proper_pair, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_baseq, __pyx_n_s_total_baseq, __pyx_n_s_col, __pyx_n_s_alt_allele_freq, __pyx_n_s_chrom, __pyx_n_s_alnbase, __pyx_n_s_pos, __pyx_n_s_hapmap_present, __pyx_n_s_mean_qual, __pyx_n_s_A, __pyx_n_s_T, __pyx_n_s_G, __pyx_n_s_C, __pyx_n_s_maj_allele, __pyx_n_s_alt_allele, __pyx_n_s_third_allele, __pyx_n_s_fourth_allele, __pyx_n_s_maj_count, __pyx_n_s_alt_count, __pyx_n_s_third_count, __pyx_n_s_fourth_count, __pyx_n_s_fwd_ratio, __pyx_n_s_rvs_ratio, __pyx_n_s_total_alleles, __pyx_n_s_pvalue, __pyx_n_s_prob_not_se, __pyx_n_s_prob_not_hetero, __pyx_n_s_delta, __pyx_n_s_reverse, __pyx_n_s_forward, __pyx_n_s_rna_seq, __pyx_n_s_mapq, __pyx_n_s_hap_ref, __pyx_n_s_hap_alt, __pyx_n_s_possible_germs, __pyx_n_s_alt_germ, __pyx_n_s_counts, __pyx_n_s_labels, __pyx_n_s_mean_mapq, __pyx_n_s_refbase); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(25, 0, 105, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_smithk_Documents_git_repo, __pyx_n_s_write_mutations, 495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_0_0001 = PyFloat_FromDouble(0.0001); if (unlikely(!__pyx_float_0_0001)) {__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_8000 = PyInt_FromLong(8000); if (unlikely(!__pyx_int_8000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_80000 = PyInt_FromLong(80000L); if (unlikely(!__pyx_int_80000)) {__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 initSomVarIUS_calling(void); /*proto*/
PyMODINIT_FUNC initSomVarIUS_calling(void)
#else
PyMODINIT_FUNC PyInit_SomVarIUS_calling(void); /*proto*/
PyMODINIT_FUNC PyInit_SomVarIUS_calling(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_SomVarIUS_calling(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("SomVarIUS_calling", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_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 (PyObject_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_SomVarIUS_calling) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "SomVarIUS_calling")) {
      if (unlikely(PyDict_SetItemString(modules, "SomVarIUS_calling", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_17SomVarIUS_calling___pyx_scope_struct__write_mutations) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_17SomVarIUS_calling___pyx_scope_struct__write_mutations.tp_print = 0;
  __pyx_ptype_17SomVarIUS_calling___pyx_scope_struct__write_mutations = &__pyx_type_17SomVarIUS_calling___pyx_scope_struct__write_mutations;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[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_5pysam_6cfaidx_FastaFile = __Pyx_ImportType("pysam.cfaidx", "FastaFile", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastaFile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastaFile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_6cfaidx_FastaFile = (struct __pyx_vtabstruct_5pysam_6cfaidx_FastaFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_FastaFile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_FastaFile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_6cfaidx_FastqProxy = __Pyx_ImportType("pysam.cfaidx", "FastqProxy", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastqProxy), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastqProxy)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_6cfaidx_FastqFile = __Pyx_ImportType("pysam.cfaidx", "FastqFile", sizeof(struct __pyx_obj_5pysam_6cfaidx_FastqFile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_FastqFile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_6cfaidx_FastqFile = (struct __pyx_vtabstruct_5pysam_6cfaidx_FastqFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_FastqFile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_FastqFile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_6cfaidx_Fastafile = __Pyx_ImportType("pysam.cfaidx", "Fastafile", sizeof(struct __pyx_obj_5pysam_6cfaidx_Fastafile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_Fastafile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_6cfaidx_Fastafile = (struct __pyx_vtabstruct_5pysam_6cfaidx_Fastafile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_Fastafile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_Fastafile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_6cfaidx_Fastqfile = __Pyx_ImportType("pysam.cfaidx", "Fastqfile", sizeof(struct __pyx_obj_5pysam_6cfaidx_Fastqfile), 1); if (unlikely(!__pyx_ptype_5pysam_6cfaidx_Fastqfile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_6cfaidx_Fastqfile = (struct __pyx_vtabstruct_5pysam_6cfaidx_Fastqfile*)__Pyx_GetVtable(__pyx_ptype_5pysam_6cfaidx_Fastqfile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_6cfaidx_Fastqfile)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_AlignedSegment = __Pyx_ImportType("pysam.calignmentfile", "AlignedSegment", sizeof(struct __pyx_obj_5pysam_14calignmentfile_AlignedSegment), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_AlignedSegment)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment = (struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignedSegment*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_AlignedSegment->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_AlignedSegment)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_AlignmentFile = __Pyx_ImportType("pysam.calignmentfile", "AlignmentFile", sizeof(struct __pyx_obj_5pysam_14calignmentfile_AlignmentFile), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_AlignmentFile)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile = (struct __pyx_vtabstruct_5pysam_14calignmentfile_AlignmentFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_AlignmentFile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_AlignmentFile)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_PileupColumn = __Pyx_ImportType("pysam.calignmentfile", "PileupColumn", sizeof(struct __pyx_obj_5pysam_14calignmentfile_PileupColumn), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_PileupColumn)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_PileupRead = __Pyx_ImportType("pysam.calignmentfile", "PileupRead", sizeof(struct __pyx_obj_5pysam_14calignmentfile_PileupRead), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_PileupRead)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorRow = __Pyx_ImportType("pysam.calignmentfile", "IteratorRow", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRow), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRow)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowRegion", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowRegion), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowRegion*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorRowRegion->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowRegion)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorRowHead = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowHead", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowHead), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowHead)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowHead*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorRowHead->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowHead)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorRowAll = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowAll", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAll), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowAll*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorRowAll->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowAll)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowAllRefs", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowAllRefs), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowAllRefs)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection = __Pyx_ImportType("pysam.calignmentfile", "IteratorRowSelection", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorRowSelection), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorRowSelection*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorRowSelection->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorRowSelection)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorColumn = __Pyx_ImportType("pysam.calignmentfile", "IteratorColumn", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumn), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorColumn)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumn*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorColumn->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumn)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion = __Pyx_ImportType("pysam.calignmentfile", "IteratorColumnRegion", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnRegion), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnRegion*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorColumnRegion->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnRegion)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs = __Pyx_ImportType("pysam.calignmentfile", "IteratorColumnAllRefs", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IteratorColumnAllRefs), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs = (struct __pyx_vtabstruct_5pysam_14calignmentfile_IteratorColumnAllRefs*)__Pyx_GetVtable(__pyx_ptype_5pysam_14calignmentfile_IteratorColumnAllRefs->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_14calignmentfile_IteratorColumnAllRefs)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_14calignmentfile_IndexedReads = __Pyx_ImportType("pysam.calignmentfile", "IndexedReads", sizeof(struct __pyx_obj_5pysam_14calignmentfile_IndexedReads), 1); if (unlikely(!__pyx_ptype_5pysam_14calignmentfile_IndexedReads)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_8csamfile_AlignedRead = __Pyx_ImportType("pysam.csamfile", "AlignedRead", sizeof(struct __pyx_obj_5pysam_8csamfile_AlignedRead), 1); if (unlikely(!__pyx_ptype_5pysam_8csamfile_AlignedRead)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_8csamfile_AlignedRead = (struct __pyx_vtabstruct_5pysam_8csamfile_AlignedRead*)__Pyx_GetVtable(__pyx_ptype_5pysam_8csamfile_AlignedRead->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_8csamfile_AlignedRead)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5pysam_8csamfile_Samfile = __Pyx_ImportType("pysam.csamfile", "Samfile", sizeof(struct __pyx_obj_5pysam_8csamfile_Samfile), 1); if (unlikely(!__pyx_ptype_5pysam_8csamfile_Samfile)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5pysam_8csamfile_Samfile = (struct __pyx_vtabstruct_5pysam_8csamfile_Samfile*)__Pyx_GetVtable(__pyx_ptype_5pysam_8csamfile_Samfile->tp_dict); if (unlikely(!__pyx_vtabptr_5pysam_8csamfile_Samfile)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "SomVarIUS_calling.pyx":5
 * 
 * 
 * __version__ = '0.15'             # <<<<<<<<<<<<<<
 * #try cimport BedTool, Interval
 * from collections import OrderedDict
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_15) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "SomVarIUS_calling.pyx":7
 * __version__ = '0.15'
 * #try cimport BedTool, Interval
 * from collections import OrderedDict             # <<<<<<<<<<<<<<
 * import scipy.stats
 * import cPickle
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_OrderedDict);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_OrderedDict);
  __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":8
 * #try cimport BedTool, Interval
 * from collections import OrderedDict
 * import scipy.stats             # <<<<<<<<<<<<<<
 * import cPickle
 * from libc.stdint cimport uint32_t, uint8_t, uint64_t, int64_t
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_stats, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_scipy, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":9
 * from collections import OrderedDict
 * import scipy.stats
 * import cPickle             # <<<<<<<<<<<<<<
 * from libc.stdint cimport uint32_t, uint8_t, uint64_t, int64_t
 * from libc.math cimport isnan
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_cPickle, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cPickle, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":19
 *     pysam_bam_get_seq, pysam_bam_get_qual
 * 
 * from scipy.special import gammaln             # <<<<<<<<<<<<<<
 * from scipy.misc import factorial
 * import numpy as np
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_gammaln);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_gammaln);
  __Pyx_GIVEREF(__pyx_n_s_gammaln);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_scipy_special, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_gammaln); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gammaln, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "SomVarIUS_calling.pyx":20
 * 
 * from scipy.special import gammaln
 * from scipy.misc import factorial             # <<<<<<<<<<<<<<
 * import numpy as np
 * cimport numpy as np
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_factorial);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_factorial);
  __Pyx_GIVEREF(__pyx_n_s_factorial);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_misc, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_factorial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_factorial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":21
 * from scipy.special import gammaln
 * from scipy.misc import factorial
 * import numpy as np             # <<<<<<<<<<<<<<
 * cimport numpy as np
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":92
 * 
 * 
 * cdef char* CODE2CIGAR= "MIDNSHP=X"             # <<<<<<<<<<<<<<
 * 
 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"
 */
  __pyx_v_17SomVarIUS_calling_CODE2CIGAR = __pyx_k_MIDNSHP_X;

  /* "SomVarIUS_calling.pyx":94
 * cdef char* CODE2CIGAR= "MIDNSHP=X"
 * 
 * cdef char * bam_nt16_rev_table = "=ACMGRSVTWYHKDBN"             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_17SomVarIUS_calling_bam_nt16_rev_table = __pyx_k_ACMGRSVTWYHKDBN;

  /* "SomVarIUS_calling.pyx":164
 * 
 * 
 * def get_dist(copy_record, Samfile samfile, dict ba_to_bed,             # <<<<<<<<<<<<<<
 *  			int min_reads, int min_support, int min_mapq,
 * 			int min_baseq, dict genome, bint copy_bed=False):
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_17SomVarIUS_calling_1get_dist, NULL, __pyx_n_s_SomVarIUS_calling); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_dist, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":495
 * 
 * 
 * def write_mutations(str out_file, str samfile_name, str fafile_name,             # <<<<<<<<<<<<<<
 * 						  str rna_seq_file_name='', str hapmap_file='',
 *                           int min_reads=10, int min_support=4, double min_af=0.05,
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_17SomVarIUS_calling_3write_mutations, NULL, __pyx_n_s_SomVarIUS_calling); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_write_mutations, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "SomVarIUS_calling.pyx":1
 * # cython: profile=False             # <<<<<<<<<<<<<<
 * # cython: embedsignature=True
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "../../../../../Library/Python/2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
 *      arr.base = baseptr
 * 
 * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
 *     if arr.base is NULL:
 *         return None
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init SomVarIUS_calling", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init SomVarIUS_calling");
  }
  __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

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

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

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

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject* args = PyTuple_Pack(1, arg);
    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
}
#endif

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

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

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

static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

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

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

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

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

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

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

#if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

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 long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

#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 (PyType_Check(type)) {
#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;
        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;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        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);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

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
    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_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static 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, (size_t)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,
        0,
        0,
        0,
        0,
        __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,
        __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;
    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_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*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);
}

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
    PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
        if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
    Py_DECREF(obj);
    view->obj = NULL;
}
#endif


          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_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;
        }
        #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
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
    {                                                                     \
        func_type value = func_value;                                     \
        if (sizeof(target_type) < sizeof(func_type)) {                    \
            if (unlikely(value != (func_type) (target_type) value)) {     \
                func_type zero = 0;                                       \
                if (is_unsigned && unlikely(value < zero))                \
                    goto raise_neg_overflow;                              \
                else                                                      \
                    goto raise_overflow;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
    const uint64_t neg_one = (uint64_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(uint64_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint64_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(uint64_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(uint64_t) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint64_t,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(uint64_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(uint64_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, long, PyLong_AsLong(x))
            } else if (sizeof(uint64_t) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(uint64_t, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            uint64_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint64_t) -1;
        }
    } else {
        uint64_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (uint64_t) -1;
        val = __Pyx_PyInt_As_uint64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint64_t");
    return (uint64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint64_t");
    return (uint64_t) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
    const uint64_t neg_one = (uint64_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(uint64_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static PyObject* __Pyx_Globals(void) {
    Py_ssize_t i;
    PyObject *names;
    PyObject *globals = __pyx_d;
    Py_INCREF(globals);
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_GetItem(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = __Pyx_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

static PyObject* __pyx_convert__to_py___pyx_t_17SomVarIUS_calling__CountAllele(struct __pyx_t_17SomVarIUS_calling__CountAllele s) {
            PyObject* res;
            PyObject* member;
            res = PyDict_New(); if (res == NULL) return NULL;
            member = __Pyx_PyInt_From_int(s.fwd); if (member == NULL) goto bad;
            if (PyDict_SetItem(res, __pyx_n_s_fwd, member) < 0) goto bad;
            Py_DECREF(member);
            member = __Pyx_PyInt_From_int(s.rev); if (member == NULL) goto bad;
            if (PyDict_SetItem(res, __pyx_n_s_rev, member) < 0) goto bad;
            Py_DECREF(member);
            member = __Pyx_PyInt_From_int(s.pres); if (member == NULL) goto bad;
            if (PyDict_SetItem(res, __pyx_n_s_pres, member) < 0) goto bad;
            Py_DECREF(member);
            member = __Pyx_PyInt_From_int(s.count); if (member == NULL) goto bad;
            if (PyDict_SetItem(res, __pyx_n_s_count, member) < 0) goto bad;
            Py_DECREF(member);
            member = __Pyx_PyInt_From_int(s.mapqual); if (member == NULL) goto bad;
            if (PyDict_SetItem(res, __pyx_n_s_mapqual, member) < 0) goto bad;
            Py_DECREF(member);
            member = PyFloat_FromDouble(s.qual); if (member == NULL) goto bad;
            if (PyDict_SetItem(res, __pyx_n_s_qual, member) < 0) goto bad;
            Py_DECREF(member);
            return res;
            bad:
            Py_XDECREF(member);
            Py_DECREF(res);
            return NULL;
          }
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
    const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
    const uint8_t neg_one = (uint8_t) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                     little, !is_unsigned);
    }
}

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return ::std::complex< float >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #else
            return hypotf(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
            __pyx_t_float_complex z;
            float r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    float denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(a, a);
                    case 3:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, a);
                    case 4:
                        z = __Pyx_c_prodf(a, a);
                        return __Pyx_c_prodf(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_absf(a);
                theta = atan2f(a.imag, a.real);
            }
            lnr = logf(r);
            z_r = expf(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cosf(z_theta);
            z.imag = z_r * sinf(z_theta);
            return z;
        }
    #endif
#endif

#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

#if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real * b.real + b.imag * b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(a, a);
                    case 3:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, a);
                    case 4:
                        z = __Pyx_c_prod(a, a);
                        return __Pyx_c_prod(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                }
                r = a.real;
                theta = 0;
            } else {
                r = __Pyx_c_abs(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            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
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
#else
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
#endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (unlikely(et != PyExc_StopIteration) &&
            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PyObject_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
#endif
static CYTHON_INLINE
void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    if (value) {
#if CYTHON_COMPILING_IN_PYPY
#else
        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
        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)
        PyErr_SetNone(PyExc_GeneratorExit);
    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
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();
        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 (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;
        }
        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);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    return 0;
}
static void __Pyx_Generator_dealloc(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label > 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Generator_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Generator_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Generator_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        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);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Generator_get_name(__pyx_GeneratorObject *self)
{
    Py_INCREF(self->gi_name);
    return self->gi_name;
}
static int
__Pyx_Generator_set_name(__pyx_GeneratorObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Generator_get_qualname(__pyx_GeneratorObject *self)
{
    Py_INCREF(self->gi_qualname);
    return self->gi_qualname;
}
static int
__Pyx_Generator_set_qualname(__pyx_GeneratorObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Generator_get_name, (setter)__Pyx_Generator_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Generator_get_qualname, (setter)__Pyx_Generator_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_GeneratorObject, is_running), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
    {"throw", (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
    {"close", (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_GeneratorObject),
    0,
    (destructor) __Pyx_Generator_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Generator_traverse,
    0,
    0,
    offsetof(__pyx_GeneratorObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Generator_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Generator_del,
#endif
};
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure, PyObject *name, PyObject *qualname) {
    __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;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    PyObject_GC_Track(gen);
    return gen;
}
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (__pyx_GeneratorType == NULL) {
        return -1;
    }
    return 0;
}

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

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

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

static int __Pyx_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
        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(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)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
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if !CYTHON_COMPILING_IN_PYPY
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #endif
    return PyLong_AsSsize_t(b);
  }
  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) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
